diff options
author | Gord Thompson <gord@gordthompson.com> | 2020-09-13 16:38:13 -0600 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-15 09:43:00 -0400 |
commit | 31c3ed715ad2e6007bf6b98ae7670cb1a902731c (patch) | |
tree | f45449f7a27460d44f463a201de50c8224d33a76 /test/dialect/mysql/test_compiler.py | |
parent | 8455a11bcc23e97afe666873cd872b0f204848d8 (diff) | |
download | sqlalchemy-31c3ed715ad2e6007bf6b98ae7670cb1a902731c.tar.gz |
Remove silent ignore for skip_locked w/ unsupported backends
For SQLAlchemy 1.4:
The "skip_locked" keyword used with ``with_for_update()`` will render "SKIP
LOCKED" on all MySQL backends, meaning it will fail for MySQL less than
version 8 and on current MariaDB backends. This is because those backends
do not support "SKIP LOCKED" or any equivalent, so this error should not be
silently ignored. This is upgraded from a warning in the 1.3 series.
For SQLAlchemy 1.3:
The "skip_locked" keyword used with ``with_for_update()`` will emit a
warning when used on MariaDB backends, and will then be ignored. This is
a deprecated behavior that will raise in SQLAlchemy 1.4, as an application
that requests "skip locked" is looking for a non-blocking operation which
is not available on those backends.
Fixes: #5578
Change-Id: I49ccb6c6ff46eafed12b77f51e1da8e0e397966c
Diffstat (limited to 'test/dialect/mysql/test_compiler.py')
-rw-r--r-- | test/dialect/mysql/test_compiler.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py index 80fc65a0b..b222431eb 100644 --- a/test/dialect/mysql/test_compiler.py +++ b/test/dialect/mysql/test_compiler.py @@ -352,7 +352,6 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): self.assert_compile(expr, "concat('x', 'y')", literal_binds=True) def test_mariadb_for_update(self): - table1 = table( "mytable", column("myid"), column("name"), column("description") ) @@ -365,16 +364,6 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): dialect="mariadb", ) - self.assert_compile( - table1.select(table1.c.myid == 7).with_for_update( - skip_locked=True - ), - "SELECT mytable.myid, mytable.name, mytable.description " - "FROM mytable WHERE mytable.myid = %s " - "FOR UPDATE", - dialect="mariadb", - ) - def test_delete_extra_froms(self): t1 = table("t1", column("c1")) t2 = table("t2", column("c1")) |