[unixODBC-dev] ODBC driver regression testing

Eric Sharkey sharkey at netrics.com
Fri Feb 11 21:04:06 GMT 2005


> BTW, in case you are wondering about my comment about the authors of 
> quicktest,c, it originated with the Microsoft SDK :-)

Yeah, I picked up on that.

The test itself may have some bugs, but it's certainly turning up
bugs in my driver, and in unixODBC as well.

Calling SQLSetConnectAttr on a connection handle in state C2,
with an option of SQL_ATTR_LOGIN_TIMEOUT and a string_length > 0
will cause the unixODBC Driver manager to interpret
SQL_ATTR_LOGIN_TIMEOUT as a pointer and try to memcpy from this
address.

You need to change:

        else if ( attribute == SQL_ATTR_TXN_ISOLATION )
        {
            connection -> txn_isolation = ( SQLLEN ) value;
            connection -> txn_isolation_set = 1;
        }
        else
        {
            /*
             * save any unknown attributes untill connect
             */

To:

        else if ( attribute == SQL_ATTR_TXN_ISOLATION )
        {
            connection -> txn_isolation = ( SQLLEN ) value;
            connection -> txn_isolation_set = 1;
        }
        else if ( attribute != SQL_ATTR_LOGIN_TIMEOUT )
        {
            /*
             * save any unknown attributes untill connect
             */

in SQLSetConnectAttr.c.

Eric



More information about the unixODBC-dev mailing list