Bug #47119 Remove 'ODBC hack' or set sql_auto_is_null=0 as default
Submitted: 4 Sep 2009 2:04 Modified: 2 Dec 2015 7:36
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[4 Sep 2009 2:04] Roel Van de Paar
Description:
Feature request to remove the ODBC hack as listed on this page:
http://bugs.mysql.com/bug.php?id=47005&thanks=1&notify=199

Or to disable it by default, by having sql_auto_is_null as 0 by default.

For reasons/ideas/discussion: see bug #47005

How to repeat:
N/A

Suggested fix:
As per above
[4 Sep 2009 3:46] Valeriy Kravchuk
Thank you for the feature request.
[4 Sep 2009 20:22] Jim Winstead
Note that Connector/ODBC doesn't even leave this enabled by default, it explicitly issues an "SET SQL_AUTO_IS_NULL = 0" on connection unless it has been configured not to. We'll need to update C/ODBC to enable it when the default is changed, but this is a trivial change.

According to comments in the code of Connector/ODBC, this hack was only necessary for older versions of Microsoft Access, and possibly other products.
[4 Sep 2009 21:20] Roel Van de Paar
Pasted wrong URL in original description. Should have been:
http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-usagenotes-functionality.html

> According to comments in the code of Connector/ODBC, this hack was only necessary for older versions of Microsoft Access, and possibly other products.

Manual lists Delphi as well:
'Certain ODBC applications (including Delphi and Access) may have trouble obtaining the auto-increment value using the previous examples. In this case, try the following statement as an alternative: SELECT * FROM tbl WHERE auto IS NULL;'
[2 Dec 2015 7:34] MySQL Verification Team
This is disabled by default in recent versions.

mysql> set @@sql_auto_is_null:=default;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@sql_auto_is_null,@@version;
+--------------------+-----------+
| @@sql_auto_is_null | @@version |
+--------------------+-----------+
|                  0 | 5.8.0-m17 |
+--------------------+-----------+
1 row in set (0.00 sec)
[2 Dec 2015 7:36] Roel Van de Paar
Great! Thanks @Shane