Opened 7 years ago

Closed 7 years ago

#27631 closed Bug (fixed)

Prevent execution of transactional DDL statements when unsupported.

Reported by: Simon Charette Owned by: Simon Charette
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (4)

comment:1 by Simon Charette, 7 years ago

Has patch: set

comment:2 by Tim Graham, 7 years ago

Summary: Prevent execution of transactionnal DDL statements when unsupported.Prevent execution of transactional DDL statements when unsupported.
Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham, 7 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Simon Charette <charette.s@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In 8138058:

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.

Note: See TracTickets for help on using tickets.
Back to Top