Bug #61838 SQLExecute returns 1 instead of -1
Submitted: 12 Jul 2011 19:09 Modified: 6 Oct 2011 19:03
Reporter: John Water Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.8 OS:Windows (Win XP)
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: Bulk mode

[12 Jul 2011 19:09] John Water
Description:
In bulk upload mode, SQLExecute would return SQL_SUCCESS_WITH_INFO, even when the upload data contains errors, such as primary duplication, foreign key violation, etc.
A repro is attached.  If you run the repro against a database from all the other vendors,
such as Oracle, Microsoft SQL Server, Sybase ASE, DB2, Sybase SQL Anywhere, SQLExecute will return SQL_ERROR, not SQL_SUCCESS_WITH_INFO.

How to repeat:

How to repeat:
Here are the steps to run the repro:
1) Detach the zip file and unzip it;
The zip file contains two files, odbcbug.exe (executable for running on Windows x86) and
odbcbug.c (the source code used to build odbcbug.exe).
2) Issue the following command line:
  odbcbug "dsn=...;uid=...;pwd=..."
you'll see SQLExecute returns 1 when the MySQL ODBC driver 5.1.8 is used.  SQLExecute will return -1 when you run the repro against the other databases.
[13 Jul 2011 3:43] Bogdan Degtyariov
John,

Thanks for reporting the bug.
It is a duplicate of http://bugs.mysql.com/bug.php?id=59772, which has recently been fixed.

The next release of Connector/ODBC 5.1.9 will have this patch. Meanwhile it is available in the source tree if you want to build the driver on your own. Here are the instructions how to obtain development sources and build the driver:

http://dev.mysql.com/doc/refman/5.5/en/connector-odbc-installation-source-development.html
[6 Oct 2011 19:03] John Water
I just downloaded the MySQL ODBC driver, version 5.1.9.  This bug is still in 5.1.9.  Are you sure it is fixed in version 5.1.9?