EntityOperator.IN will crash on some databases with empty list
--------------------------------------------------------------
Key: OFBIZ-1266
URL: https://issues.apache.org/jira/browse/OFBIZ-1266
Project: OFBiz
Issue Type: Bug
Components: framework
Affects Versions: SVN trunk
Environment: derby, unkown other databases
Reporter: Leon Torres
If you use the following entity exr,
new EntityExpr("orderId", EntityOperator.IN, new ArrayList());
It will crash on at least Derby. The reason is that this condition evaluates
to the keyword FALSE, which apparently is not supported on Derby. The problem
code is in EntityComparisonOperator.java:
// if this is an IN operator and the rhs Object isEmpty, add "FALSE"
instead of the normal SQL
if (this.idInt == EntityOperator.ID_IN && UtilValidate.isEmpty(rhs)) {
sql.append("FALSE");
return;
}
Perhaps this is over engineered? What happens if we just leave this out and
let it generate an "IN ()" SQL?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.