Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 24659 invoked from network); 19 Sep 2006 23:55:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Sep 2006 23:55:59 -0000 Received: (qmail 9019 invoked by uid 500); 19 Sep 2006 23:55:59 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 8992 invoked by uid 500); 19 Sep 2006 23:55:59 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 8981 invoked by uid 99); 19 Sep 2006 23:55:59 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2006 16:55:59 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from ([209.237.227.198:59311] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 75/2F-28275-E8380154 for ; Tue, 19 Sep 2006 16:55:58 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BB78C41006D for ; Tue, 19 Sep 2006 23:52:22 +0000 (GMT) Message-ID: <5872970.1158709942750.JavaMail.jira@brutus> Date: Tue, 19 Sep 2006 16:52:22 -0700 (PDT) From: "George Hongell (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Updated: (OPENJPA-50) bad sql pushdown, cast changes datatype In-Reply-To: <14827822.1158628162293.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/OPENJPA-50?page=all ] George Hongell updated OPENJPA-50: ---------------------------------- Attachment: failureEntities.jar entity java files and derby ddl script to use to recreate this issue > bad sql pushdown, cast changes datatype > --------------------------------------- > > Key: OPENJPA-50 > URL: http://issues.apache.org/jira/browse/OPENJPA-50 > Project: OpenJPA > Issue Type: Bug > Components: query > Environment: Windows xp, db2, derby > Reporter: George Hongell > Attachments: failureEntities.jar > > > 444 - bad sql pushdown, cast changes datatype > TEST444; select e from EmpBean e where e.salary > 5 and abs(e.salary) > 12 > 28203 TRACE [main] openjpa.jdbc.SQL - [0 ms] executing prepstmnt 1712481810 SELECT t0.empid, t0.bonus, t1.deptno, t1.budget, t1.name, t0.execLevel, t0.hireDate, t0.hireTime, t0.hireTimestamp, t2.street, t2.city, t2.state, t2.zip, t0.isManager, t0.name, t0.salary, t3.street, t3.city, t3.state, t3.zip FROM EmpBean t0 LEFT OUTER JOIN DeptBean t1 ON t0.dept_deptno = t1.deptno LEFT OUTER JOIN AddressBean t2 ON t0.home_street = t2.street LEFT OUTER JOIN AddressBean t3 ON t0.work_street = t3.street WHERE (CAST(t0.salary AS DOUBLE) > CAST(? AS DOUBLE) AND CAST(ABS(t0.salary) AS BIGINT) > CAST(? AS BIGINT)) [params=(long) 5, (long) 12] > select t0.empid, t0.salary FROM EmpBean t0 LEFT OUTER JOIN DeptBean t1 ON t0.dept_deptno = t1.deptno WHERE (CAST(t0.salary AS DOUBLE) > ?) AND (CAST(ABS(t0.salary) AS BIGINT) > ?) {long 5, long 12} > why CAST(ABS(t0.salary) AS BIGINT)????????? > select t0.empid, t0.salary FROM EmpBean t0 WHERE (CAST(t0.salary AS DOUBLE) > ?) AND (CAST(ABS(t0.salary) AS BIGINT) > ?) {long 5, long 12} > s/b > select t0.empid, t0.salary FROM EmpBean t0 LEFT OUTER JOIN DeptBean t1 ON t0.dept_deptno = t1.deptno WHERE (CAST(t0.salary AS DOUBLE) > ?) AND (CAST(ABS(t0.salary) AS DOUBLE) > ?) {long 5, long 12} > [ FAILED 444- bucket = fvtfull, query = select e from EmpBean e where e.salary > 5 and abs(e.salary) > 12 : > EXPECTED( > TEST444; select e from EmpBean e where e.salary > 5 and abs(e.salary) > 12 > EmpBean > ~~~~~~~ > [1] > [2] > [3] > TEST444; 3 tuples) > ACTUAL( > TEST444; select e from EmpBean e where e.salary > 5 and abs(e.salary) > 12 > EmpBean > ~~~~~~~ > [2] > [3] > TEST444; 2 tuples) ] -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira