You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2007/09/30 11:08:50 UTC
[jira] Commented: (OFBIZ-1266) EntityOperator.IN will crash on some
databases with empty list
[ https://issues.apache.org/jira/browse/OFBIZ-1266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531298 ]
Jacques Le Roux commented on OFBIZ-1266:
----------------------------------------
Hi Leon,
Did you try ? Have you an use case ?
> 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.