diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-12-28 12:04:07 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-12-28 14:24:29 -0500 |
commit | 510caee2e68d8665577d67bbc4afda7bbca31f9f (patch) | |
tree | 0958619986859d414f5cf5f928f7e1d55a7c87b2 /lib/sqlalchemy | |
parent | 9b879cee072e112f43f70c5b42df4577798a6eb5 (diff) | |
download | sqlalchemy-510caee2e68d8665577d67bbc4afda7bbca31f9f.tar.gz |
ensure whereclause, returning copied as tuples
Fixed issue in the internal SQL traversal for DML statements like
:class:`_dml.Update` and :class:`_dml.Delete` which would cause among other
potential issues, a specific issue using lambda statements with the ORM
update/delete feature.
Fixes: #9033
Change-Id: I76428049cb767ba302fbea89555114bf63ab8687
(cherry picked from commit e68173bf7d296b2948abed06f79c7cbd0ab66b0d)
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/sql/dml.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 07a4d7b2d..ae4874000 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -928,12 +928,12 @@ class Insert(ValuesBase): ("_multi_values", InternalTraversal.dp_dml_multi_values), ("select", InternalTraversal.dp_clauseelement), ("_post_values_clause", InternalTraversal.dp_clauseelement), - ("_returning", InternalTraversal.dp_clauseelement_list), + ("_returning", InternalTraversal.dp_clauseelement_tuple), ("_hints", InternalTraversal.dp_table_hint_list), ("_return_defaults", InternalTraversal.dp_boolean), ( "_return_defaults_columns", - InternalTraversal.dp_clauseelement_list, + InternalTraversal.dp_clauseelement_tuple, ), ] + HasPrefixes._has_prefixes_traverse_internals @@ -1208,16 +1208,16 @@ class Update(DMLWhereBase, ValuesBase): _traverse_internals = ( [ ("table", InternalTraversal.dp_clauseelement), - ("_where_criteria", InternalTraversal.dp_clauseelement_list), + ("_where_criteria", InternalTraversal.dp_clauseelement_tuple), ("_inline", InternalTraversal.dp_boolean), ("_ordered_values", InternalTraversal.dp_dml_ordered_values), ("_values", InternalTraversal.dp_dml_values), - ("_returning", InternalTraversal.dp_clauseelement_list), + ("_returning", InternalTraversal.dp_clauseelement_tuple), ("_hints", InternalTraversal.dp_table_hint_list), ("_return_defaults", InternalTraversal.dp_boolean), ( "_return_defaults_columns", - InternalTraversal.dp_clauseelement_list, + InternalTraversal.dp_clauseelement_tuple, ), ] + HasPrefixes._has_prefixes_traverse_internals @@ -1436,8 +1436,8 @@ class Delete(DMLWhereBase, UpdateBase): _traverse_internals = ( [ ("table", InternalTraversal.dp_clauseelement), - ("_where_criteria", InternalTraversal.dp_clauseelement_list), - ("_returning", InternalTraversal.dp_clauseelement_list), + ("_where_criteria", InternalTraversal.dp_clauseelement_tuple), + ("_returning", InternalTraversal.dp_clauseelement_tuple), ("_hints", InternalTraversal.dp_table_hint_list), ] + HasPrefixes._has_prefixes_traverse_internals |