From 2dd31a7cf2e6f1a5d234283a4342cf8f45bc1fbf Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 5 Apr 2024 07:49:42 -0700 Subject: [PATCH] Simplify supports_skip_locked? in shared MySQL adapter Also, update CHANGELOG. --- CHANGELOG | 2 ++ lib/sequel/adapters/shared/mysql.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 98999d755..41e9d6acf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ === master +* Support Dataset#skip_locked on MariaDB 10.6+ (simi) (#2150) + * Avoid allocating datasets in cases where the returned dataset would be the same as the receiver (jeremyevans) * Add provenance dataset extension, which includes comments in queries showing how and where the dataset was built (jeremyevans) diff --git a/lib/sequel/adapters/shared/mysql.rb b/lib/sequel/adapters/shared/mysql.rb index 966d8e1e8..57414faa4 100644 --- a/lib/sequel/adapters/shared/mysql.rb +++ b/lib/sequel/adapters/shared/mysql.rb @@ -928,7 +928,7 @@ def supports_returning?(type) # MySQL 8+ and MariaDB 10.6+ support SKIP LOCKED. def supports_skip_locked? - (!db.mariadb? && db.server_version >= 80000) || (db.mariadb? && db.server_version >= 100600) + db.server_version >= (db.mariadb? ? 100600 : 80000) end # Check the database setting for whether fractional timestamps