Sql wrong lexical analysis for string literals - escaped single quotes are misparsed

Description

The following sql is not parsed well when an escaped single quote is present in the end of sql parameter value.

--changeset eugen.maysyuk:01.01.000.0001
--comment create test table
CREATE TABLE `table1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`text` mediumtext,
PRIMARY KEY (`ID`)
);

CREATE TABLE `table2` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`text` mediumtext,
PRIMARY KEY (`ID`)
);

--changeset eugen.maysyuk:01.01.000.0002
--comment issue with escaped quote
INSERT INTO `table1` VALUES (3,'TEXT \'');

INSERT INTO `table2` VALUES (4,'TEXT');

Same sql file works fine up till 3.4.2 (<= 3.4.2).

Attached is a sample project that reproduce the problem (GitHub).

Environment

Windows
Linux
macOS

Attachments

1
  • 16 Dec 2019, 11:41 AM

Activity

Show:

Former user December 16, 2019 at 11:44 AM

I think this issue somehow relates to https://liquibase.jira.com/browse/CORE-2843

Details

Reporter

Affects versions

Priority

Created December 16, 2019 at 11:41 AM
Updated May 3, 2020 at 7:37 PM

Flag notifications