Flyway version 6.2.1 broke compatibility with mssql-jdbc 6.2.1.jre8
See original GitHub issueWhich version and edition of Flyway are you using?
<= 6.2.0:
👍
>= 6.2.1:
☠️
If this is not the latest version, can you reproduce the issue with the latest one as well?
yes
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Java API
Which database are you using (type & version)?
Microsoft SQL Server 2017 (RTM-CU13) (KB4466404) - 14.0.3048.4 (X64) Nov 30 2018 12:57:58 Copyright © 2017 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 16.04.5 LTS)
Which operating system are you using?
macOS 10.15.4 (19E287)
What did you do?
Modified the First Steps: API sample to use mssql instead of h2
What did you expect to see?
With
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.1.jre8</version>
</dependency>
I’m getting
❯ mvn package exec:java -Dexec.mainClass=foobar.App
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------< foo:bar >-------------------------------
[INFO] Building bar 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ bar ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ bar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/frankie/bar/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ bar ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ bar ---
[INFO] Surefire report directory: /Users/frankie/bar/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running foobar.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ bar ---
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ bar ---
Apr 25, 2020 11:17:23 AM org.flywaydb.core.internal.license.VersionPrinter printVersionOnly
INFO: Flyway Community Edition 6.2.0 by Redgate
Apr 25, 2020 11:17:23 AM org.flywaydb.core.internal.database.DatabaseFactory createDatabase
INFO: Database: jdbc:sqlserver://localhost:1433;jaasConfigurationName=SQLJDBCDriver;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=epostrx;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; (Microsoft SQL Server 14.0)
Apr 25, 2020 11:17:23 AM org.flywaydb.core.internal.command.DbValidate validate
INFO: Successfully validated 1 migration (execution time 00:00.022s)
Apr 25, 2020 11:17:23 AM org.flywaydb.core.internal.command.DbMigrate migrateGroup
INFO: Current version of schema [dbo]: 1
Apr 25, 2020 11:17:23 AM org.flywaydb.core.internal.command.DbMigrate logSummary
INFO: Schema [dbo] is up to date. No migration necessary.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.606 s
[INFO] Finished at: 2020-04-25T11:17:23-07:00
[INFO] ------------------------------------------------------------------------
~/bar 2.52s 11:17:23
❯
What did you see instead?
With
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>6.2.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.1.jre8</version>
</dependency>
I’m getting
mvn package exec:java -Dexec.mainClass=foobar.App
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------< foo:bar >-------------------------------
[INFO] Building bar 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ bar ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ bar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/frankie/bar/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ bar ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ bar ---
[INFO] Surefire report directory: /Users/frankie/bar/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running foobar.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ bar ---
[INFO] Building jar: /Users/frankie/bar/target/bar-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ bar ---
Apr 25, 2020 11:18:42 AM org.flywaydb.core.internal.license.VersionPrinter printVersionOnly
INFO: Flyway Community Edition 6.2.1 by Redgate
Apr 25, 2020 11:18:42 AM org.flywaydb.core.internal.database.DatabaseFactory createDatabase
INFO: Database: jdbc:sqlserver://localhost:1433;jaasConfigurationName=SQLJDBCDriver;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=epostrx;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; (Microsoft SQL Server 14.0)
[WARNING]
org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to determine database engine edition.'
---------------------------------------------
SQL State : null
Error Code : 0
Message : The "variant" data type is not supported.
at org.flywaydb.core.internal.database.sqlserver.SQLServerConnection.<init> (SQLServerConnection.java:56)
at org.flywaydb.core.internal.database.sqlserver.SQLServerDatabase.doGetConnection (SQLServerDatabase.java:52)
at org.flywaydb.core.internal.database.sqlserver.SQLServerDatabase.doGetConnection (SQLServerDatabase.java:32)
at org.flywaydb.core.internal.database.base.Database.getConnection (Database.java:122)
at org.flywaydb.core.internal.database.base.Database.getMainConnection (Database.java:315)
at org.flywaydb.core.Flyway.prepareSchemas (Flyway.java:571)
at org.flywaydb.core.Flyway.execute (Flyway.java:494)
at org.flywaydb.core.Flyway.migrate (Flyway.java:153)
at foobar.App.main (App.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
at java.lang.Thread.run (Thread.java:748)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is not supported.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError (SQLServerException.java:227)
at com.microsoft.sqlserver.jdbc.TypeInfo$Builder$16.apply (dtv.java:3015)
at com.microsoft.sqlserver.jdbc.TypeInfo$Builder.build (dtv.java:3245)
at com.microsoft.sqlserver.jdbc.TypeInfo.getInstance (dtv.java:3304)
at com.microsoft.sqlserver.jdbc.StreamColumns.setFromTDS (StreamColumns.java:183)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet$1CursorInitializer.onColMetaData (SQLServerResultSet.java:260)
at com.microsoft.sqlserver.jdbc.TDSParser.parse (tdsparser.java:87)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.<init> (SQLServerResultSet.java:368)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet42.<init> (SQLServerResultSet42.java:31)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult (SQLServerStatement.java:1542)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement (SQLServerPreparedStatement.java:467)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute (SQLServerPreparedStatement.java:409)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute (IOBuffer.java:7151)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand (SQLServerConnection.java:2478)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand (SQLServerStatement.java:219)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement (SQLServerStatement.java:199)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery (SQLServerPreparedStatement.java:331)
at org.flywaydb.core.internal.jdbc.JdbcTemplate.queryForInt (JdbcTemplate.java:148)
at org.flywaydb.core.internal.database.sqlserver.SQLServerConnection.<init> (SQLServerConnection.java:52)
at org.flywaydb.core.internal.database.sqlserver.SQLServerDatabase.doGetConnection (SQLServerDatabase.java:52)
at org.flywaydb.core.internal.database.sqlserver.SQLServerDatabase.doGetConnection (SQLServerDatabase.java:32)
at org.flywaydb.core.internal.database.base.Database.getConnection (Database.java:122)
at org.flywaydb.core.internal.database.base.Database.getMainConnection (Database.java:315)
at org.flywaydb.core.Flyway.prepareSchemas (Flyway.java:571)
at org.flywaydb.core.Flyway.execute (Flyway.java:494)
at org.flywaydb.core.Flyway.migrate (Flyway.java:153)
at foobar.App.main (App.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.552 s
[INFO] Finished at: 2020-04-25T11:18:42-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project bar: An exception occured while executing the Java class.
[ERROR] Unable to determine database engine edition.'
[ERROR] ---------------------------------------------
[ERROR] SQL State : null
[ERROR] Error Code : 0
[ERROR] Message : The "variant" data type is not supported.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
~/bar 1 2.52s 11:18:42
❯
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Release notes - JDBC Driver for SQL Server - Microsoft Learn
Microsoft JDBC Driver 11.2 for SQL Server is now compatible with Java ... The improvement was rolled back and new jars (version 6.2.1)...
Read more >Infor Documentation Library
A new JDBC jar file for SQL Server,mssql-jdbc-8.4.1.jre8.jar, has been certified and tested for use with the WFM application. Side TOC Side TOC....
Read more >Spring Boot Reference Guide
V. Spring Boot Actuator: Production-ready features ... Spring Boot is compatible with Apache Maven 3.2 or above. If you don't already have ......
Read more >Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0
So you need try another groupId Maven which has JDBC version 4.0. I recommend this; it works for me. I'm using SQL Server...
Read more >chore(deps): update all dependencies (major) (!151 ... - GitLab
Note: Version bump only for package @commitlint/cli ... pytest 6.2.1 (2020-12-15). Bug Fixes ... Upgrade to MSSQL JDBC 10.2.1.jre8 #31048 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m trying to use the API version in a software system I do not control which uses this version of the driver. And so I figured I’d report what I found. I think it’s totally fine to not fix. Documenting this might help others though.
Documented: https://github.com/flyway/flywaydb.org/commit/ea657576d14eecebc27c86ac85418ceaa0f2b3a1