提交 ca024f98 编写于 作者: S Serge Rider 提交者: GitHub

Merge pull request #12410 from dbeaver/ora-procedure#11357

#11357 fix semicolon trim when executing selected oracle query

Former-commit-id: 57833f61
......@@ -363,7 +363,7 @@ public final class SQLUtils {
String[][] blockBoundStrings = syntaxManager.getDialect().getBlockBoundStrings();
if (blockBoundStrings != null) {
for (String[] blocks : blockBoundStrings) {
int endIndex = test.indexOf(blocks[1]);
int endIndex = test.lastIndexOf(blocks[1]);
if (endIndex > 0) {
// This is a block query if it ends with 'END' or with 'END id'
if (test.endsWith(blocks[1])) {
......@@ -371,7 +371,7 @@ public final class SQLUtils {
break;
} else {
String afterEnd = test.substring(endIndex + blocks[1].length()).trim();
if (CommonUtils.isJavaIdentifier(afterEnd)) {
if (afterEnd.chars().noneMatch(Character::isWhitespace)) {
isBlockQuery = true;
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册