lib/sequel/adapters/shared/mysql.rb in sequel-5.11.0 vs lib/sequel/adapters/shared/mysql.rb in sequel-5.12.0
- old
+ new
@@ -439,11 +439,11 @@
/Duplicate entry .+ for key/ => UniqueConstraintViolation,
/foreign key constraint fails/ => ForeignKeyConstraintViolation,
/cannot be null/ => NotNullConstraintViolation,
/Deadlock found when trying to get lock; try restarting transaction/ => SerializationFailure,
/CONSTRAINT .+ failed for/ => CheckConstraintViolation,
- /\AStatement aborted because lock\(s\) could not be acquired immediately and NOWAIT is set\./ => DatabaseLockTimeout,
+ /\A(Statement aborted because lock\(s\) could not be acquired immediately and NOWAIT is set\.|Lock wait timeout exceeded; try restarting transaction)/ => DatabaseLockTimeout,
}.freeze
def database_error_regexps
DATABASE_ERROR_REGEXPS
end
@@ -802,13 +802,13 @@
# MySQL supports GROUP BY WITH ROLLUP (but not CUBE)
def supports_group_rollup?
true
end
- # MySQL does not support INTERSECT or EXCEPT
+ # MariaDB 10.3+ supports INTERSECT or EXCEPT
def supports_intersect_except?
- false
+ db.mariadb? && db.server_version >= 100300
end
# MySQL does not support limits in correlated subqueries (or any subqueries that use IN).
def supports_limits_in_correlated_subqueries?
false
@@ -817,12 +817,12 @@
# MySQL supports modifying joined datasets
def supports_modifying_joins?
true
end
- # MySQL 8+ supports NOWAIT.
+ # MySQL 8+ and MariaDB 10.3+ support NOWAIT.
def supports_nowait?
- !db.mariadb? && db.server_version >= 80000
+ db.server_version >= (db.mariadb? ? 100300 : 80000)
end
# MySQL's DISTINCT ON emulation using GROUP BY does not respect the
# query's ORDER BY clause.
def supports_ordered_distinct_on?