mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser
This commit is contained in:
@@ -567,7 +567,13 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter {
|
||||
print(' ');
|
||||
item.accept(this);
|
||||
}
|
||||
|
||||
|
||||
if (x.getEnable() != null) {
|
||||
if (x.getEnable().booleanValue()) {
|
||||
print(" ENABLE");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -674,13 +680,17 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter {
|
||||
|
||||
if (size > 0) {
|
||||
print(" (");
|
||||
|
||||
incrementIndent();
|
||||
println();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
if (i != 0) {
|
||||
print(", ");
|
||||
println();
|
||||
}
|
||||
x.getTableElementList().get(i).accept(this);
|
||||
}
|
||||
decrementIndent();
|
||||
println();
|
||||
print(")");
|
||||
}
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLTruncateStatement x) {
|
||||
setMode(x, Mode.Insert);
|
||||
setMode(x, Mode.Delete);
|
||||
|
||||
setAliasMap();
|
||||
|
||||
@@ -374,7 +374,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
x.putAttribute("_old_local_", originalTable);
|
||||
|
||||
TableStat stat = getTableStat(ident);
|
||||
stat.incrementInsertCount();
|
||||
stat.incrementDeleteCount();
|
||||
|
||||
Map<String, String> aliasMap = getAliasMap();
|
||||
if (aliasMap != null) {
|
||||
@@ -805,8 +805,11 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
|
||||
TableStat stat = getTableStat(tableName);
|
||||
stat.incrementCreateCount();
|
||||
setCurrentTable(x, tableName);
|
||||
|
||||
accept(x.getTableElementList());
|
||||
|
||||
restoreCurrentTable(x);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user