improve sqlwall

This commit is contained in:
Yako
2014-09-09 20:04:50 +08:00
parent e6eddc52cd
commit 663a1c37ff
7 changed files with 71 additions and 25 deletions
@@ -2537,6 +2537,10 @@ public class MySqlStatementParser extends SQLStatementParser {
if (lexer.token() == Token.DEFAULT) {
lexer.nextToken();
}
if (lexer.token() == Token.HINT) {
stmt.setHints(this.exprParser.parseHints());
}
return stmt;
}
@@ -1123,12 +1123,9 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
print(" WITH CONSISTENT SNAPSHOT");
}
List<SQLCommentHint> hints = x.getHints();
if (hints != null && !hints.isEmpty()) {
if (x.getHints() != null && x.getHints().size() > 0) {
print(" ");
for (SQLCommentHint hint : hints) {
hint.accept(this);
}
printAndAccept(x.getHints(), " ");
}
if (x.isBegin()) {
@@ -2143,12 +2140,9 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
x.getTable().accept(this);
}
List<SQLCommentHint> hints = x.getHints();
if (hints != null && !hints.isEmpty()) {
if (x.getHints() != null && x.getHints().size() > 0) {
print(" ");
for (SQLCommentHint hint : hints) {
hint.accept(this);
}
printAndAccept(x.getHints(), " ");
}
return false;
@@ -2685,12 +2679,9 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
print(x.getLockType().name);
}
List<SQLCommentHint> hints = x.getHints();
if (hints != null && !hints.isEmpty()) {
if (x.getHints() != null && x.getHints().size() > 0) {
print(" ");
for (SQLCommentHint hint : hints) {
hint.accept(this);
}
printAndAccept(x.getHints(), " ");
}
return false;
}