use of com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor in project druid by alibaba.
the class StringComparisonFunctionsTest method output.
private String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();
for (SQLStatement stmt : stmtList) {
stmt.accept(new MySqlOutputVisitor(out));
out.append(";");
}
return out.toString();
}
use of com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor in project druid by alibaba.
the class XMLFunctionsTest method output.
private String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();
for (SQLStatement stmt : stmtList) {
stmt.accept(new MySqlOutputVisitor(out));
out.append(";");
}
return out.toString();
}
use of com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor in project druid by alibaba.
the class StringFunctionsTest method output.
private String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();
for (SQLStatement stmt : stmtList) {
stmt.accept(new MySqlOutputVisitor(out));
out.append(";");
}
return out.toString();
}
use of com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor in project druid by alibaba.
the class StringTest method output.
private String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();
for (SQLStatement stmt : stmtList) {
stmt.accept(new MySqlOutputVisitor(out));
out.append(";");
}
return out.toString();
}
use of com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor in project druid by alibaba.
the class MySqlParameterizedOutputVisitorTest method validate.
void validate(String sql, String expect) {
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement stmt = statementList.get(0);
Assert.assertEquals(1, statementList.size());
StringBuilder out = new StringBuilder();
MySqlOutputVisitor visitor = new MySqlOutputVisitor(out, true);
stmt.accept(visitor);
Assert.assertTrue(visitor.getReplaceCount() > 0);
Assert.assertEquals(expect, out.toString());
}
Aggregations