Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MariaDB not recognized with MariaDB JDBC driver 2.4.0 #2289

Closed
tomas-silhavy opened this issue Jan 30, 2019 · 9 comments
Closed

MariaDB not recognized with MariaDB JDBC driver 2.4.0 #2289

tomas-silhavy opened this issue Jan 30, 2019 · 9 comments

Comments

@tomas-silhavy
Copy link

tomas-silhavy commented Jan 30, 2019

Which version and edition of Flyway are you using?

5.2.4

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

maven plugin 5.2.4

Which database are you using (type & version)?

MariaDB 10.2
breaks: mariadb-java-client: 2.4.0 -> databaseProductName = MariaDB 10.2
works: mariadb-java-client: 2.3.0 -> databaseProductName = MySQL 10.2

Which operating system are you using?

ubuntu

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
just running normal mvn compile

What did you expect to see?

build successful...

What did you see instead?
[ERROR] mysqld: 2019-01-30 20:15:45 139876082042624 [Warning] Aborted connection 9 to db: '***' user: 'root' host: '' (Got an error reading communication packets)
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:5.2.4:migrate (default) on project BluescopeWebApi: org.flywaydb.core.api.FlywayException: Unsupported Database: MariaDB 10.2 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.flywaydb:flyway-maven-plugin:5.2.4:migrate (default) on project BluescopeWebApi: org.flywaydb.core.api.FlywayException: Unsupported Database: MariaDB 10.2
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:185)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:181)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.flywaydb.core.api.FlywayException: Unsupported Database: MariaDB 10.2
	at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:748)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 13 more
Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: MariaDB 10.2
	at org.flywaydb.core.internal.jdbc.DatabaseType.fromDatabaseProductNameAndPostgreSQLVersion(DatabaseType.java:168)
	at org.flywaydb.core.internal.jdbc.DatabaseType.fromJdbcConnection(DatabaseType.java:117)
	at org.flywaydb.core.internal.jdbc.JdbcTemplate.<init>(JdbcTemplate.java:52)
	at org.flywaydb.core.internal.database.mysql.MySQLDatabase.isRunningInPerconaXtraDBClusterWithStrictMode(MySQLDatabase.java:69)
	at org.flywaydb.core.internal.database.mysql.MySQLDatabase.<init>(MySQLDatabase.java:64)
	at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:159)
	at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:92)
	at org.flywaydb.core.Flyway.execute(Flyway.java:1670)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
	at org.flywaydb.maven.MigrateMojo.doExecute(MigrateMojo.java:35)
	at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:746)
	... 15 more
@bmorris591
Copy link

See change in MariaDB driver:

from 2.3.0: https://github.com/MariaDB/mariadb-connector-j/blob/2.3.0/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L1132

to 2.4.0: https://github.com/MariaDB/mariadb-connector-j/blob/2.4.0/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L1132

Interesting. Would using a mysql connect URL be a workaround for this issue? Would it cause any other problems?

@tomas-silhavy
Copy link
Author

I tried but it was still failing, the error was different tho I think. Additionally there was that warning about using mariaDB driver on mysql.

@jxbadam
Copy link

jxbadam commented Feb 7, 2019

@axelfontaine Any hope we might get this issue rolled into a point release? Seems like it is already fixed in master. If not, well, no worries :) Thanks for the consideration.

@axelfontaine axelfontaine changed the title DatabaseType.java does not recognize MariaDB database/driver MariaDB not recognized with MariaDB JDBC driver 2.4.0 Feb 8, 2019
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Feb 8, 2019
@axelfontaine
Copy link
Contributor

@tomas-silhavy Thanks for reporting and @pismy thanks for investigating.

This has now been implemented along with official support for MariaDB 10.4 (#2300).

@jvalkeal
Copy link

It'd be create to get this fix in 5.2.x as well as I'm also dead in a water with flyway on this driver issue.

@jxbadam
Copy link

jxbadam commented Feb 13, 2019

@jvalkeal Perhaps https://flywaydb.org/blog/flyway-6.0.0-beta will work for you? My solution was to do a compile of master and throw it in a local maven mirror while waiting for an official release.

@jvalkeal
Copy link

No, we really can't go down that route as this is for spring libraries build on spring boot and we can't release with unsupported dependencies.

@axelfontaine
Copy link
Contributor

For a workaround for those who can't upgrade to 6.0.0-beta just yet, see #2339 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants