You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2017/09/23 13:47:00 UTC

[jira] [Updated] (CAY-2366) Incorrect EJBQL COUNT translation

     [ https://issues.apache.org/jira/browse/CAY-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-2366:
---------------------------------
    Description: 
As a part of 4.0.B2 evaluation, I tried running LinkRest tests on 4.0.B2. I got a few errors related to EJBQL query with COUNT translation. Consider this query for instance:

{noformat}
select count(a) from E17 a
{noformat}

Previous it generated SQL like this:

{noformat}
SELECT COUNT(*) AS sc0 FROM utest.e17 t0 
{noformat}

Now it generates SQL with an explicit ID inside COUNT, but the alias for the column and the alias for the table do not match:

{noformat}
SELECT COUNT(t0.id1) AS sc0 FROM utest.e17 t1 
{noformat}

The result is an exception similar to this:

{noformat}
java.sql.SQLSyntaxErrorException: Column 'T0.ID1' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'T0.ID1' is not a column in the target table.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
{noformat}

  was:
As a part of 4.0.B2 evaluation, I tried running LinkRest tests on 4.0.B2. I got a few errors related to EJBQL query with COUNT translation. Consider this query for instance:

{noformat}
select count(a) from E17 a
{noformat}

Previous it generated SQL like this:

{noformat}
SELECT COUNT(*) AS sc0 FROM utest.e17 t0 
{noformat}

Now it generates SQL with an explicit ID inside COUNT, but the alias for the column and the alias for the table do not match:

{noformat}
SELECT COUNT(t0.id1) AS sc0 FROM utest.e17 t1 
{noformat}


> Incorrect EJBQL COUNT translation
> ---------------------------------
>
>                 Key: CAY-2366
>                 URL: https://issues.apache.org/jira/browse/CAY-2366
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 4.0.B2
>            Reporter: Andrus Adamchik
>            Assignee: Nikita Timofeev
>
> As a part of 4.0.B2 evaluation, I tried running LinkRest tests on 4.0.B2. I got a few errors related to EJBQL query with COUNT translation. Consider this query for instance:
> {noformat}
> select count(a) from E17 a
> {noformat}
> Previous it generated SQL like this:
> {noformat}
> SELECT COUNT(*) AS sc0 FROM utest.e17 t0 
> {noformat}
> Now it generates SQL with an explicit ID inside COUNT, but the alias for the column and the alias for the table do not match:
> {noformat}
> SELECT COUNT(t0.id1) AS sc0 FROM utest.e17 t1 
> {noformat}
> The result is an exception similar to this:
> {noformat}
> java.sql.SQLSyntaxErrorException: Column 'T0.ID1' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'T0.ID1' is not a column in the target table.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)