Skip to content

Commit

Permalink
Keep semicolons after END when semicolon is not the separator (#8108)
Browse files Browse the repository at this point in the history
  • Loading branch information
inponomarev committed Jan 15, 2024
1 parent 36c8727 commit 4ff8d1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit 4ff8d1d

Please sign in to comment.