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

Craig Russell updated JDO-529:
------------------------------

    Attachment: jdo-529.patch

The query orders by personid, which is not specified in the select expression. 
It's assumed that if the underlying query language (e.g. SQL) requires all 
order by terms to be selected, then the term is automatically added by the 
implementation. 

In this case, it would result in SELECT DISTINCT personid, firstname, lastname 
which might be unexpected since personid is not used in the user-visible query 
result. The results might include multiple instances with different personid 
but the same firstname and lastname. 

Since this case is not adequately discussed in the specification, the test case 
should be changed.

This patch changes the ordering expression to use selected fields and no 
unselected fields .

> ChangeQuery - DISTINCT is expected even though it is not specified
> ------------------------------------------------------------------
>
>                 Key: JDO-529
>                 URL: https://issues.apache.org/jira/browse/JDO-529
>             Project: JDO
>          Issue Type: Test
>          Components: tck2
>            Reporter: Ilan Kirsh
>         Attachments: jdo-529.patch
>
>
> Test org.apache.jdo.tck.query.api.ChangeQuery expects 3 result objects:
> List expectedResult = Arrays.asList(new Object[] {
>             new FullName("emp1First", "emp1Last"), 
>             new FullName("emp2First", "emp2Last"),
>             new FullName("emp5First", "emp5Last")});
> But actually there should be 4 result objects:
> List expectedResult = Arrays.asList(new Object[] {
>             new FullName("emp1First", "emp1Last"), 
>             new FullName("emp2First", "emp2Last"),
>             new FullName("emp2First", "emp2Last"),
>             new FullName("emp5First", "emp5Last")});
> because the result is not specified as DISTINCT.

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

Reply via email to