Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-573

RI creates bad SQL for navigational queries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JDO 2 maintenance release 1 (2.1), JDO 2 maintenance release 2 (2.2)
    • JDO 3.1-rc1
    • tck, tck2-legacy
    • None

    Description

      The test org.apache.jdo.tck.query.result.VariableInResultNavigation fails with incorrect SQL generated.

      [java] 1) testNavigationWithThisAndCompany(org.apache.jdo.tck.query.result.VariableInResultNavigation)javax.jdo.JDOException: JDOException thrown while executing query:
      [java] SELECT this, e, p FROM org.apache.jdo.tck.pc.company.Company WHERE name == "Sun Microsystems, Inc." && departments.contains(d) && d.employees.contains(e) && e.projects.contains(p) VARIABLES Department d; Employee e; Project p
      [java] at org.apache.jdo.tck.query.QueryTest.execute(QueryTest.java:1314)
      [java] at org.apache.jdo.tck.query.QueryTest.execute(QueryTest.java:1135)
      [java] at org.apache.jdo.tck.query.QueryTest.executeAPIQuery(QueryTest.java:1071)
      [java] at org.apache.jdo.tck.query.QueryTest.executeAPIQuery(QueryTest.java:1051)
      [java] at org.apache.jdo.tck.query.result.VariableInResultNavigation.testNavigationWithThisAndCompany(VariableInResultNavigation.java:251)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:254)
      [java] at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
      [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
      [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
      [java] NestedThrowablesStackTrace:
      [java] javax.jdo.JDODataStoreException: [JPOX-042007] Error executing JDOQL query "SELECT THIS.DATASTORE_IDENTITY,UNBOUND_E.DATASTORE_IDENTITY,UNBOUND_P.DATASTORE_IDENTITY FROM datastoreidentity0.COMPANIES THIS , datastoreidentity0.PERSONS UNBOUND_E , datastoreidentity0.PROJECTS UNBOUND_P WHERE EXISTS (SELECT 1 FROM datastoreidentity0.DEPARTMENTS THIS_DEPARTMENTS_D WHERE EXISTS (SELECT 1 FROM datastoreidentity0.PERSONS THIS_DEPARTMENTS_D_EMPLOYEES_E WHERE THIS_DEPARTMENTS_D_EMPLOYEES_E.DEPARTMENT = THIS_DEPARTMENTS_D.DATASTORE_IDENTITY AND THIS_DEPARTMENTS_D.COMPANYID = THIS.DATASTORE_IDENTITY AND THIS."NAME" = ?)) AND EXISTS (SELECT 1 FROM datastoreidentity0.PROJECT_MEMBER THIS_DEPARTMENTS_D_EMPLOYEES_E_PROJECTS_P WHERE THIS_DEPARTMENTS_D_EMPLOYEES_E_PROJECTS_P."MEMBER" = THIS_DEPARTMENTS_D_EMPLOYEES_E.DATASTORE_IDENTITY AND UNBOUND_P.DATASTORE_IDENTITY = THIS_DEPARTMENTS_D_EMPLOYEES_E_PROJECTS_P.PROJID)" : Column 'THIS_DEPARTMENTS_D_EMPLOYEES_E.DATASTORE_IDENTITY' 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 'THIS_DEPARTMENTS_D_EMPLOYEES_E.DATASTORE_IDENTITY' is not a column in the target table..

      Attachments

        Issue Links

          Activity

            People

              andyj Andy Jefferson
              clr Craig L Russell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: