Issue Details (XML | Word | Printable)

Key: JDO-267
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Craig Russell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Query with alias result generates incorrect SQL

Created: 28/Dec/05 11:45 AM   Updated: 29/Dec/05 03:03 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 28/Dec/05 08:52 PM


 Description  « Hide
This JDOQL query results in the wrong SQL:
        /*UNIQUE*/ Boolean.FALSE,
        /*RESULT*/ "firstname AS firstName, lastname AS lastName",
        /*INTO*/ FullName.class,
        /*FROM*/ FullTimeEmployee.class,
        /*EXCLUDE*/ Boolean.TRUE,
        /*WHERE*/ "salary > 1000 & projects.contains(p) & " +
                        "p.budget > limit",
        /*VARIABLES*/ "Project p",
        /*PARAMETERS*/ "BigDecimal limit",
        /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Project; " +
                        "import java.math.BigDecimal",
        /*GROUP BY*/ "firstname, lastname HAVING lastname.startsWith('emp')",
        /*ORDER BY*/ "lastname ASCENDING",
        /*FROM*/ 0,
        /*TO*/ 3)
001 error: javax.jdo.JDODataStoreException: Error executing JDOQL query "SELECT DISTINCT THIS.FIRSTNAME AS firstName,THIS.LASTNAME AS lastName,THIS.LASTNAME FROM datastoreidentity0.PERSONS THIS INNER JOIN datastoreidentity0.PROJECT_MEMBER THIS_PROJECTS ON THIS_PROJECTS."MEMBER" = THIS.DATASTORE_IDENTITY INNER JOIN datastoreidentity0.PROJECTS UNBOUND_P ON UNBOUND_P.DATASTORE_IDENTITY = THIS_PROJECTS.PROJID LEFT OUTER JOIN datastoreidentity0.PROJECTS UNBOUND_P_BUDGET ON UNBOUND_P.DATASTORE_IDENTITY = UNBOUND_P_BUDGET.DATASTORE_IDENTITY WHERE THIS.DISCRIMINATOR = ? AND THIS.SALARY > 1000 AND UNBOUND_P_BUDGET.BUDGET > .2E4 GROUP BY THIS.FIRSTNAME,THIS.LASTNAME HAVING LOCATE(?,THIS.LASTNAME) = 1 ORDER BY THIS.LASTNAME" : Column name 'LASTNAME' appears more than once in the result of the query expression.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 28/Dec/05 05:05 PM
Any clue as to which TCK test this refers to ? The test class name would be nice.

Andy Jefferson added a comment - 28/Dec/05 08:52 PM
Presuming you're talking about SingleString test.
Now fixed in JPOX CVS - build dated 29/12/2005 or later.

Andy Jefferson made changes - 28/Dec/05 08:52 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Craig Russell added a comment - 29/Dec/05 03:03 AM
Sorry, I should have included the full stack trace and identified the test case.

I decided to open a new JIRA for this issue because the JIRA that had been tracking this test case had changed so many times the original description was no longer descriptive.

Anyway thanks for the comment.