if you execute a query that has an 'in' clause using a binding parameter and subsequently run the same query but with a different set with a different number of values then we wrongly reuse the original query.
public void test() { ResetBasicData.reset(); List<Object> idList1 = new ArrayList<Object>(); idList1.add(1); String oq = "find customer where id in (:idList)"; Ebean.createQuery(Customer.class, oq) .setParameter("idList", idList1) .findList(); List<Object> idList2 = new ArrayList<Object>(); idList2.add(1); idList2.add(2); Ebean.createQuery(Customer.class, oq) .setParameter("idList", idList2) .findList(); }
Fixed in HEAD.
The fix involves taking the size of the collection (and the property name etc) into account when calculating the query plan hash.