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

Fix SQLUtils.splitSqlScript: keep semicolons after END when semicolon is not the statement separator #8108

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ private boolean endOfBlock(boolean recursive) {
if (";".equals(scanner.getCurrentMatch())) {
if (recursive) {
sb.append(temporary);
appendMatch();
}
appendMatch();
return true;
}
sb.append(temporary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,19 @@ public void testIfLoopBlocksSpecificSeparator() {
" IF something_wrong THEN LEAVE rec_loop; END IF;\n" +
" do_something_else;\n" +
" END LOOP;\n" +
"END",
"END;",
"CALL something();"
);
splitAndCompare(script, expected, "@");
}

@Test
public void oracleStyleBlocks() {
String script = "BEGIN END; /\n" + "BEGIN END;";
List<String> expected = Arrays.asList("BEGIN END;", "BEGIN END;");
splitAndCompare(script, expected, "/");
}

@Test
public void testMultiProcedureMySQLScript() {
String script =
Expand Down