mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser. for issue #1910
This commit is contained in:
+1
-1
@@ -241,7 +241,7 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
if (lexer.token() == Token.EQ) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
stmt.getTableOptions().put("COMMENT", this.exprParser.expr());
|
||||
stmt.setComment(this.exprParser.expr());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -536,6 +536,12 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
option.getValue().accept(this);
|
||||
}
|
||||
|
||||
SQLExpr comment = x.getComment();
|
||||
if (comment != null) {
|
||||
print0(ucase ? " COMMENT " : " comment ");
|
||||
comment.accept(this);
|
||||
}
|
||||
|
||||
if (x.getPartitioning() != null) {
|
||||
println();
|
||||
x.getPartitioning().accept(this);
|
||||
|
||||
@@ -31,8 +31,6 @@ public class OdpsCreateTableStatement extends SQLCreateTableStatement {
|
||||
|
||||
private SQLExprTableSource like;
|
||||
|
||||
protected SQLExpr comment;
|
||||
|
||||
protected List<SQLColumnDefinition> partitionColumns = new ArrayList<SQLColumnDefinition>(2);
|
||||
|
||||
protected final List<SQLName> clusteredBy = new ArrayList<SQLName>();
|
||||
@@ -58,14 +56,6 @@ public class OdpsCreateTableStatement extends SQLCreateTableStatement {
|
||||
this.like = like;
|
||||
}
|
||||
|
||||
public SQLExpr getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(SQLExpr comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public List<SQLColumnDefinition> getPartitionColumns() {
|
||||
return partitionColumns;
|
||||
}
|
||||
|
||||
@@ -1764,11 +1764,7 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
print0(ucase ? "COMPUTE STATISTICS" : "compute statistics");
|
||||
}
|
||||
|
||||
if (x.getTablespace() != null) {
|
||||
println();
|
||||
print0(ucase ? "TABLESPACE " : "tablespace ");
|
||||
x.getTablespace().accept(this);
|
||||
}
|
||||
this.printOracleSegmentAttributes(x);
|
||||
|
||||
if (x.isOnline()) {
|
||||
print0(ucase ? " ONLINE" : " online");
|
||||
@@ -1790,8 +1786,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
}
|
||||
}
|
||||
|
||||
this.printOracleSegmentAttributes(x);
|
||||
|
||||
if (x.getLocalPartitions().size() > 0) {
|
||||
println();
|
||||
print0(ucase ? "LOCAL (" : "local (");
|
||||
|
||||
Reference in New Issue
Block a user