summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-08-03 16:55:23 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-08-05 12:53:35 -0400
commit9f992e42189746a7aff497abcf6ea9c08ab79e97 (patch)
treee2929beb07c29813c16bac05060a89e112166ab9 /test/sql
parent0027b3a4bc54599ac8102a4a3d81d8007738903e (diff)
downloadsqlalchemy-9f992e42189746a7aff497abcf6ea9c08ab79e97.tar.gz
translate joined inheritance cols in UPDATE/DELETE
Fixed issue in ORM enabled UPDATE when the statement is created against a joined-inheritance subclass, updating only local table columns, where the "fetch" synchronization strategy would not render the correct RETURNING clause for databases that use RETURNING for fetch synchronization. Also adjusts the strategy used for RETURNING in UPDATE FROM and DELETE FROM statements. Also fixes MariaDB which does not support RETURNING with DELETE..USING. this was not caught in tests because "fetch" strategy wasn't tested. so also adjust the ORMDMLState classes to look for "extra froms" first before adding RETURNING, add new parameters to interfaces for "update_returning_multitable" and "delete_returning_multitable". A new execution option is_delete_using=True, described in the changelog message, is added to allow the ORM to know up front if a certain statement should have a SELECT up front for "fetch" strategy. Fixes: #8344 Change-Id: I3dcdb68e6e97ab0807a573c2fdb3d53c16d063ba
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_delete.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sql/test_delete.py b/test/sql/test_delete.py
index 45ead811f..f98e7297d 100644
--- a/test/sql/test_delete.py
+++ b/test/sql/test_delete.py
@@ -307,7 +307,7 @@ class DeleteFromRoundTripTest(fixtures.TablesTest):
),
)
- @testing.requires.delete_from
+ @testing.requires.delete_using
def test_exec_two_table(self, connection):
users, addresses = self.tables.users, self.tables.addresses
dingalings = self.tables.dingalings
@@ -326,7 +326,7 @@ class DeleteFromRoundTripTest(fixtures.TablesTest):
]
self._assert_table(connection, addresses, expected)
- @testing.requires.delete_from
+ @testing.requires.delete_using
def test_exec_three_table(self, connection):
users = self.tables.users
addresses = self.tables.addresses
@@ -342,7 +342,7 @@ class DeleteFromRoundTripTest(fixtures.TablesTest):
expected = [(2, 5, "ding 2/5")]
self._assert_table(connection, dingalings, expected)
- @testing.requires.delete_from
+ @testing.requires.delete_using
def test_exec_two_table_plus_alias(self, connection):
users, addresses = self.tables.users, self.tables.addresses
dingalings = self.tables.dingalings
@@ -359,7 +359,7 @@ class DeleteFromRoundTripTest(fixtures.TablesTest):
expected = [(1, 7, "x", "jack@bean.com"), (5, 9, "x", "fred@fred.com")]
self._assert_table(connection, addresses, expected)
- @testing.requires.delete_from
+ @testing.requires.delete_using
def test_exec_alias_plus_table(self, connection):
users, addresses = self.tables.users, self.tables.addresses
dingalings = self.tables.dingalings