#16809: MySQL is not SQL standards compliant regarding IS NULL criteria on
newly-
inserted auto-incremented fields
-------------------------------------+-------------------------------------
Reporter: jamesp | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Database layer
Version: 1.3 | (models, ORM)
Keywords: mysql, sql standards, | Severity: Normal
auto_increment, count | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/16809>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.