Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-8001

querying for complex types and ordering is failing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5-SNAPSHOT
    • Fix Version/s: 5.5
    • Component/s: Core VCS

      Description

      Cannot execute queries with constraints on complex types and with an ordering clause. The generated SQL statements is not correct. The ordering field is not included in the output fields, but it's required (on PostgreSQL at least) when there's a DISTINCT.

      SELECT * from Document where ecm:isProxy = 0 and content/name = 'testfile.txt' ORDER BY dc:title 
      
      SELECT DISTINCT "HIERARCHY"."ID" AS "_C1"
           FROM "HIERARCHY"
           JOIN "HIERARCHY" "_H1" ON "HIERARCHY"."ID" = "_H1"."PARENTID"
      LEFT JOIN "CONTENT" "_F1" ON "_H1"."ID" = "_F1"."ID"
      LEFT JOIN "DUBLINCORE" "_F2" ON "HIERARCHY"."ID" = "_F2"."ID"
      WHERE "HIERARCHY"."PRIMARYTYPE" IN ('Document', '...')
      AND "_F1"."NAME" = 'testfile.txt'
      AND "_H1"."NAME" = 'content'
      ORDER BY "_F2"."TITLE"
      
      ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: