[Django] #32374: Migrations are marked applied even if deferred SQL fails to execute

0 views
Skip to first unread message

Django

unread,
Jan 20, 2021, 6:40:10 PM1/20/21
to django-...@googlegroups.com
#32374: Migrations are marked applied even if deferred SQL fails to execute
------------------------------------------+--------------------------
Reporter: Simon Charette | Owner: nobody
Type: Bug | Status: assigned
Component: Migrations | Version: 2.2
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 |
------------------------------------------+--------------------------
The changes introduced in c86a3d80a25acd1887319198ca21a84c451014ad to
address #29721 fail to account for the possibility of the schema editor
accumulation of deferred SQL which is run at `SchemaEditor.__exit__` time.

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

Django

unread,
Jan 20, 2021, 7:10:14 PM1/20/21
to django-...@googlegroups.com
#32374: Migrations are marked applied even if deferred SQL fails to execute
--------------------------------+--------------------------------------

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


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

Django

unread,
Jan 21, 2021, 12:14:47 AM1/21/21
to django-...@googlegroups.com
#32374: Migrations are marked applied even if deferred SQL fails to execute
--------------------------------+------------------------------------------
Reporter: Simon Charette | Owner: Simon Charette

Type: Bug | Status: assigned
Component: Migrations | Version: 2.2
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 Mariusz Felisiak):

* owner: nobody => Simon Charette
* stage: Unreviewed => Accepted


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

Django

unread,
Jan 21, 2021, 1:35:18 AM1/21/21
to django-...@googlegroups.com
#32374: Migrations are marked applied even if deferred SQL fails to execute
--------------------------------+------------------------------------------
Reporter: Simon Charette | Owner: Simon Charette
Type: Bug | Status: closed
Component: Migrations | Version: 2.2
Severity: Normal | Resolution: fixed
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 Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"0c42cdf0d2422f4c080e93594d5d15381d6e955e" 0c42cdf0]:
{{{
#!CommitTicketReference repository=""
revision="0c42cdf0d2422f4c080e93594d5d15381d6e955e"
Fixed #32374 -- Stopped recording migration application before deferred
SQL.

Migrations cannot be recorded in the same transaction as its associated
DDL operations when some of it is deferred until the schema editor
context exits.

Regression in c86a3d80a25acd1887319198ca21a84c451014ad.
}}}

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

Django

unread,
Jan 21, 2021, 1:36:12 AM1/21/21
to django-...@googlegroups.com
#32374: Migrations are marked applied even if deferred SQL fails to execute
--------------------------------+------------------------------------------
Reporter: Simon Charette | Owner: Simon Charette
Type: Bug | Status: closed
Component: Migrations | Version: 2.2

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"6520ce5251e7d63d08bf965e5ca00e508f8a8613" 6520ce5]:
{{{
#!CommitTicketReference repository=""
revision="6520ce5251e7d63d08bf965e5ca00e508f8a8613"
[3.2.x] Fixed #32374 -- Stopped recording migration application before
deferred SQL.

Migrations cannot be recorded in the same transaction as its associated
DDL operations when some of it is deferred until the schema editor
context exits.

Regression in c86a3d80a25acd1887319198ca21a84c451014ad.

Backport of 0c42cdf0d2422f4c080e93594d5d15381d6e955e from master
}}}

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

Reply all
Reply to author
Forward
0 new messages