Skip to content

Commit 5655103

Browse files
committed
Merge pull request #28355 from ben-enfuse-io
* pr/28355: Treat MariaDB as an independent database type Closes gh-28355
2 parents 4557158 + 21577c4 commit 5655103

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,6 +49,7 @@
4949
*
5050
* @author Thomas Risberg
5151
* @author Juergen Hoeller
52+
* @author Ben Blinebury
5253
*/
5354
public abstract class JdbcUtils {
5455

@@ -455,9 +456,6 @@ public static String commonDatabaseName(@Nullable String source) {
455456
if (source != null && source.startsWith("DB2")) {
456457
name = "DB2";
457458
}
458-
else if ("MariaDB".equals(source)) {
459-
name = "MySQL";
460-
}
461459
else if ("Sybase SQL Server".equals(source) ||
462460
"Adaptive Server Enterprise".equals(source) ||
463461
"ASE".equals(source) ||

spring-jdbc/src/test/java/org/springframework/jdbc/support/JdbcUtilsTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
2727
*
2828
* @author Thomas Risberg
2929
* @author Juergen Hoeller
30+
* @author Ben Blinebury
3031
*/
3132
public class JdbcUtilsTests {
3233

@@ -37,6 +38,7 @@ public void commonDatabaseName() {
3738
assertThat(JdbcUtils.commonDatabaseName("Sybase SQL Server")).isEqualTo("Sybase");
3839
assertThat(JdbcUtils.commonDatabaseName("Adaptive Server Enterprise")).isEqualTo("Sybase");
3940
assertThat(JdbcUtils.commonDatabaseName("MySQL")).isEqualTo("MySQL");
41+
assertThat(JdbcUtils.commonDatabaseName("MariaDB")).isEqualTo("MariaDB");
4042
}
4143

4244
@Test

0 commit comments

Comments
 (0)