HHH-17097 - Remove support for MariaDB versions older than 10.4

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2023-10-11 23:10:42 +02:00 committed by Christian Beikov
parent 1a1604be2f
commit ec639cd1f7
10 changed files with 18 additions and 39 deletions

View File

@ -71,9 +71,9 @@ mariadb() {
mariadb_11_1
}
mariadb_10_3() {
mariadb_10_4() {
$CONTAINER_CLI rm -f mariadb || true
$CONTAINER_CLI run --name mariadb -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mariadb:10.3.39 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake
$CONTAINER_CLI run --name mariadb -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mariadb:10.4.31 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake
OUTPUT=
n=0
until [ "$n" -ge 5 ]
@ -953,7 +953,7 @@ if [ -z ${1} ]; then
echo -e "\tmariadb"
echo -e "\tmariadb_11_1"
echo -e "\tmariadb_10_9"
echo -e "\tmariadb_10_3"
echo -e "\tmariadb_10_4"
echo -e "\tmssql"
echo -e "\tmssql_2022"
echo -e "\tmssql_2017"

View File

@ -56,6 +56,8 @@ public class CommunityDialectSelector implements DialectSelector {
return MariaDB10Dialect.class;
case "MariaDB102":
return MariaDB102Dialect.class;
case "MariaDB103":
return MariaDB103Dialect.class;
case "MimerSQL":
return MimerSQLDialect.class;
case "MySQL5":

View File

@ -4,9 +4,11 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.dialect;
package org.hibernate.community.dialect;
import org.hibernate.LockOptions;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.MariaDBDialect;
/**
* An SQL dialect for MariaDB 10.3 and later, provides sequence support, lock-timeouts, etc.

View File

@ -38,6 +38,7 @@ public class CommunityDialectSelectorTest {
testDialectNamingResolution( MariaDB53Dialect.class );
testDialectNamingResolution( MariaDB10Dialect.class );
testDialectNamingResolution( MariaDB102Dialect.class );
testDialectNamingResolution( MariaDB103Dialect.class );
testDialectNamingResolution( MySQL5Dialect.class );
testDialectNamingResolution( MySQL55Dialect.class );

View File

@ -23,7 +23,6 @@ import org.hibernate.dialect.HANACloudColumnStoreDialect;
import org.hibernate.dialect.HANAColumnStoreDialect;
import org.hibernate.dialect.HANARowStoreDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MariaDB103Dialect;
import org.hibernate.dialect.MariaDBDialect;
import org.hibernate.dialect.MySQL8Dialect;
import org.hibernate.dialect.MySQLDialect;
@ -85,9 +84,8 @@ public class DefaultDialectSelector implements DialectSelector {
case "MariaDB53":
case "MariaDB10":
case "MariaDB102":
return findCommunityDialect( name );
case "MariaDB103":
return MariaDB103Dialect.class;
return findCommunityDialect( name );
case "MySQL":
return MySQLDialect.class;
case "MySQL5":

View File

@ -14,10 +14,10 @@ package org.hibernate.dialect;
* @deprecated use {@code MariaDBDialect(1060)}
*/
@Deprecated
public class MariaDB106Dialect extends MariaDB103Dialect {
public class MariaDB106Dialect extends MariaDBDialect {
public MariaDB106Dialect() {
super();
super( DatabaseVersion.make( 10, 6 ) );
}
@Override

View File

@ -48,7 +48,7 @@ import static org.hibernate.type.SqlTypes.VARBINARY;
* @author Gavin King
*/
public class MariaDBDialect extends MySQLDialect {
private static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 10, 3 );
private static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 10, 4 );
private static final DatabaseVersion MYSQL57 = DatabaseVersion.make( 5, 7 );
public MariaDBDialect() {

View File

@ -86,7 +86,7 @@ public class MariaDBSqlAstTranslator<T extends JdbcOperation> extends AbstractSq
@Override
protected boolean supportsSimpleQueryGrouping() {
return getDialect().getVersion().isSameOrAfter( 10, 4 );
return true;
}
@Override
@ -220,11 +220,6 @@ public class MariaDBSqlAstTranslator<T extends JdbcOperation> extends AbstractSq
return " from dual";
}
@Override
protected String getFromDualForSelectOnly() {
return getDialect().getVersion().isBefore( 10, 4 ) ? getFromDual() : "";
}
@Override
public MariaDBDialect getDialect() {
return this.dialect;

View File

@ -1,19 +0,0 @@
/*
* 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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.dialect.mariadb;
import org.hibernate.dialect.MariaDB103Dialect;
import org.hibernate.spatial.SpatialDialect;
/**
* @deprecated Spatial Dialects are no longer needed. Use the standard MariaDB dialects
*/
@Deprecated
public class MariaDB103SpatialDialect extends MariaDB103Dialect implements SpatialDialect {
}

View File

@ -29,7 +29,7 @@ stage('Configure') {
// Minimum supported versions
new BuildEnvironment( dbName: 'hsqldb_2_6' ),
new BuildEnvironment( dbName: 'mysql_8_0' ),
new BuildEnvironment( dbName: 'mariadb_10_3' ),
new BuildEnvironment( dbName: 'mariadb_10_4' ),
new BuildEnvironment( dbName: 'postgresql_12' ),
new BuildEnvironment( dbName: 'edb_12' ),
new BuildEnvironment( dbName: 'oracle_11_2' ),
@ -117,11 +117,11 @@ stage('Build') {
sh "./docker_db.sh mysql_8_0"
state[buildEnv.tag]['containerName'] = "mysql"
break;
case "mariadb_10_3":
case "mariadb_10_4":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('mariadb:10.3.39').pull()
docker.image('mariadb:10.4.31').pull()
}
sh "./docker_db.sh mariadb_10_3"
sh "./docker_db.sh mariadb_10_4"
state[buildEnv.tag]['containerName'] = "mariadb"
break;
case "postgresql_12":