2 messages in com.mysql.lists.bugsRE: RE: ECS Error with 4.0.07 opening...
FromSent OnAttachments
Venu17 May 2002 11:26 
Michael Widenius19 May 2002 01:35 
Subject:RE: RE: ECS Error with 4.0.07 opening DB (still) again -EMEA2490
From:Michael Widenius (mon@mysql.com)
Date:05/19/2002 01:35:42 AM
List:com.mysql.lists.bugs

Hi!

"venu" == venu <ve@mysql.com> writes:

<cut>

venu> MySQL/MyODBC does accept connection timeout. Here is the code venu> snippet from driver:

venu> case SQL_ATTR_CONNECTION_TIMEOUT: venu> DBUG_RETURN(mysql_options(&dbc->mysql, MYSQL_OPT_CONNECT_TIMEOUT, venu> (const char *)((SQLUINTEGER)ValuePtr))); venu> break;

venu> So, driver does set correctly. Make a note that, the value '0' means venu> default in ODBC, and that means no timedout.

Venu, the above code is slightly wrong:

To be 100 % correct, it should be:

case SQL_ATTR_CONNECTION_TIMEOUT: { uint timeout_argument= *(SQLUINTEGER*) ValuePtr; DBUG_RETURN(mysql_options(&dbc->mysql, MYSQL_OPT_CONNECT_TIMEOUT, (const char *) &timeout_argument)); }

on the other hand, the old code should work as SQL_UINTEGER should be of type uint.

If the old code crashes, it means that ValuePtr is not pointing at a valid uint address, in which case the bug is in the application or the driver manager.

Regards, Monty