improved sql parser.

This commit is contained in:
wenshao
2017-09-11 17:45:32 +08:00
parent a9474ac6d0
commit 1111fd48c8
4 changed files with 17 additions and 10 deletions
@@ -27,9 +27,9 @@ public class SQLCommentStatement extends SQLStatementImpl {
TABLE, COLUMN
}
private SQLName on;
private Type type;
private SQLExpr comment;
private SQLExprTableSource on;
private Type type;
private SQLExpr comment;
public SQLExpr getComment() {
return comment;
@@ -47,14 +47,21 @@ public class SQLCommentStatement extends SQLStatementImpl {
this.type = type;
}
public SQLName getOn() {
public SQLExprTableSource getOn() {
return on;
}
public void setOn(SQLName on) {
public void setOn(SQLExprTableSource on) {
if (on != null) {
on.setParent(this);
}
this.on = on;
}
public void setOn(SQLName on) {
this.setOn(new SQLExprTableSource(on));
}
@Override
protected void accept0(SQLASTVisitor visitor) {
if (visitor.visit(this)) {
@@ -624,7 +624,7 @@ public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLS
}
public boolean apply(SQLCommentStatement x) {
SQLName on = x.getOn();
SQLName on = x.getOn().getName();
SQLExpr comment = x.getComment();
if (comment == null) {
return false;