You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Catalina Wei (JIRA)" <ji...@apache.org> on 2006/08/21 21:11:14 UTC

[jira] Created: (OPENJPA-28) groupby clause of a subquery incorrectly duplicated in the main query in the generated SQL

groupby clause of a subquery incorrectly duplicated in the main query in the generated SQL
------------------------------------------------------------------------------------------

                 Key: OPENJPA-28
                 URL: http://issues.apache.org/jira/browse/OPENJPA-28
             Project: OpenJPA
          Issue Type: Bug
          Components: query
            Reporter: Catalina Wei


JPquery: select e.name, e.salary from EmpBean e where (e.name = Any(select e1.name from EmpBean e1 group by e1.name )) order by e.name 
generated pushdown SQL:
SELECT t0.name, t0.salary, t1.name FROM EmpBean t0 JOIN EmpBean t1 ON (1 = 1) WHERE (t0.name = ANY((SELECT t2.name FROM EmpBean t2 GROUP BY t2.name))) GROUP BY t1.name ORDER BY t0.name ASC

correct pushdown SQL should be:
SELECT t0.name, t0.salary, t1.name FROM EmpBean t0 JOIN EmpBean t1 ON (1 = 1) WHERE (t0.name = ANY((SELECT t2.name FROM EmpBean t2 GROUP BY t2.name))) ORDER BY t0.name ASC

-- 
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

        

[jira] Updated: (OPENJPA-28) groupby clause of a subquery incorrectly duplicated in the main query in the generated SQL

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-28:
-----------------------------------

    Fix Version/s: 0.9.7

> groupby clause of a subquery incorrectly duplicated in the main query in the generated SQL
> ------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-28
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-28
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>            Reporter: Catalina Wei
>             Fix For: 0.9.7
>
>
> JPquery: select e.name, e.salary from EmpBean e where (e.name = Any(select e1.name from EmpBean e1 group by e1.name )) order by e.name 
> generated pushdown SQL:
> SELECT t0.name, t0.salary, t1.name FROM EmpBean t0 JOIN EmpBean t1 ON (1 = 1) WHERE (t0.name = ANY((SELECT t2.name FROM EmpBean t2 GROUP BY t2.name))) GROUP BY t1.name ORDER BY t0.name ASC
> correct pushdown SQL should be:
> SELECT t0.name, t0.salary, t1.name FROM EmpBean t0 JOIN EmpBean t1 ON (1 = 1) WHERE (t0.name = ANY((SELECT t2.name FROM EmpBean t2 GROUP BY t2.name))) ORDER BY t0.name ASC

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.