mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
export sql parameter ignore null.
This commit is contained in:
@@ -735,26 +735,26 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
}
|
||||
|
||||
public boolean visit(SQLNullExpr x) {
|
||||
if (this.parameterized
|
||||
&& ParameterizedOutputVisitorUtils.checkParameterize(x)) {
|
||||
SQLObject parent = x.getParent();
|
||||
if (parent instanceof SQLBinaryOpExpr) {
|
||||
SQLBinaryOpExpr binaryOpExpr = (SQLBinaryOpExpr) parent;
|
||||
if (binaryOpExpr.getOperator() == SQLBinaryOperator.IsNot
|
||||
|| binaryOpExpr.getOperator() == SQLBinaryOperator.Is) {
|
||||
print("NULL");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
print('?');
|
||||
incrementReplaceCunt();
|
||||
|
||||
if(this instanceof ExportParameterVisitor || this.parameters != null){
|
||||
ExportParameterVisitorUtils.exportParameter(this.parameters, x);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// if (this.parameterized
|
||||
// && ParameterizedOutputVisitorUtils.checkParameterize(x)) {
|
||||
// SQLObject parent = x.getParent();
|
||||
// if (parent instanceof SQLBinaryOpExpr) {
|
||||
// SQLBinaryOpExpr binaryOpExpr = (SQLBinaryOpExpr) parent;
|
||||
// if (binaryOpExpr.getOperator() == SQLBinaryOperator.IsNot
|
||||
// || binaryOpExpr.getOperator() == SQLBinaryOperator.Is) {
|
||||
// print("NULL");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// print('?');
|
||||
// incrementReplaceCunt();
|
||||
//
|
||||
// if(this instanceof ExportParameterVisitor || this.parameters != null){
|
||||
// ExportParameterVisitorUtils.exportParameter(this.parameters, x);
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
print0(ucase ? "NULL" : "null");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user