diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-03 17:22:30 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-03 17:23:56 -0500 |
commit | 7fe400f54632835695f7b98f0c1a54424953dfad (patch) | |
tree | c8e1b22a62313011f2c6c0ee5611e01081a67bff /lib/sqlalchemy/sql/compiler.py | |
parent | 4c81d99bab0e884473abfcb573772aa5d94264c7 (diff) | |
download | sqlalchemy-7fe400f54632835695f7b98f0c1a54424953dfad.tar.gz |
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
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d31cf67f8..424282951 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -723,6 +723,7 @@ class SQLCompiler(Compiled): # a map which tracks "truncated" names based on # dialect.label_length or dialect.max_identifier_length self.truncated_names = {} + Compiled.__init__(self, dialect, statement, **kwargs) if ( |