diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-03 09:30:58 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-04 23:22:20 -0500 |
| commit | b38fb59fe484d6e4e5992c9b2dc9b9f7724f016a (patch) | |
| tree | 21bac11da9981fe45b20bdb06240b37fb47b5800 /test/orm | |
| parent | 7099dd20e90307237240f30d5db0816a08356a5b (diff) | |
| download | sqlalchemy-b38fb59fe484d6e4e5992c9b2dc9b9f7724f016a.tar.gz | |
audition pymssql once more; retire sane_rowcount_returning
pymssql seems to be maintained again and seems to be working
completely, so let's try re-enabling it.
Fixed issue in the new :class:`.Uuid` datatype which prevented it from
working with the pymssql driver. As pymssql seems to be maintained again,
restored testing support for pymssql.
Tweaked the pymssql dialect to take better advantage of
RETURNING for INSERT statements in order to retrieve last inserted primary
key values, in the same way as occurs for the mssql+pyodbc dialect right
now.
Identified that the ``sqlite`` and ``mssql+pyodbc`` dialects are now
compatible with the SQLAlchemy ORM's "versioned rows" feature, since
SQLAlchemy now computes rowcount for a RETURNING statement in this specific
case by counting the rows returned, rather than relying upon
``cursor.rowcount``. In particular, the ORM versioned rows use case
(documented at :ref:`mapper_version_counter`) should now be fully
supported with the SQL Server pyodbc dialect.
Change-Id: I38a0666587212327aecf8f98e86031ab25d1f14d
References: #5321
Fixes: #9414
Diffstat (limited to 'test/orm')
| -rw-r--r-- | test/orm/test_versioning.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/test/orm/test_versioning.py b/test/orm/test_versioning.py index f6b9f18fc..7de90fc5c 100644 --- a/test/orm/test_versioning.py +++ b/test/orm/test_versioning.py @@ -45,12 +45,7 @@ def conditional_sane_rowcount_warnings( update=False, delete=False, only_returning=False ): warnings = () - if ( - only_returning - and not testing.db.dialect.supports_sane_rowcount_returning - ) or ( - not only_returning and not testing.db.dialect.supports_sane_rowcount - ): + if not testing.db.dialect.supports_sane_rowcount: if update: warnings += ( "Dialect .* does not support " @@ -1466,7 +1461,6 @@ class ServerVersioningTest(fixtures.MappedTest): eq_(f1.version_id, 2) - @testing.requires.sane_rowcount_w_returning @testing.requires.updateable_autoincrement_pks @testing.requires.update_returning def test_sql_expr_w_mods_bump(self): @@ -1636,7 +1630,6 @@ class ServerVersioningTest(fixtures.MappedTest): self.assert_sql_execution(testing.db, sess.flush, *statements) @testing.requires.independent_connections - @testing.requires.sane_rowcount_w_returning def test_concurrent_mod_err_expire_on_commit(self): sess = self._fixture() @@ -1661,7 +1654,6 @@ class ServerVersioningTest(fixtures.MappedTest): ) @testing.requires.independent_connections - @testing.requires.sane_rowcount_w_returning def test_concurrent_mod_err_noexpire_on_commit(self): sess = self._fixture(expire_on_commit=False) |
