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

HSQLDBParser now instead struggles with block depth count #2442

Closed
krite opened this issue Jul 20, 2019 · 5 comments

Comments

@krite
Copy link

commented Jul 20, 2019

Which version and edition of Flyway are you using?

6.0.0-beta2

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)

Java API and Maven Plugin

Which database are you using (type & version)?

HSQLDB 4.2.1

Which operating system are you using?

Linux and OS X

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.)
Parsing a simple sql-migration script containing a couple of:
DROP TABLE IF EXISTS mytable CASCADE;

What did you expect to see?

A successful migration, worked in version 4 and 5.

What did you see instead?

A failed migration, the parser believes that there is only ONE single statement, it failes to separate the rows at the ; and newline.
This is due to that the blockdepth is increased at the 'IF'-keyword and the DELIMITER is still used instead of NEW_DELIMETER. This makes the login not see the delimiter at all, none of the two delimiter-paths are taken.

krite referenced this issue Jul 20, 2019
krite
Add exception to cover cases when IF EXISTS is used after modifying T…
…ABLE/CONSTRAINT or COLUMN, as in; DROP TABLE IF EXISTS mytable CASCADE;
@juliahayward

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

Could you share the smallest possible SQL migration that fails, as well as the exact error message you see please? A stack trace would be particularly helpful for pinpointing the problem.

@krite

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

As stated above, DROP TABLE IF EXISTS mytable CASCADE; is enough to trigger the error.
You however need to put ANY statement or text after this row and see that the parser continues without breaking on the statement.

The comment also contains details of where in the code the error resides. The pull-request also gives indications of where to start looking.

juliahayward added a commit to flyway/flywaydb.org that referenced this issue Jul 31, 2019
@juliahayward

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

That's great, thankyou.

@juliahayward juliahayward added r: fixed t: bug and removed t: bug labels Aug 1, 2019

@juliahayward juliahayward added this to the Flyway 6.0.0 milestone Aug 1, 2019

@juliahayward

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

This has now been fixed - many thanks for the report.

@krite

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

Great, thanx!

MikielAgutu added a commit to flyway/flywaydb.org that referenced this issue Aug 13, 2019
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.