From 1ba359529222ac8e5dc4dbe5b5bd7a63e3bf9fe2 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 16 Aug 2021 17:12:01 +0200 Subject: [PATCH] HHH-14777 Enabled skip locked rendering for MariaDB 10.6+ --- .../java/org/hibernate/dialect/Database.java | 5 +++- .../hibernate/dialect/MariaDB106Dialect.java | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 hibernate-core/src/main/java/org/hibernate/dialect/MariaDB106Dialect.java diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Database.java b/hibernate-core/src/main/java/org/hibernate/dialect/Database.java index db752b6a55..309986ff24 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Database.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Database.java @@ -280,7 +280,10 @@ public enum Database { final int minorVersion = info.getDatabaseMinorVersion(); if ( majorVersion == 10 ) { - if ( minorVersion >= 3 ) { + if ( minorVersion >= 6 ) { + return new MariaDB106Dialect(); + } + else if ( minorVersion >= 3 ) { return new MariaDB103Dialect(); } else if ( minorVersion == 2 ) { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB106Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB106Dialect.java new file mode 100644 index 0000000000..fc5c161e4c --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDB106Dialect.java @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.dialect; + +/** + * An SQL dialect for MariaDB 10.6 and later, provides skip locked support. + * + * @author Christian Beikov + */ +public class MariaDB106Dialect extends MariaDB103Dialect { + + public MariaDB106Dialect() { + super(); + } + + @Override + public boolean supportsSkipLocked() { + return true; + } +}