]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Restore crud flags if visiting_cte is set
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Mar 2020 22:22:30 +0000 (17:22 -0500)
committermike bayer <mike_mp@zzzcomputing.com>
Wed, 4 Mar 2020 02:22:54 +0000 (02:22 +0000)
commit2a9687ed40427d3adb00e1c7f6944ff4e3539c0b
tree26ed0d46cf087ebc7b233be583823a016dd58e1e
parent47abc46efe92d06b7ee8ded59d528f1b731ba492
Restore crud flags if visiting_cte is set

Fixed bug where a CTE of an INSERT/UPDATE/DELETE that also uses RETURNING
could then not be SELECTed from directly, as the internal state of the
compiler would try to treat the outer SELECT as a DELETE statement itself
and access nonexistent state.

Fixes: #5181
Change-Id: Icba76f2148c8344baa1c04bac4ab6c6d24f23072
(cherry picked from commit 7fe400f54632835695f7b98f0c1a54424953dfad)
doc/build/changelog/unreleased_13/5181.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/crud.py
test/sql/test_cte.py