improve sql-wall

This commit is contained in:
wenshao
2013-07-31 09:41:04 +08:00
parent 9c578e0c75
commit 653db755fa
14 changed files with 209 additions and 28 deletions
@@ -15,6 +15,8 @@
*/
package com.alibaba.druid.sql.dialect.mysql.visitor;
import java.util.List;
import com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr;
import com.alibaba.druid.sql.ast.expr.SQLCharExpr;
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
@@ -24,6 +26,7 @@ import com.alibaba.druid.sql.ast.expr.SQLNCharExpr;
import com.alibaba.druid.sql.ast.expr.SQLNumberExpr;
import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
import com.alibaba.druid.sql.ast.statement.SQLInsertStatement.ValuesClause;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement;
import com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils;
import com.alibaba.druid.sql.visitor.ParameterizedVisitor;
@@ -134,9 +137,13 @@ public class MySqlParameterizedOutputVisitor extends MySqlOutputVisitor implemen
}
protected void printValuesList(MySqlInsertStatement x) {
List<ValuesClause> valuesList = x.getValuesList();
print("VALUES ");
incrementIndent();
x.getValuesList().get(0).accept(this);
valuesList.get(0).accept(this);
decrementIndent();
if (valuesList.size() > 1) {
this.incrementReplaceCunt();
}
}
}
@@ -1,3 +1,18 @@
/*
* Copyright 1999-2011 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.sql.visitor;
public interface ParameterizedVisitor extends SQLASTVisitor {