Skip to content
Permalink
Browse files

Fixed #2300: MariaDB 10.4 support

  • Loading branch information...
boxfuse committed Feb 8, 2019
1 parent 147d503 commit a53650ad47fdcd214d2adbb2ec77d4c321d80aa0
@@ -135,6 +135,19 @@ protected MySQLConnection getConnection(Connection connection
);
}














@Override
public final void ensureSupported() {
ensureDatabaseIsRecentEnough("5.1");
@@ -145,7 +158,7 @@ public final void ensureSupported() {

ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition("10.2", org.flywaydb.core.internal.license.Edition.PRO);

recommendFlywayUpgradeIfNecessary("10.3");
recommendFlywayUpgradeIfNecessary("10.4");
} else {

ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition("5.7", org.flywaydb.core.internal.license.Edition.ENTERPRISE);
@@ -85,10 +85,15 @@ private static DatabaseType fromDatabaseProductNameAndPostgreSQLVersion(String d
if (databaseProductName.startsWith("Microsoft SQL Server")) {
return SQLSERVER;
}

// #2289: MariaDB JDBC driver 2.4.0 and newer report MariaDB as "MariaDB"
if (databaseProductName.startsWith("MariaDB")
// Older versions of the driver report MariaDB as "MySQL"
|| databaseProductName.contains("MySQL") && databaseProductVersion.contains("MariaDB")) {
return MARIADB;
}

if (databaseProductName.contains("MySQL")) {
if (databaseProductVersion.contains("MariaDB")) {
return MARIADB;
}
// Google Cloud SQL returns different names depending on the environment and the SDK version.
// ex.: Google SQL Service/MySQL
return MYSQL;
@@ -21,6 +21,7 @@

public class PositionTrackingReader extends FilterReader {
private final PositionTracker tracker;
private boolean paused;

PositionTrackingReader(PositionTracker tracker, Reader in) {
super(in);
@@ -30,7 +31,7 @@
@Override
public int read() throws IOException {
int read = super.read();
if (read != -1) {
if (read != -1 && !paused) {
tracker.nextPos();
char c = (char) read;
if (c == '\n') {
@@ -46,13 +47,13 @@ public int read() throws IOException {

@Override
public void mark(int readAheadLimit) throws IOException {
tracker.mark();
paused = true;
super.mark(readAheadLimit);
}

@Override
public void reset() throws IOException {
super.reset();
tracker.reset();
paused = false;
}
}
@@ -20,8 +20,8 @@
import java.io.Reader;

public class RecordingReader extends FilterReader {
private boolean paused;
private Recorder recorder;
private int recorderMark = 0;

RecordingReader(Recorder recorder, Reader in) {
super(in);
@@ -31,22 +31,21 @@
@Override
public int read() throws IOException {
int read = super.read();
if (read != -1) {
if (read != -1 && !paused) {
recorder.record((char) read);
}
return read;
}

@Override
public void mark(int readAheadLimit) throws IOException {
paused = true;
super.mark(readAheadLimit);
recorderMark = recorder.length();
}

@Override
public void reset() throws IOException {
super.reset();

recorder.truncate(recorderMark);
paused = false;
}
}
@@ -135,7 +135,7 @@
<version.hsqldb>2.4.1</version.hsqldb>
<version.jna>4.5.2</version.jna>
<version.jtds>1.3.1</version.jtds>
<version.mariadb>2.3.0</version.mariadb>
<version.mariadb>2.4.0</version.mariadb>
<version.mysql>8.0.12</version.mysql>
<version.mssql-jdbc>7.0.0.jre8</version.mssql-jdbc>
<version.postgresql>42.2.5.jre6</version.postgresql>
@@ -672,6 +672,8 @@








0 comments on commit a53650a

Please sign in to comment.
You can’t perform that action at this time.