export sql parameter ignore null.

This commit is contained in:
wenshao
2016-12-04 21:26:01 +08:00
parent b3ca3e74b6
commit c774782bcb
2 changed files with 45 additions and 20 deletions
@@ -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;