[ https://issues.apache.org/jira/browse/TORQUE-321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Fox resolved TORQUE-321. ------------------------------- Resolution: Fixed Fix Version/s: 4.1 > Wrong optimization of iLike without wildcards > ---------------------------------------------- > > Key: TORQUE-321 > URL: https://issues.apache.org/jira/browse/TORQUE-321 > Project: Torque > Issue Type: Bug > Components: Runtime > Affects Versions: 4.0 > Environment: Using java 8 and Postgresql 9.3.4. > Reporter: Martin Tilsted > Assignee: Thomas Fox > Fix For: 4.1 > > > Torque transform a criteria with SqlEnum.ILIKE to a simple compare using(=) > if the string it searches for don't contain any wildcards. > But this optimization is not valid, because ILIKE also does a case > insensitive compare. This bug causes ILIKE to behave like LIKE when not using > any wildcards. > Example code: > Criteria c=new Criteria(); > c.and(VoucherinstancePeer.CODE,"myCode",SqlEnum.ILIKE); > log.debug("Got criteria=" + c); > c=new Criteria(); > c.and(VoucherinstancePeer.CODE,"myCode%",SqlEnum.ILIKE); > log.debug("Got criteria=" + c); > Gives this output: > DEBUG - Got criteria=Criteria: Current Query SQL (may not be complete or > applicable): SELECT FROM voucherInstance WHERE voucherInstance.code=? > Replacements: [myCode] > DEBUG - Got criteria=Criteria: Current Query SQL (may not be complete or > applicable): SELECT FROM voucherInstance WHERE voucherInstance.code ILIKE ? > Replacements: [myCode%] > where the invalid transformation can be seen. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org For additional commands, e-mail: torque-dev-h...@db.apache.org