do_attr in SQLConnect.c is broken on some myodbc versions (data loss bug)

Andy Lutomirski <[email protected]> Tue, 30 Jul 2013 19:05:53 -0700
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <CALCETrUh1sa+APHpCYUih0SZJ3pAzD-BotkdexsHU3u4EatH7g@mail.gmail.com>
do_attr in SQLConnect.c does this:

    if ( value_set )
    {
        if (CHECK_SQLSETCONNECTATTR( connection ))
        {
            SQLSETCONNECTATTR(connection,
                        connection -> driver_dbc,
                        attr3,
                        value,
                        sizeof( value ));

That checks for function[61]->func.

My copy of libmyodbc5.so provides SQLSetConnectAttrW and
MySQLSetConnectAttr.  This means that ->funcW and ->funcA get set, but
->func does not (I haven't tried to follow all the machinations
involved in this).

The upshot is that CHECK_SQLSETCONNECTATTR is false.  This causes
SQL_ATTR_AUTOCOMMIT to have no effect if set to false before
SQLDriverConnect gets called.  This is a data loss bug.

--Andy
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev