bug fixed for sql parser. for issue #1910

This commit is contained in:
wenshao
2017-08-16 14:19:02 +08:00
parent 4b7093dc6a
commit 97ed996c05
22 changed files with 440 additions and 64 deletions
@@ -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 (");