#12037 Initialize variable rules at the very end

上级 a29e562d
...@@ -117,7 +117,7 @@ public class HANASQLDialect extends GenericSQLDialect implements TPRuleProvider ...@@ -117,7 +117,7 @@ public class HANASQLDialect extends GenericSQLDialect implements TPRuleProvider
@Override @Override
public void extendRules(@Nullable DBPDataSourceContainer dataSource, @NotNull List<TPRule> rules, @NotNull RulePosition position) { public void extendRules(@Nullable DBPDataSourceContainer dataSource, @NotNull List<TPRule> rules, @NotNull RulePosition position) {
if (position == RulePosition.INITIAL) { if (position == RulePosition.FINAL) {
rules.add(new SQLVariableRule(this)); rules.add(new SQLVariableRule(this));
} }
} }
......
...@@ -315,7 +315,7 @@ public class SQLServerDialect extends JDBCSQLDialect implements TPRuleProvider { ...@@ -315,7 +315,7 @@ public class SQLServerDialect extends JDBCSQLDialect implements TPRuleProvider {
@Override @Override
public void extendRules(@Nullable DBPDataSourceContainer dataSource, @NotNull List<TPRule> rules, @NotNull RulePosition position) { public void extendRules(@Nullable DBPDataSourceContainer dataSource, @NotNull List<TPRule> rules, @NotNull RulePosition position) {
if (position == RulePosition.INITIAL) { if (position == RulePosition.FINAL) {
rules.add(new SQLVariableRule(this)); rules.add(new SQLVariableRule(this));
} }
if (position == RulePosition.KEYWORDS) { if (position == RulePosition.KEYWORDS) {
......
...@@ -244,6 +244,10 @@ public class SQLRuleManager { ...@@ -244,6 +244,10 @@ public class SQLRuleManager {
} }
} }
if (ruleProvider != null) {
ruleProvider.extendRules(dataSourceContainer, rules, TPRuleProvider.RulePosition.FINAL);
}
allRules = rules.toArray(new TPRule[0]); allRules = rules.toArray(new TPRule[0]);
} }
......
...@@ -31,6 +31,7 @@ public interface TPRuleProvider { ...@@ -31,6 +31,7 @@ public interface TPRuleProvider {
enum RulePosition { enum RulePosition {
PARTITION, PARTITION,
INITIAL, INITIAL,
FINAL,
CONTROL, CONTROL,
QUOTES, QUOTES,
KEYWORDS KEYWORDS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册