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

Support backtick as an identifier quote for H2 database running in MySql mode #2511

elieabichar-wk opened this issue Sep 23, 2019 · 2 comments


Copy link

@elieabichar-wk elieabichar-wk commented Sep 23, 2019

Which version and edition of Flyway are you using?


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

Java API

Which database are you using (type & version)?

H2 with mysql compatibility mode

Which operating system are you using?

Mac OS

What did you do?

When updating Flyway from 5.2.4 to 6.0.4 we started hitting an unknow character exception due to backtick usage as an identifier quote in .sql files.

It looks like the recently introduced H2Parser does not support a backtick as an IdentifierQuote but should mimic MySqlParser for H2 with MySql compatibility.


org.flywaydb.core.api.FlywayException: Unable to parse statement in db/migration/V1__initial_version.sql at line 43 col 1: Unknown char ` encountered on line 43 at column 28
at org.flywaydb.core.internal.parser.Parser.getNextStatement(
at org.flywaydb.core.internal.parser.Parser.access$000(
at org.flywaydb.core.internal.parser.Parser$
at org.flywaydb.core.internal.parser.Parser$
at org.flywaydb.core.internal.sqlscript.ParserSqlScript.parse(
at org.flywaydb.core.internal.sqlscript.ParserSqlScript.validate(
at org.flywaydb.core.internal.sqlscript.ParserSqlScript.executeInTransaction(
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.canExecuteInTransaction(
at org.flywaydb.core.internal.command.DbMigrate.isExecuteGroupInTransaction(
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(
at org.flywaydb.core.internal.command.DbMigrate.access$100(
at org.flywaydb.core.internal.command.DbMigrate$
at org.flywaydb.core.internal.command.DbMigrate$
at org.flywaydb.core.internal.database.base.Connection$
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(
at org.flywaydb.core.internal.database.base.Connection.lock(
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(
at org.flywaydb.core.internal.command.DbMigrate.migrate(
at org.flywaydb.core.Flyway$1.execute(
at org.flywaydb.core.Flyway$1.execute(
at org.flywaydb.core.Flyway.execute(
at org.flywaydb.core.Flyway.migrate(```
What did you expect to see?

Migration to pass as it used to in 5.2.4

What did you see instead?

provided stacktrace

Copy link

@juliahayward juliahayward commented Sep 24, 2019

Would you be able to supply a sample script that we can test with, please?

@juliahayward juliahayward added this to the Flyway 6.0.5 milestone Sep 24, 2019
Copy link

@elieabichar-wk elieabichar-wk commented Sep 24, 2019

The sql script below works on 5.2.4 with H2 running in MySql mode enabled since Mysql supports backtick but is broken in flyway 6.0.4

CREATE TABLE `test` (`test` INT);

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

No branches or pull requests

3 participants