修改关于 NULL 的问题

Oracle 中  原始sql  :alter table aaa modify bbb null;
转换后成为:  ALTER TABLE  aaa  MODIFY ( bbb DEFAULT NULL );
原始Sql的语义改变了,改变了字段的default值
This commit is contained in:
juicer
2016-07-29 18:33:22 +08:00
committed by GitHub
parent 381ec854b5
commit 6ad7fa902b
3 changed files with 24 additions and 0 deletions
@@ -1192,6 +1192,16 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Printab
return false;
}
public boolean visit(NullConstraint x) {
if (x.getName() != null) {
print0(ucase ? "CONSTRAINT " : "constraint ");
x.getName().accept(this);
print(' ');
}
print0(ucase ? "NULL" : "null");
return false;
}
@Override
public boolean visit(SQLUnionQuery x) {
x.getLeft().accept(this);
@@ -716,4 +716,9 @@ public interface SQLASTVisitor {
boolean visit(SQLErrorLoggingClause x);
void endVisit(SQLErrorLoggingClause x);
boolean visit(NullConstraint x);
void endVisit(NullConstraint x);
}
@@ -1565,4 +1565,13 @@ public class SQLASTVisitorAdapter implements SQLASTVisitor {
public void endVisit(SQLErrorLoggingClause x) {
}
@Override
public boolean visit(NullConstraint x) {
return true;
}
@Override
public void endVisit(NullConstraint x) {
}
}