summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-03-08 13:40:12 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-03-08 13:40:12 -0500
commitc36965ab211183764357456fff1640418586ed97 (patch)
tree5e86792149df2f4188b0f363b5520f686312b6fb /lib/sqlalchemy/sql/compiler.py
parent956ef43c5f858e6adb3bf00df0063a389ba567fc (diff)
downloadsqlalchemy-c36965ab211183764357456fff1640418586ed97.tar.gz
pop the stack that we pushed
Fixed regression caused by :ticket:`7760` where the new capabilities of :class:`.TextualSelect` were not fully implemented within the compiler properly, leading to issues with composed INSERT constructs such as "INSERT FROM SELECT" and "INSERT...ON CONFLICT" when combined with CTE and textual statements. Fixes: #7798 Change-Id: Ia2ce92507e574dd36fd26dd38ec9dd2713584467
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 712d31462..09e38a5ab 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1721,6 +1721,8 @@ class SQLCompiler(Compiled):
nesting_level = len(self.stack) if not toplevel else None
text = self._render_cte_clause(nesting_level=nesting_level) + text
+ self.stack.pop(-1)
+
return text
def visit_null(self, expr, **kw):