[unixODBC-support] RE : SQLSetStmtAttr Question

Ludo Brands ludo.brands at free.fr
Thu Oct 28 08:34:28 BST 2010

this is a MySQL driver and server issue. More info here:
I just had a quick look in the 5.1.7 source code (driver/options.c) :
setting SQL_ATTR_QUERY_TIMEOUT still doesn't do anything.
Calling SQLCancel from a separate thread should work but needs some
programming. This kills the query thread on the server. However, it won't
solve your problem in case of a disabled network interface... 
Cheers, Ludo

-----Message d'origine-----
De : unixodbc-support-bounces at mailman.unixodbc.org
[mailto:unixodbc-support-bounces at mailman.unixodbc.org] De la part de Robert
Envoyé : mercredi 27 octobre 2010 21:57
À : unixODBC-support at mailman.unixodbc.org
Objet : [unixODBC-support] SQLSetStmtAttr Question


I am using unixODBC-2.3.0, mysql-connector-odbc-5.1.7 and MySQL server
5.1.46.  I am trying to use the SQLSetStmtAttr function to have the
SQLExecDirect return after the timeout I set.  I've checked my trace file
and; Attribute =  SQL_ATTR_QUERY_TIMEOUT and the Value = 0x6.

When I run the SQLExecDirect and disable my network interface the query
hangs indefinitely, and the timeout seems to be ignored.  When I re-enable
my interface the SQLExecDirect completes.  This is the same behavior when
using the isql command line options.

I've also checked SQLSetStmtAttr.c and could not find any mention of the

Any ideas on how to actually set the timeout for each query?

Any help is appreciated.

Thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20101028/d1ef02a8/attachment.html>

More information about the unixODBC-support mailing list