[Django] #26966: MySQL backend schema editor skip_default method requires update for MySQL 5.7

7 views
Skip to first unread message

Django

unread,
Jul 28, 2016, 9:38:35 AM7/28/16
to django-...@googlegroups.com
#26966: MySQL backend schema editor skip_default method requires update for MySQL
5.7
-------------------------------------+-------------------------------------
Reporter: mcgeeco | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) | Keywords: mysql, mysql 5.7,
Severity: Normal | jsonfield, backend, db
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Currently this method,
[https://github.com/django/django/blob/1.10rc1/django/db/backends/mysql/schema.py#L28
django.db.backends.mysql.schema.DatabaseSchemaEditor.skip_default], checks
for a certain group of field types (texts and blobs) to determine whether
defaults are applicable at the database level. Since MySQL 5.7, there is
one more which I believe needs to be added to this list - the new 'json'
type. I discovered this while working with the
[https://github.com/adamchainz/django-mysql/issues/312 django-mysql
module]. In that module a default of `dict` is set at the Django model
level but needs to be ignored for database operations.
As far as I can see it should be a pretty straight forward fix as I can't
see why it would interfere with the functionality for older versions of
MySQL.

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

Django

unread,
Jul 28, 2016, 10:08:22 AM7/28/16
to django-...@googlegroups.com
#26966: MySQL backend schema editor skip_default method requires update for MySQL
5.7
-------------------------------------+-------------------------------------
Reporter: mcgeeco | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql, mysql 5.7, | Triage Stage:
jsonfield, backend, db | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by adamchainz):

* cc: me@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


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

Django

unread,
Jul 28, 2016, 10:53:09 AM7/28/16
to django-...@googlegroups.com
#26966: MySQL backend schema editor skip_default method requires update for MySQL
5.7
-------------------------------------+-------------------------------------
Reporter: mcgeeco | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql, mysql 5.7, | Triage Stage: Accepted
jsonfield, backend, db |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


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

Django

unread,
Aug 1, 2016, 9:57:13 AM8/1/16
to django-...@googlegroups.com
#26966: MySQL backend schema editor skip_default method requires update for MySQL
5.7
-------------------------------------+-------------------------------------
Reporter: mcgeeco | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql, mysql 5.7, | Triage Stage: Accepted
jsonfield, backend, db |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by adamchainz):

* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/6997

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

Django

unread,
Aug 1, 2016, 10:41:20 AM8/1/16
to django-...@googlegroups.com
#26966: MySQL backend schema editor skip_default method requires update for MySQL
5.7
-------------------------------------+-------------------------------------
Reporter: mcgeeco | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql, mysql 5.7, | Triage Stage: Ready for
jsonfield, backend, db | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* stage: Accepted => Ready for checkin


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

Django

unread,
Aug 1, 2016, 1:51:33 PM8/1/16
to django-...@googlegroups.com
#26966: MySQL backend schema editor skip_default method requires update for MySQL
5.7
-------------------------------------+-------------------------------------
Reporter: mcgeeco | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: mysql, mysql 5.7, | Triage Stage: Ready for
jsonfield, backend, db | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"4b1c9708d629c08ebbd73293c89a159ccb436d4d" 4b1c9708]:
{{{
#!CommitTicketReference repository=""
revision="4b1c9708d629c08ebbd73293c89a159ccb436d4d"
Fixed #26966 -- Made MySQL backend skip defaults for JSON columns

Thanks mcgeeco for reporting, and claudep and timgraham for review.
}}}

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

Reply all
Reply to author
Forward
0 new messages