summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-04-28 12:07:09 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-05-09 10:08:52 -0400
commit4a62625d99470c8928422c4822df5234b93b6bb8 (patch)
tree280182818aea6846f1294705357b6a0754d51df4 /lib/sqlalchemy/dialects/mysql/base.py
parent39c8e95b1f50190ff30a836b2bcf13ba2cacc052 (diff)
downloadsqlalchemy-4a62625d99470c8928422c4822df5234b93b6bb8.tar.gz
implement FromLinter for UPDATE, DELETE statements
Implemented the "cartesian product warning" for UPDATE and DELETE statements, those which include multiple tables that are not correlated together in some way. Fixed issue where :func:`_dml.update` construct that included multiple tables and no VALUES clause would raise with an internal error. Current behavior for :class:`_dml.Update` with no values is to generate a SQL UPDATE statement with an empty "set" clause, so this has been made consistent for this specific sub-case. Fixes: #9721 Change-Id: I556639811cc930d2e37532965d2ae751882af921
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py
index 2ed2bbc7a..ae40fea99 100644
--- a/lib/sqlalchemy/dialects/mysql/base.py
+++ b/lib/sqlalchemy/dialects/mysql/base.py
@@ -1657,13 +1657,13 @@ class MySQLCompiler(compiler.SQLCompiler):
):
return None
- def delete_table_clause(self, delete_stmt, from_table, extra_froms):
+ def delete_table_clause(self, delete_stmt, from_table, extra_froms, **kw):
"""If we have extra froms make sure we render any alias as hint."""
ashint = False
if extra_froms:
ashint = True
return from_table._compiler_dispatch(
- self, asfrom=True, iscrud=True, ashint=ashint
+ self, asfrom=True, iscrud=True, ashint=ashint, **kw
)
def delete_extra_from_clause(