Polish contribution

Issue: SPR-17120
This commit is contained in:
Sam Brannen
2018-08-13 14:31:19 +02:00
parent 24ed6de6aa
commit bdac39150f
2 changed files with 14 additions and 9 deletions

View File

@@ -344,18 +344,18 @@ public abstract class ScriptUtils {
public static boolean containsSqlScriptDelimiters(String script, String delim) {
boolean inLiteral = false;
boolean inEscape = false;
for (int i = 0; i < script.length(); i++) {
for (int i = 0; i < script.length(); i++) {
char c = script.charAt(i);
if (c == '\\') {
inEscape = !inEscape;
continue;
}
else if (inEscape) {
if (inEscape) {
inEscape = false;
continue;
}
// MySQL style escapes
if (c == '\\') {
inEscape = true;
continue;
}
if (c == '\'') {
inLiteral = !inLiteral;
}
@@ -363,6 +363,7 @@ public abstract class ScriptUtils {
return true;
}
}
return false;
}