summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-04-17 00:30:29 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-04-17 00:37:47 -0400
commit901f7a2b534e4bbc88d7c6894541223cb0dd968d (patch)
tree6a647d3a18a771855d876a6c358fd9241213a219 /lib/sqlalchemy/sql
parentb73fc8f874da94c9c5b2d94feb6b1b45b7f4f02b (diff)
downloadsqlalchemy-901f7a2b534e4bbc88d7c6894541223cb0dd968d.tar.gz
pass asfrom correctly in compilers
Fixed an argument error in the default and PostgreSQL compilers that would interfere with an UPDATE..FROM or DELETE..FROM..USING statement that was then SELECTed from as a CTE. The incorrect pattern was also fixed in the mysql and sybase dialects. MySQL supports CTEs but not "returning". Fixes: #6303 Change-Id: Ic94805611a5ec443749fb6b1fd8a1326b0d83ef7
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/compiler.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 0c701cb52..b8e418d99 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -3881,16 +3881,18 @@ class StrSQLCompiler(SQLCompiler):
def update_from_clause(
self, update_stmt, from_table, extra_froms, from_hints, **kw
):
+ kw["asfrom"] = True
return "FROM " + ", ".join(
- t._compiler_dispatch(self, asfrom=True, fromhints=from_hints, **kw)
+ t._compiler_dispatch(self, fromhints=from_hints, **kw)
for t in extra_froms
)
def delete_extra_from_clause(
self, update_stmt, from_table, extra_froms, from_hints, **kw
):
+ kw["asfrom"] = True
return ", " + ", ".join(
- t._compiler_dispatch(self, asfrom=True, fromhints=from_hints, **kw)
+ t._compiler_dispatch(self, fromhints=from_hints, **kw)
for t in extra_froms
)