Bug #38491 SQL_AUTO_IS_NULL has conflicting descriptions in the docs
Submitted: 31 Jul 2008 14:03 Modified: 5 Feb 2009 16:54
Reporter: Chris Wilson Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Documentation Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: Tony Bedford CPU Architecture:Any

[31 Jul 2008 14:03] Chris Wilson
Description:
The definitions of SQL_AUTO_IS_NULL are different on these two pages:

* http://dev.mysql.com/doc/refman/5.0/en/myodbc-configuration-connection-parameters.html

* http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_is-null

The first says that setting the FLAG_AUTO_IS_NULL option sets SQL_AUTO_IS_NULL to 1, which disables the standard behaviour.

The second says that setting SQL_AUTO_IS_NULL to 0 disables the standard behaviour.

The latter appears to agree with this one:

* http://dev.mysql.com/doc/refman/5.0/en/server-session-variables.html#option_mysqld_sql_aut...

which says "If set to 1 (the default), you can find the last inserted row for a table that contains an AUTO_INCREMENT column", which implies that setting the flag to 0 would disable the standard (default) behaviour.

Either this is a conflict or the meaning of "standard behaviour" is different in the two cases.

How to repeat:
Read the above pages in the docs. Bang head on wall.

Suggested fix:
Make the docs consistent.
[31 Jul 2008 14:32] Valeriy Kravchuk
I think SQL standard behaviour of IS NULL is meant by "standard behaviour" on that page. I think this is NOT a bug.
[31 Jul 2008 14:36] Chris Wilson
if so, then the meaning of "standard behaviour" in the main manual does not mean the same thing as in the ODBC driver manual. Wouldn't that be the bug instead?

if there is confusion of "SQL standard" versus "MySQL standard" then perhaps it should be clarified wherever it appears, or defined in a glossary?

In any case it would probably be helpful if the docs for this particular option, regarding non-SQL-compliant behaviour of MySQL, were perfectly clear and consistent about which value of the option enables the non-compliant behaviour, which one disables it, and what is the default setting in MySQL.
[31 Jul 2008 15:39] Chris Wilson
From my experiments, the actual behaviour of MyODBC 3.51 is this:

When FLAG_AUTO_IS_NULL is set, the driver does not change the default value of SQL_AUTO_IS_NULL, leaving it at 1, so you get the MySQL default, not the SQL standard behaviour.

When FLAG_AUTO_IS_NULL is not set, the driver changes the default value of SQL_AUTO_IS_NULL to 0 after connecting, so you get the SQL standard, not the MySQL default behaviour.

Therefore the description of the flag in the ODBC driver is misleading although not actually wrong (it does not set the option to 1 if the flag is present, rather it sets it to 0 if the flag is absent) and I think it should not say "this enables the non-standard behaviour", but rather than omitting the flag disable the compatibility option and forces SQL standard behaviour.
[5 Feb 2009 16:54] Tony Bedford
The documentation has been clarified. Thank you!