Issue 107601 - Problem opening MSSQL tables via unixODBC with uniqueidentifier as primary key
Summary: Problem opening MSSQL tables via unixODBC with uniqueidentifier as primary key
Status: UNCONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 3.1.1
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-10 16:28 UTC by jkstrick
Modified: 2013-01-29 21:47 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jkstrick 2009-12-10 16:28:13 UTC
I am trying to open tables in an MSSQL database from OO.o Base via unixODBC, 
but when I try, I get the following error:

    The data content could not be loaded.

    [unixODBC][Driver Manager]Invalid cursor state

I also get the same error if I run a query as "SELECT * FROM MyTable".

However, if I run the query as "SELECT ID, Field1, Field2 FROM MyTable", 
including all of the fields from the table, the query runs.

Also, if I run "SELECT * FROM MyTable" with "Run SQL Command Directly" 
selected, it also works.

So, I ran the SQL Server profiler on the "SELECT * FROM MyTable" query, 
without "Run SQL Command Directly", and the following queries show up:
--
    declare @p1 int
    set @p1=1
    exec sp_prepare @p1 output,N'@P1 varchar(80)',N'SELECT * FROM "MyTable"
        WHERE "MyTable"."ID" = @P1',1
    select @p1
--
    declare @p1 int
    set @p1=2
    exec sp_prepare @p1 output,N'@P1 BINARY(1)',N'SELECT * FROM "MyTable"
        WHERE "MyTable"."ID" = @P1',1
    select @p1
--

I'm not sure what OO.o Base is trying to do here, but trying to compare a 
uniqueidentifier field with INT doesn't seem to be working.  Also, I'm not 
convinced that this isn't an issue with unixODBC or FreeTDS.

OO.o 3.1
unixodbc 2.2.11
freetds 0.82

Thanks!
Comment 1 jkstrick 2009-12-10 16:44:47 UTC
> ...trying to compare a 
uniqueidentifier field with INT doesn't seem to be working

Nevermind that bit.  That's not what the query is trying to do (uppercase @P1 
vs lowercase @p1).  Still I don't know what it's doing there.

Thanks!