[unixODBC-support] second opinion on quiktest.c

Eric Sharkey sharkey at netrics.com
Mon Feb 21 20:40:55 GMT 2005


I'm getting a failure report from quiktest.c's SQLStatistics test
when run with my driver, and I think this is another example of a
bad test, and not a problem with my code.  Can I get a second opinion
on this?

The relevant parts of the ODBC trace are here:

[ODBC][22326][SQLExecDirect.c][233]
                Entry:
                        Statement = 0x8251018
                        SQL = [Create Table Q142236 ( c01VARC VARCHAR(2147483647) NOT NULL)][length = 60 (SQL_NTS)]
[ODBC][22326][SQLExecDirect.c][496]
                Exit:[SQL_SUCCESS]
[clipped]
[ODBC][22326][SQLStatistics.c][196]
                Entry:
                        Statement = 0x8251018
                        Catalog Name = [NULL]
                        Schema Name = [NULL]
                        Table Name = [Q142236][length = 7 (SQL_NTS)]
                        Unique = 1
                        Reserved = 1
[ODBC][22326][SQLStatistics.c][426]
                Exit:[SQL_SUCCESS]
[ODBC][22326][SQLFetch.c][158]
                Entry:
                        Statement = 0x8251018
[ODBC][22326][SQLFetch.c][340]
                Exit:[SQL_NO_DATA]

What's happening is it executes a table creation command without
quoting the table name, so the datasource downcases the name and
creates a table named "q142236".  It then executes SQLStatistics
without calling SQLSetStmtAttr to set the value of METADATA_ID, so
it's still got the default value of FALSE (case sensitive) and it
asks for SQLStatistics on the table "Q142236", which doesn't exist.
It then complains when SQLFetch return SQL_NO_DATA, since SQLStatistics
returns no rows.

Is this the correct thing for my driver to be doing, given that
it returns SQL_IC_LOWER to SQLGetInfo requests for SQL_IDENTIFIER_CASE?

Eric



More information about the unixODBC-support mailing list