mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修改关于 NULL 的问题
Oracle 中 原始sql :alter table aaa modify bbb null; 转换后成为: ALTER TABLE aaa MODIFY ( bbb DEFAULT NULL ); 原始Sql的语义改变了,改变了字段的default值
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user