[Django] #28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work in MySQL 5.5

69 views
Skip to first unread message

Django

unread,
May 2, 2017, 6:22:30 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
------------------------------------------+------------------------
Reporter: Robert Rollins | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------+------------------------
The Django docs claim that you can get rid of this warning by adding the
following to your `DATABASES` setting:

{{{
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
}}}

This does not work in MySQL 5.5.47. The warning doesn't go away.

However, adding ''this'' to `DATABASES` does get rid of the warning:

{{{
'OPTIONS': {
'sql_mode': 'STRICT_TRANS_TABLES',
}
}}}

I found this solution [http://stackoverflow.com/a/23023015/464318 here],
but it seems like it really should be in the docs. Unless this doesn't
work in newer MySQLs?

--
Ticket URL: <https://code.djangoproject.com/ticket/28162>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 2, 2017, 6:26:58 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Robert Rollins):

Forgot to mention that I'm having this problem in Django 1.10.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:1>

Django

unread,
May 2, 2017, 6:28:41 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Robert Rollins):

* type: Uncategorized => Bug
* version: 1.11 => 1.10
* component: Uncategorized => Documentation


--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:2>

Django

unread,
May 2, 2017, 8:28:58 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Tim Graham):

I'm not able to reproduce that problem with MySQL 5.5.55. Can you explain
why the command wouldn't work?

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:3>

Django

unread,
May 2, 2017, 8:31:20 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Robert Rollins):

When I run `manage.py migrate`, I still get the big yellow warning when
using `init_command`. The warning does not trigger when using `OPTIONS`.

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:4>

Django

unread,
May 2, 2017, 8:51:50 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Simon Charette):

Robert, which Python library are you using to connect to MySQL?

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:5>

Django

unread,
May 2, 2017, 8:55:32 PM5/2/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Robert Rollins):

My project uses mysqlclient 1.3.9.

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:6>

Django

unread,
May 3, 2017, 7:42:06 AM5/3/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Tim Graham):

I'm also testing with mysqlclient and the warning goes away for me when
using the `'init_command'` version. When I said "Can you explain why the
command wouldn't work?", I meant: do you know if there's some change in
MySQL 5.5.x that fixed a bug or something? Have you tried to reproduce on
newer versions of MySQL?

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:7>

Django

unread,
May 3, 2017, 1:39:55 PM5/3/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Robert Rollins):

No, I have no idea why this is happening, and have not tested it on any
different versions of MySQL. I'm just reporting the behavior that I'm
seeing in my current development environment.

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:8>

Django

unread,
May 5, 2017, 11:57:46 AM5/5/17
to django-...@googlegroups.com
#28162: Documented solution to "MySQL Strict Mode is not set" warning doesn't work
in MySQL 5.5
--------------------------------+--------------------------------------

Reporter: Robert Rollins | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: worksforme

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => worksforme
* easy: 1 => 0


Comment:

Since I can't reproduce the problem, I guess we'll close the ticket until
someone can explain what's going on so we know what documentation change
to make.

--
Ticket URL: <https://code.djangoproject.com/ticket/28162#comment:9>

Reply all
Reply to author
Forward
0 new messages