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

HSQLDB: Unable to parse `DROP INDEX IF EXISTS` statement #2539

Closed
nlochschmidt opened this issue Oct 22, 2019 · 1 comment
Closed

HSQLDB: Unable to parse `DROP INDEX IF EXISTS` statement #2539

nlochschmidt opened this issue Oct 22, 2019 · 1 comment

Comments

@nlochschmidt
Copy link

@nlochschmidt nlochschmidt commented Oct 22, 2019

Which version and edition of Flyway are you using?

6.0.7

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

Spring Boot integration

Which database are you using (type & version)?

HSQLDB 2.5.0

Which operating system are you using?

macOS 10.14.6

What did you do?

Wrote a migration with a simple conditional DROP INDEX statement:

DROP INDEX IF EXISTS blog_post__name_idx;
What did you expect to see?

Successful migration and a dropped index.

What did you see instead?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Unable to parse statement in db/migration/common/V2__drop_blog_post_name_idx.sql at line 1 col 1: Incomplete statement at line 1 col 1: DROP INDEX IF EXISTS blog_post__name_idx;

Also when I debug into the HSQLDBParser in line 77 I can see that the INDEX token has the type IDENTIFIER which seams wrong and it is therefore looking for the token DROP in CONDITIONALLY_CREATABLE_OBJECTS which it won't find. It is then increasing the blockDepth and failing later because of that.

This might be related to #2442

@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Oct 30, 2019

It's not the same as #2442 but it's definitely failing to spot INDEX as a keyword that can appear in the form DROP <THING> IF EXISTS. I have a fix which should go in 6.0.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.