Ignore transaction management statements in SQL scripts
Now that we don't run SQL script with a single .execute() call,
transaction management statements (BEGIN, COMMIT, END) fail with
operational error. Ignore them if occurred in a script.
All in all, transactions are managed by SQLAlchemy-migrate itself, so
there is no reason for the calling code to pass those statements in a
SQL script. Warn user about the statements that are ignored.
The ideal response to such a warning from library users is removing
those redundant transaction management statements from their scripts.
Note: ROLLBACK is not ignored even though it's one of transaction
management statements because its usage in migration scripts is insane
anyway, and we're better fail on it and not (almost) silently ignore it.
Reviewed: https:/ /review. openstack. org/121517 /git.openstack. org/cgit/ stackforge/ sqlalchemy- migrate/ commit/ ?id=938757e7aa5 81646a6a501426a 5dae84ebe5631f
Committed: https:/
Submitter: Jenkins
Branch: master
commit 938757e7aa58164 6a6a501426a5dae 84ebe5631f
Author: Ihar Hrachyshka <email address hidden>
Date: Mon Sep 15 13:58:07 2014 +0200
Ignore transaction management statements in SQL scripts
Now that we don't run SQL script with a single .execute() call,
transaction management statements (BEGIN, COMMIT, END) fail with
operational error. Ignore them if occurred in a script.
All in all, transactions are managed by SQLAlchemy-migrate itself, so
there is no reason for the calling code to pass those statements in a
SQL script. Warn user about the statements that are ignored.
The ideal response to such a warning from library users is removing
those redundant transaction management statements from their scripts.
Note: ROLLBACK is not ignored even though it's one of transaction
management statements because its usage in migration scripts is insane
anyway, and we're better fail on it and not (almost) silently ignore it.
Change-Id: Ie4179c0e9341d4 2656d66821aaac2 3f8dcd33927
Closes-bug: 1368391