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 /lib/sqlalchemy | |
| 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 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index b9067f384..8fb4c3b4b 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -1670,7 +1670,7 @@ class MySQLCompiler(compiler.SQLCompiler): if select._for_update_arg.nowait: tmp += " NOWAIT" - if select._for_update_arg.skip_locked and self.dialect._is_mysql: + if select._for_update_arg.skip_locked: tmp += " SKIP LOCKED" return tmp |
