improve parameterize sql

This commit is contained in:
kiki
2013-09-27 15:59:49 +08:00
parent 121f684311
commit fb4e239855
3 changed files with 21 additions and 3 deletions
@@ -175,6 +175,16 @@ public class ParameterizedOutputVisitorUtils {
}
public static boolean visit(ParameterizedVisitor v, SQLNullExpr x) {
SQLObject parent = x.getParent();
if (parent instanceof SQLBinaryOpExpr) {
SQLBinaryOpExpr binaryOpExpr = (SQLBinaryOpExpr) parent;
if (binaryOpExpr.getOperator() == SQLBinaryOperator.IsNot
|| binaryOpExpr.getOperator() == SQLBinaryOperator.Is) {
v.print("NULL");
return false;
}
}
v.print('?');
v.incrementReplaceCunt();
return false;