]> 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>
Tue, 3 Mar 2020 22:23:56 +0000 (17:23 -0500)
commit7fe400f54632835695f7b98f0c1a54424953dfad
treec8e1b22a62313011f2c6c0ee5611e01081a67bff
parent4c81d99bab0e884473abfcb573772aa5d94264c7
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
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