mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser.
This commit is contained in:
+9
-1
@@ -195,7 +195,15 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
if (lexer.token() == Token.EQ) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
stmt.getTableOptions().put("ENGINE", this.exprParser.expr());
|
||||
|
||||
SQLExpr expr = null;
|
||||
if (lexer.token() == Token.MERGE) {
|
||||
expr = new SQLIdentifierExpr(lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
expr = this.exprParser.expr();
|
||||
}
|
||||
stmt.getTableOptions().put("ENGINE", expr);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -2097,7 +2097,7 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleCreateTableStatement x) {
|
||||
printCreateTable(x);
|
||||
printCreateTable(x, false);
|
||||
|
||||
if (x.getOf() != null) {
|
||||
println();
|
||||
|
||||
@@ -2367,12 +2367,12 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
}
|
||||
|
||||
public boolean visit(SQLCreateTableStatement x) {
|
||||
printCreateTable(x);
|
||||
printCreateTable(x, true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void printCreateTable(SQLCreateTableStatement x) {
|
||||
protected void printCreateTable(SQLCreateTableStatement x, boolean printSelect) {
|
||||
print0(ucase ? "CREATE " : "create ");
|
||||
|
||||
final SQLCreateTableStatement.Type tableType = x.getType();
|
||||
@@ -2394,7 +2394,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
}
|
||||
|
||||
SQLSelect select = x.getSelect();
|
||||
if (select != null) {
|
||||
if (printSelect && select != null) {
|
||||
println();
|
||||
print0(ucase ? "AS" : "as");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user