Bug #48603 c/ODBC does not respect client_interactive flag
Submitted: 6 Nov 2009 17:21 Modified: 23 Apr 2010 10:41
Reporter: Tonci Grgin Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S4 (Feature request)
Version:Any OS:Any
Assigned to: Lawrenty Novitsky CPU Architecture:Any

[6 Nov 2009 17:21] Tonci Grgin
Looking at mysql_com.h in source tree one can see 
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */

How to repeat:
Check sources.

Suggested fix:
Although ODBC API is not interactive and driver is just function library still this should, at least, be documented.
Also, I am having hard time understanding use case where it would be absolutely necessary for server to use interactive_timeout instead of wait_timeout. It appears to me it is easier to set the session wait_timeout to any desired value and not just to interactive_timeout defined somewhere else (my.cnf or such).

So, leaving to Lawrin to decide if this is a problem or just doc request.
[6 Nov 2009 20:09] Harrison Fisk
Where this would be useful is when there is a client application which uses ODBC with the following conditions:

*  Very short wait_timeout set.  This is relatively common to prevent some network problem from completely shutting down your system.  interactive_timeout is left at the default to allow other clients, such as 'mysql' or MySQL Administrator not disconnect.

*  Using a pre-made ODBC client

Most pre-made clients wouldn't have the ability to do SET session wait_timeout=50000; automatically, onr would you want to do it manually every time you connect.

Adding a new option flag to enable this seems like a relatively easy, straight forward thing to do.

Any reason against adding it?
[25 Jan 2010 13:05] Lawrenty Novitsky
Here is patch. It's still missing required Qt changes - I will add them later.
However if Bogdan wants to take that part over - I won't mind :) That is my secret plan 8-)

And I don't still understand why we need that option if

INITSTMT={set @@wait_timeout=<whatever_number_one_wants>};

does the job perfectly. But here is the patch anyway.
[26 Jan 2010 19:51] Lawrenty Novitsky
Patch w/out Qt part

Attachment: bug48603.patch (text/x-patch), 7.08 KiB.

[18 Feb 2010 12:23] Lawrenty Novitsky
attempt of adding of the option support in Qt gui

Attachment: bug48603v2.patch (application/octet-stream, text), 27.86 KiB.

[1 Mar 2010 22:50] Lawrenty Novitsky
Patch with fixed Qt part

Attachment: bug48603v3.patch (text/x-patch), 25.99 KiB.

[1 Mar 2010 22:57] Lawrenty Novitsky
Please re-review the patch as Qt code is added. At this time it wasn't just "blindly" added, but built and tested.
That v3 patch has been already pushed(RevNo867) as there is the request for hotfix build.
[2 Mar 2010 3:59] Jim Winstead
i would change "Tells server to use longer wait timeout for the connection(interactive timeout)" to "Identify connection as an interactive session" -- whether interactive_timeout is longer or not is up to the server configuration.

everything else looks good.
[8 Apr 2010 10:51] Lawrenty Novitsky
main part of the patch was pushed to the trunk earlier(rev#867). requested text change pushed to working_tree as revno#886
[23 Apr 2010 10:41] Tony Bedford
An entry has been added to the 5.1.7 changelog:

MySQL Connector/ODBC has been changed to support the CLIENT_INTERACTIVE flag.