mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor sql parser & support tableMapping. issue #1432
This commit is contained in:
+3
-20
@@ -151,23 +151,7 @@ public class SQLServerOutputVisitor extends SQLASTOutputVisitor implements SQLSe
|
||||
|
||||
x.getTableSource().accept(this);
|
||||
|
||||
if (x.getColumns().size() > 0) {
|
||||
incrementIndent();
|
||||
println();
|
||||
print('(');
|
||||
for (int i = 0, size = x.getColumns().size(); i < size; ++i) {
|
||||
if (i != 0) {
|
||||
if (i % 5 == 0) {
|
||||
println();
|
||||
}
|
||||
print0(", ");
|
||||
}
|
||||
|
||||
x.getColumns().get(i).accept(this);
|
||||
}
|
||||
print(')');
|
||||
decrementIndent();
|
||||
}
|
||||
printInsertColumns(x.getColumns());
|
||||
|
||||
if (x.getOutput() != null) {
|
||||
println();
|
||||
@@ -177,8 +161,7 @@ public class SQLServerOutputVisitor extends SQLASTOutputVisitor implements SQLSe
|
||||
|
||||
if (x.getValuesList().size() != 0) {
|
||||
println();
|
||||
print0(ucase ? "VALUES" : "values");
|
||||
println();
|
||||
print0(ucase ? "VALUES " : "values ");
|
||||
for (int i = 0, size = x.getValuesList().size(); i < size; ++i) {
|
||||
if (i != 0) {
|
||||
print(',');
|
||||
@@ -256,7 +239,7 @@ public class SQLServerOutputVisitor extends SQLASTOutputVisitor implements SQLSe
|
||||
}
|
||||
|
||||
public boolean visit(SQLExprTableSource x) {
|
||||
x.getExpr().accept(this);
|
||||
printTableSourceExpr(x.getExpr());
|
||||
|
||||
if (x.getAlias() != null) {
|
||||
print(' ');
|
||||
|
||||
Reference in New Issue
Block a user