Comment 31 for bug 1368391

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sqlalchemy-migrate (master)

Reviewed: https://review.openstack.org/121517
Committed: https://git.openstack.org/cgit/stackforge/sqlalchemy-migrate/commit/?id=938757e7aa581646a6a501426a5dae84ebe5631f
Submitter: Jenkins
Branch: master

commit 938757e7aa581646a6a501426a5dae84ebe5631f
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: Ie4179c0e9341d42656d66821aaac23f8dcd33927
    Closes-bug: 1368391