Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ Lexem next() {
return Lexem.SEPARATOR;
} else if (matchesSingleLineComment() || matchesMultilineComment()) {
return Lexem.COMMENT;
} else if (matchesQuotedString('\'') || matchesQuotedString('"') || matchesDollarQuotedString()) {
} else if (
matchesQuotedString('\'') ||
matchesQuotedString('"') ||
matchesQuotedString('`') ||
matchesDollarQuotedString()
) {
return Lexem.QUOTED_STRING;
} else if (matches(identifier)) {
return Lexem.IDENTIFIER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ public void testIssue1547Case2() {
splitAndCompare(script, expected);
}

@Test
public void testSplittingEnquotedSemicolon() {
String script = "CREATE TABLE `bar;bar` (\n" + " end_time VARCHAR(255)\n" + ");";

List<String> expected = Arrays.asList("CREATE TABLE `bar;bar` ( end_time VARCHAR(255) )");

splitAndCompare(script, expected);
}

@Test
public void testUnusualSemicolonPlacement() {
String script = "SELECT 1;;;;;SELECT 2;\n;SELECT 3\n; SELECT 4;\n SELECT 5";
Expand Down