Bug #59772 Column parameter binding makes SQLExecute not to return SQL_ERROR on disconnect
Submitted: 27 Jan 2011 7:59 Modified: 25 Jan 2012 23:23
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.8 OS:Any
Assigned to: Lawrenty Novitsky CPU Architecture:Any

[27 Jan 2011 7:59] Bogdan Degtyariov
Description:
When MySQL server gets disconnected and column wise parameter binding is used the driver puts SQL_PARAM_ERROR into the status buffer for all parameters, but the function returns SQL_SUCCESS_WITH_INFO instead of SQL_ERROR.

Apparently the driver moves the error status for each paramset into the status array, but does not react if ALL statements failed.

How to repeat:
See the test case + patch

Suggested fix:
See the test case + patch
[31 Jan 2011 7:34] Bogdan Degtyariov
Patch + test case

Attachment: bug59772.diff (text/x-diff), 4.14 KiB.

[2 Feb 2011 13:53] Lawrenty Novitsky
patch looks ok at 1st glance, but wouldn't it be better also to check connection prior to executing and set correct status. just like it was done in recent patch about net_write_timeout(Bug#39878). i will look more later
[22 Feb 2011 4:48] Bogdan Degtyariov
patch v2

Attachment: bug59772v2.diff (text/x-diff), 4.93 KiB.

[22 Feb 2011 4:48] Bogdan Degtyariov
V2 of the patch.
handle_connection_error() is used to avoid running new queries with
subsequent parameter sets. We cannot set SQL_ERROR at once for the entire
operation because previous queries might succeed.
[27 Apr 2011 21:52] Lawrenty Novitsky
t_bug56804 fails for me with patch applied. will need to check. looks like that is test what has to be changed.
[28 Apr 2011 18:24] Lawrenty Novitsky
patch v3

Attachment: bug59772v3.diff (text/x-diff), 6.80 KiB.

[28 Apr 2011 18:25] Lawrenty Novitsky
Bogdan, please review my changes
[11 May 2011 11:42] Bogdan Degtyariov
The changes in V3 look reasonable and all tests pass successfully
[17 Aug 2011 11:47] Lawrenty Novitsky
Patch pushed as rev#981.
[7 Oct 2011 15:54] John Water
This problem is still in the newly released ODBC driver, version 5.1.9.
[28 Dec 2011 19:51] Lawrenty Novitsky
John, we would appreciate a testcase - it would help a lot. or scenario description.
[25 Jan 2012 23:23] Philip Olson
This was already documented, as:

SQLExecute would return SQL_SUCCESS_WITH_INFO instead of
SQL_ERROR, when column parameter binding was
enabled.

So, closing.