From 31c3ed715ad2e6007bf6b98ae7670cb1a902731c Mon Sep 17 00:00:00 2001 From: Gord Thompson Date: Sun, 13 Sep 2020 16:38:13 -0600 Subject: 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 --- lib/sqlalchemy/dialects/mysql/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy') 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 -- cgit v1.2.1