[Django] #27631: Prevent execution of transactionnal DDL statements when unsupported.

26 views
Skip to first unread message

Django

unread,
Dec 23, 2016, 11:15:16 PM12/23/16
to django-...@googlegroups.com
#27631: Prevent execution of transactionnal DDL statements when unsupported.
------------------------------------------+--------------------------------
Reporter: Simon Charette | Owner: Simon Charette
Type: Bug | Status: assigned
Component: Migrations | Version: master
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 |
------------------------------------------+--------------------------------
Executing a DDL statement during a transaction on backends that don't
support it silently commits, leaving `atomic()` in an incoherent state.

While `schema_editor.execute()` could technically be used to execute DML
statements such usage should be uncommon as these are usually performed
through the ORM. In other cases `schema_editor.connection.execute()` can
be used to circumvent this check.

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

Django

unread,
Dec 23, 2016, 11:28:23 PM12/23/16
to django-...@googlegroups.com
#27631: Prevent execution of transactionnal DDL statements when unsupported.
--------------------------------+------------------------------------------

Reporter: Simon Charette | Owner: Simon Charette
Type: Bug | Status: assigned
Component: Migrations | Version: master
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 Simon Charette):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/7737 PR]

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

Django

unread,
Dec 24, 2016, 7:26:11 AM12/24/16
to django-...@googlegroups.com
#27631: Prevent execution of transactional DDL statements when unsupported.
--------------------------------+------------------------------------------

Reporter: Simon Charette | Owner: Simon Charette
Type: Bug | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
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 => Accepted


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

Django

unread,
Dec 28, 2016, 6:56:30 PM12/28/16
to django-...@googlegroups.com
#27631: Prevent execution of transactional DDL statements when unsupported.
-------------------------------------+-------------------------------------

Reporter: Simon Charette | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Migrations | Version: master
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: Accepted => Ready for checkin


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

Django

unread,
Dec 28, 2016, 7:44:07 PM12/28/16
to django-...@googlegroups.com
#27631: Prevent execution of transactional DDL statements when unsupported.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Migrations | Version: master
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 <charette.s@…>):

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


Comment:

In [changeset:"813805833aca60544f6b3d686c015039f6af5d1d" 8138058]:
{{{
#!CommitTicketReference repository=""
revision="813805833aca60544f6b3d686c015039f6af5d1d"
Fixed #27631 -- Prevented execution of transactional DDL statements when
unsupported.

Executing a DDL statement during a transaction on backends that don't


support
it silently commits, leaving atomic() in an incoherent state.

While schema_editor.execute() could technically be used to execute DML
statements such usage should be uncommon as these are usually performed
through
the ORM. In other cases schema_editor.connection.execute() can be used to
circumvent this check.

Thanks Adam and Tim for the review.
}}}

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

Reply all
Reply to author
Forward
0 new messages