[Django] #27441: MySQL backend output for 'DROP COLUMN' uses undocumented SQL

18 views
Skip to first unread message

Django

unread,
Nov 5, 2016, 9:08:39 AM11/5/16
to django-...@googlegroups.com
#27441: MySQL backend output for 'DROP COLUMN' uses undocumented SQL
------------------------------------------------+------------------------
Reporter: Adam Chainz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Django's default SchemaEditor outputs `DROP COLUMN ... CASCADE`. When
inspecting the SQL for a migration I saw this and wondered what the
`CASCADE` means - it's not documented on MySQL (
http://dev.mysql.com/doc/refman/5.7/en/alter-table.html ), but I
discovered it is a no-op added for compatibility with e.g. postgres where
it does mean something. I added this to the MariaDB documentation (
https://mariadb.com/kb/en/mariadb/alter-table/ ) because it's editable,
but it's not going to get added to the MySQL documentation any time soon.

Since it's potentially confusing and a no-op, I think Django shouldn't
output `CASCADE` on MySQL.

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

Django

unread,
Nov 5, 2016, 9:08:56 AM11/5/16
to django-...@googlegroups.com
#27441: MySQL backend output for 'DROP COLUMN' uses undocumented SQL
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
Type: | Chainz
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Chainz):

* owner: nobody => Adam Chainz
* status: new => assigned
* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/7478

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

Django

unread,
Nov 5, 2016, 10:29:31 AM11/5/16
to django-...@googlegroups.com
#27441: MySQL backend output for 'DROP COLUMN' uses undocumented SQL
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
Type: | Chainz
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Ready for checkin


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

Django

unread,
Nov 5, 2016, 5:24:05 PM11/5/16
to django-...@googlegroups.com
#27441: MySQL backend output for 'DROP COLUMN' uses undocumented SQL
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
Type: | Chainz
Cleanup/optimization | Status: closed
Component: Migrations | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette <charettes@…>):

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


Comment:

In [changeset:"c7dddc01d6ca8d8d89f84d26123ecb021aa2a108" c7dddc0]:
{{{
#!CommitTicketReference repository=""
revision="c7dddc01d6ca8d8d89f84d26123ecb021aa2a108"
Fixed #27441 -- Improved SQL for 'DROP COLUMN' on MySQL

'CASCADE' is an undocumented no-op in MySQL, so to avoid confusion Django
no longer outputs it.
}}}

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

Reply all
Reply to author
Forward
0 new messages