Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] "AVG(t1.SALARY)" appears twice in generated SQL query for JUnitJPQLComplexAggregateTestSuite's complexAVGOrderTest

Hi Dies,

  There is a bug here.

  The best way to solve this issue for the time being is to change the test.

Near the beginning of the test is the line: rq.useDistinct(); Remove that line and the problem should be solved.

-Tom

Dies Koper wrote:
Hi,

I just noticed this while running the JPA test set on Symfoware.

The test's source calls average() only once, but it appears in the SQL
statementselect list twice.
Is it a known issue (perhaps bug 4616218, which is waiting for a bug fix
according to the comment at the top of the class)?

It generates the following SQL (on Symfoware, but I don't think I have
anything specific in my platform class that could be causing it):

SELECT DISTINCT AVG(t1.SALARY), t0.GENDER, AVG(t1.SALARY) FROM
CMP3_EMPLOYEE t0, CMP3_SALARY t1 WHERE ((t0.L_NAME = 'Smith') AND
(t1.EMP_ID = t0.EMP_ID)) GROUP BY t0.GENDER ORDER BY AVG(t1.SALARY)

This query fails on Symfoware because it complains the item in the order
by clause occurs multiple times in the select list.
(I'm not sure why it complains about that, but I thought it's odd this
SQL was generated in the first place).

Thanks,
Dies

_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


Back to the top