From b63fc30e8c4e0c85de3e5fa730d95e45aa92d5f3 Mon Sep 17 00:00:00 2001 From: Si Chen Date: Tue, 17 Mar 2009 17:00:38 +0000 Subject: [PATCH] OFBIZ-1266 patch from Jeremy Wickersheimer to fix issue with IN FALSE on some queries git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@755320 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/ofbiz/entity/condition/EntityComparisonOperator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java b/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java index e71269336c..c9cd38d6bf 100644 --- a/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java +++ b/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java @@ -87,9 +87,9 @@ public class EntityComparisonOperator extends EntityOperator { public void addSqlValue(StringBuilder sql, ModelEntity entity, List entityConditionParams, boolean compat, Object lhs, Object rhs, DatasourceInfo datasourceInfo) { //Debug.logInfo("EntityComparisonOperator.addSqlValue field=" + lhs + ", value=" + rhs + ", value type=" + (rhs == null ? "null object" : rhs.getClass().getName()), module); - // if this is an IN operator and the rhs Object isEmpty, add "FALSE" instead of the normal SQL + // if this is an IN operator and the rhs Object isEmpty, add "1=0" instead of the normal SQL. Note that "FALSE" does not work with all databases. if (this.idInt == EntityOperator.ID_IN && UtilValidate.isEmpty(rhs)) { - sql.append("FALSE"); + sql.append("1=0"); return; }