﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16809	MySQL is not SQL standards compliant regarding IS NULL criteria on newly-inserted auto-incremented fields	jamesp	nobody	"MySQL has a setting which allows an auto-increment column to be returned on a newly-inserted row when tested for NULL.  This is enabled by default prior to MySQL 5.6.

This is an edge case in Django, which caused the following tests for #15316 to fail:

* test_ticket15316_exclude_false
* test_ticket15316_one2one_exclude_false

To correct this behavior, the following statement must be issued, once per connection:

{{{SET SQL_AUTO_IS_NULL = 0;}}}

Re: http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_sql_auto_is_null

Caveats:

This setting was introduced in MySQL 4.1 and is disabled in MySQL 5.6.  This patch does not check the version of the database, and the documentation currently indicates that MySQL 3.23 may be used with Django.  Please advise if version checking ought to be rolled into the provided patch."	Bug	closed	Database layer (models, ORM)	1.3	Normal	fixed	mysql, sql standards, auto_increment, count		Ready for checkin	1	0	0	0	0	0
