mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for statementExecutableSqlLogEnable
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.mysql.visitor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLCommentHint;
|
||||
@@ -342,7 +343,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
printAndAccept(x.getArguments(), ", ");
|
||||
print(")");
|
||||
}
|
||||
|
||||
|
||||
if (x.getCharSetName() != null) {
|
||||
print(" CHARACTER SET ");
|
||||
print(x.getCharSetName());
|
||||
@@ -521,6 +522,17 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
}
|
||||
|
||||
public boolean visit(SQLVariantRefExpr x) {
|
||||
{
|
||||
List<Object> parameters = this.getParameters();
|
||||
int index = x.getIndex();
|
||||
|
||||
if (parameters != null && index >= 0 && index < parameters.size()) {
|
||||
Object param = parameters.get(index);
|
||||
printParameter(param);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (x.isGlobal()) {
|
||||
print("@@global.");
|
||||
} else {
|
||||
|
||||
@@ -700,56 +700,59 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
|
||||
Object param = parameters.get(index);
|
||||
printParameter(param);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void printParameter(Object param) {
|
||||
if (param == null) {
|
||||
print("NULL");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof Number //
|
||||
|| param instanceof Boolean) {
|
||||
print(param.toString());
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof String) {
|
||||
SQLCharExpr charExpr = new SQLCharExpr((String) param);
|
||||
visit(charExpr);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof Date) {
|
||||
print((Date) param);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof InputStream) {
|
||||
print("'<InputStream>");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof Reader) {
|
||||
print("'<Reader>");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof Blob) {
|
||||
print("'<Blob>");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof NClob) {
|
||||
print("'<NClob>");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param instanceof Clob) {
|
||||
print("'<Clob>");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
print("'" + param.getClass().getName() + "'");
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLDropTableStatement x) {
|
||||
|
||||
Reference in New Issue
Block a user