mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
sql parser improved support db2 truncate syntax. for issue #1324
This commit is contained in:
@@ -1449,6 +1449,31 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Printab
|
||||
public boolean visit(SQLTruncateStatement x) {
|
||||
print0(ucase ? "TRUNCATE TABLE " : "truncate table ");
|
||||
printAndAccept(x.getTableSources(), ", ");
|
||||
|
||||
if (x.isDropStorage()) {
|
||||
print0(ucase ? " DROP STORAGE" : " drop storage");
|
||||
}
|
||||
|
||||
if (x.isReuseStorage()) {
|
||||
print0(ucase ? " REUSE STORAGE" : " reuse storage");
|
||||
}
|
||||
|
||||
if (x.isIgnoreDeleteTriggers()) {
|
||||
print0(ucase ? " IGNORE DELETE TRIGGERS" : " ignore delete triggers");
|
||||
}
|
||||
|
||||
if (x.isRestrictWhenDeleteTriggers()) {
|
||||
print0(ucase ? " RESTRICT WHEN DELETE TRIGGERS" : " restrict when delete triggers");
|
||||
}
|
||||
|
||||
if (x.isContinueIdentity()) {
|
||||
print0(ucase ? " CONTINUE IDENTITY" : " continue identity");
|
||||
}
|
||||
|
||||
if (x.isImmediate()) {
|
||||
print0(ucase ? " IMMEDIATE" : " immediate");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user