提交 945f5203 编写于 作者: S Serge Rider

SQL dialect: NPE fixes


Former-commit-id: 1e9b74d9
上级 7afb4e24
......@@ -93,11 +93,14 @@ public class SQLAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
private boolean isQuoteString(String str) {
for (String[] qs : syntaxManager.getQuoteStrings()) {
String[][] quoteStrings = syntaxManager.getQuoteStrings();
if (quoteStrings != null) {
for (String[] qs : quoteStrings) {
if (str.equals(SQLConstants.STR_QUOTE_SINGLE) || str.equals(qs[0]) || str.equals(qs[1])) {
return true;
}
}
}
return false;
}
......
......@@ -107,6 +107,7 @@ public class SQLPartitionScanner extends RuleBasedPartitionScanner {
{
boolean hasSingleQuoteRule = false, hasDoubleQuoteRule = false;
String[][] quoteStrings = dialect.getIdentifierQuoteStrings();
if (quoteStrings != null) {
for (String[] quoteString : quoteStrings) {
rules.add(new MultiLineRule(quoteString[0], quoteString[1], sqlQuotedToken, dialect.getStringEscapeCharacter()));
if (quoteString[0].equals(SQLConstants.STR_QUOTE_SINGLE) && quoteString[0].equals(quoteString[1])) {
......@@ -115,6 +116,7 @@ public class SQLPartitionScanner extends RuleBasedPartitionScanner {
hasDoubleQuoteRule = true;
}
}
}
if (!hasSingleQuoteRule) {
rules.add(new MultiLineRule(SQLConstants.STR_QUOTE_SINGLE, SQLConstants.STR_QUOTE_SINGLE, sqlStringToken, dialect.getStringEscapeCharacter()));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册