Which version and edition of Flyway are you using?
6.4.4 community
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)
Command-line
Which database are you using (type & version)?
MySQL 8.0
Which operating system are you using?
Ubuntu 18.04
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.)
CREATE OR REPLACE VIEW vw_if_function AS
SELECT
IF((1 = 1), 1, 0) as col_1,
IF((2 = 2), 2, 0) as col_2,
-- END IF
CASE
WHEN 3 = 3
THEN (SELECT 3)
ELSE (SELECT 9)
END AS col_3
;
What did you expect to see?
A view with three columns
What did you see instead?
Caused by: org.flywaydb.core.api.FlywayException: Incomplete statement at line 1 col 1: CREATE OR REPLACE VIEW vw_if_function AS
SELECT
IF((1 = 1), 1, 0) as col_1,
IF((2 = 2), 2, 0) as col_2,
-- END IF
CASE
WHEN 3 = 3
THEN (SELECT 3)
ELSE (SELECT 9)
END AS col_3
;
at org.flywaydb.core.internal.parser.Parser.getNextStatement(Parser.java:224)
Some more information:
If you uncomment the "END IF" then the parser succeeds and the SQL is passed to the database, which of course returns a syntax error because the SQL is no longer valid.
Removing either the CASE or all the IFs will allow the parser to succeed.
The text was updated successfully, but these errors were encountered:
Which version and edition of Flyway are you using?
6.4.4 community
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)
Command-line
Which database are you using (type & version)?
MySQL 8.0
Which operating system are you using?
Ubuntu 18.04
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.)
What did you expect to see?
A view with three columns
What did you see instead?
Some more information:
If you uncomment the "END IF" then the parser succeeds and the SQL is passed to the database, which of course returns a syntax error because the SQL is no longer valid.
Removing either the CASE or all the IFs will allow the parser to succeed.
The text was updated successfully, but these errors were encountered: