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

DB2 migration failure, regression "Unable to parse statement" #2673

Closed
wjtkp opened this issue Feb 12, 2020 · 1 comment
Closed

DB2 migration failure, regression "Unable to parse statement" #2673

wjtkp opened this issue Feb 12, 2020 · 1 comment
Assignees
Milestone

Comments

@wjtkp
Copy link

wjtkp commented Feb 12, 2020

Which version and edition of Flyway are you using?

6.0.0 - 6.2.2 (it was working at 5.2.4)

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

Command line

Which database are you using (type & version)?

DB2 11.1

Which operating system are you using?

Unix

What did you do?

I upgraded Flyway 5.2.4 (which was working fine) to 6.2.2. I run standard migration, but I get an error:

ERROR: Unexpected error
org.flywaydb.core.api.FlywayException: Unable to parse statement in /migrations/db2/V1_01__Rename_columns.sql at line 5 col 1: null
	at org.flywaydb.core.internal.parser.Parser.getNextStatement(Parser.java:284)
	at org.flywaydb.core.internal.parser.Parser.access$000(Parser.java:44)
	at org.flywaydb.core.internal.parser.Parser$ParserSqlStatementIterator.next(Parser.java:649)
	at org.flywaydb.core.internal.parser.Parser$ParserSqlStatementIterator.next(Parser.java:614)
	at org.flywaydb.core.internal.sqlscript.ParserSqlScript.parse(ParserSqlScript.java:79)
	at org.flywaydb.core.internal.sqlscript.ParserSqlScript.validate(ParserSqlScript.java:124)
	at org.flywaydb.core.internal.sqlscript.ParserSqlScript.executeInTransaction(ParserSqlScript.java:187)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.canExecuteInTransaction(SqlMigrationExecutor.java:75)
	at org.flywaydb.core.internal.command.DbMigrate.isExecuteGroupInTransaction(DbMigrate.java:312)
	at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:275)
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:244)
	at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:54)
	at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:162)
	at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:159)
	at org.flywaydb.core.internal.database.base.Connection$1.call(Connection.java:131)
	at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
	at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:127)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:159)
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:137)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:182)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:142)
	at org.flywaydb.core.Flyway.execute(Flyway.java:504)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:142)
	at org.flywaydb.commandline.Main.executeOperation(Main.java:164)
	at org.flywaydb.commandline.Main.main(Main.java:111)
Caused by: java.lang.NullPointerException
	at org.flywaydb.core.internal.database.db2.DB2Parser.adjustBlockDepth(DB2Parser.java:49)
	at org.flywaydb.core.internal.parser.Parser.getNextStatement(Parser.java:202)
	... 25 more

V1_01__Rename_columns.sql at line 5:
BEGIN EXECUTE IMMEDIATE (SELECT 'ALTER TABLE app_schema.asset_settings DROP UNIQUE ' || constname FROM syscat.tabconst WHERE tabschema='APP_SCHEMA' AND tabname='ASSET_SETTINGS' AND type='U'); END

Since it's on production I cannot touch this migration sql.

Could you please fix this?

@MikielAgutu MikielAgutu added this to the Flyway 6.x milestone Feb 12, 2020
@Lyeeedar Lyeeedar self-assigned this Feb 12, 2020
@wjtkp
Copy link
Author

wjtkp commented Feb 12, 2020

I think this may be related to this change: a57842a#diff-ec2c6d9252f6f305b4869e41be69cf59

@Lyeeedar Lyeeedar modified the milestones: Flyway 6.x, Flyway 6.2.3 Feb 12, 2020
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

3 participants