summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-11-11 12:34:00 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-11-11 12:34:00 -0500
commitb013fb82f5a5d891c6fd776e0e6ed926cdf2ffe1 (patch)
tree4b6bff8cba6409032a6450e399aeb102e6edc0d1 /lib/sqlalchemy/sql/compiler.py
parent21022f9760e32cf54d59eaccc12cc9e2fea1d37a (diff)
downloadsqlalchemy-b013fb82f5a5d891c6fd776e0e6ed926cdf2ffe1.tar.gz
- Fixed issue where the columns from a SELECT embedded in an
INSERT, either through the values clause or as a "from select", would pollute the column types used in the result set produced by the RETURNING clause when columns from both statements shared the same name, leading to potential errors or mis-adaptation when retrieving the returning rows. fixes #3248
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 5fa78ad0f..8f3ede25f 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1729,6 +1729,12 @@ class SQLCompiler(Compiled):
)
def visit_insert(self, insert_stmt, **kw):
+ self.stack.append(
+ {'correlate_froms': set(),
+ "iswrapper": False,
+ "asfrom_froms": set(),
+ "selectable": insert_stmt})
+
self.isinsert = True
crud_params = crud._get_crud_params(self, insert_stmt, **kw)
@@ -1812,6 +1818,8 @@ class SQLCompiler(Compiled):
if self.returning and not self.returning_precedes_values:
text += " " + returning_clause
+ self.stack.pop(-1)
+
return text
def update_limit_clause(self, update_stmt):