From 4a62625d99470c8928422c4822df5234b93b6bb8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 28 Apr 2023 12:07:09 -0400 Subject: 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 --- lib/sqlalchemy/sql/crud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/crud.py') diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py index 563f61c04..16d5ce494 100644 --- a/lib/sqlalchemy/sql/crud.py +++ b/lib/sqlalchemy/sql/crud.py @@ -1344,7 +1344,7 @@ def _get_update_multitable_params( ): normalized_params = { coercions.expect(roles.DMLColumnRole, c): param - for c, param in stmt_parameter_tuples + for c, param in stmt_parameter_tuples or () } include_table = compile_state.include_table_with_column_exprs -- cgit v1.2.1