You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Flyway is throwing an MySQLSyntaxErrorException when I try to run the following script.
DROP TABLE IF EXISTS `bug_test`;
CREATE TABLE `bug_test` (
`description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `bug_test` VALUES ('C\\');
--this part gets executed too along with above statement
When Flyway goes runs MySQLSqlStatementBuilder.removeEscapedQuotes(token) on the token 'C\\' the result is 'C\ instead of 'C'. This leads to not having a closing TokenType.QUOTE to terminate the literal and it doesn't turn out well.
A possible solution would be to removed escaped backslashes before attempting to remove escaped quotes and double quotes. i.e.
I ran into this issue too, and worked around it by adding a space between the escaped backslash and the quote, and then trimming that space with RTRIM(). In the above example that would be
Using Flyway API for v2.2.1.
Flyway is throwing an
MySQLSyntaxErrorException
when I try to run the following script.When Flyway goes runs
MySQLSqlStatementBuilder.removeEscapedQuotes(token)
on the token'C\\'
the result is'C\
instead of'C'
. This leads to not having a closingTokenType.QUOTE
to terminate the literal and it doesn't turn out well.A possible solution would be to removed escaped backslashes before attempting to remove escaped quotes and double quotes. i.e.
The text was updated successfully, but these errors were encountered: