improved sql parser.

This commit is contained in:
wenshao
2017-06-28 15:34:43 +08:00
parent c64c40e81d
commit 2f6e406e33
19 changed files with 971 additions and 14 deletions
@@ -43,9 +43,6 @@ public class DB2OutputVisitor extends SQLASTOutputVisitor implements DB2ASTVisit
if (x.isForReadOnly()) {
println();
print0(ucase ? "FOR READ ONLY" : "for read only");
} else if (x.isForUpdate()) {
println();
print0(ucase ? "FOR UPDATE" : "for update");
}
if (x.getIsolation() != null) {
@@ -1695,7 +1695,7 @@ public class OracleStatementParser extends SQLStatementParser {
if (lexer.token() == Token.ALL) {
lexer.nextToken();
stmt.setOption(OracleMultiInsertStatement.Option.ALL);
} else if (lexer.token() == Token.FIRST) {
} else if (lexer.token() == Token.FIRST || identifierEquals("FIRST")) {
lexer.nextToken();
stmt.setOption(OracleMultiInsertStatement.Option.FIRST);
}
@@ -144,8 +144,11 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
}
public boolean visit(OracleDbLinkExpr x) {
x.getExpr().accept(this);
print('@');
SQLExpr expr = x.getExpr();
if (expr != null) {
expr.accept(this);
print('@');
}
print0(x.getDbLink());
return false;
}