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

Fix NXQL ORDER BY on multiple columns

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3.1
    • Fix Version/s: 5.3.2
    • Component/s: Core VCS

      Description

      Multiple sort criteria are not in the expected order: when sorting by title and then modified date for instance, it's actually sorted first by modified date and then title.

      For instance for NXQL query "SELECT * FROM Document WHERE ecm:parentId = '4aeae62a-543d-4da0-bc9f-c4aefba77a6a' AND ecm:isCheckedInVersion = 0 AND ecm:mixinType != 'HiddenInNavigation' AND ecm:currentLifeCycleState != 'deleted' ORDER BY dc:title , dc:modified", breakpointing in NXQLQueryMaker shows that sort criteria are not in the good order:

      SELECT "_C1" FROM (SELECT "HIERARCHY"."ID" AS "_C1", "DUBLINCORE"."MODIFIED" AS "_C2", "DUBLINCORE"."TITLE" AS "_C3" FROM "HIERARCHY" LEFT JOIN "MISC" ON "HIERARCHY"."ID" = "MISC"."ID" LEFT JOIN "DUBLINCORE" ON "HIERARCHY"."ID" = "DUBLINCORE"."ID" LEFT JOIN "VERSIONS" ON "HIERARCHY"."ID" = "VERSIONS"."ID" WHERE "HIERARCHY"."PRIMARYTYPE" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) AND ("HIERARCHY"."PARENTID" = ?) AND ("VERSIONS"."ID" IS NULL) AND ("MISC"."LIFECYCLESTATE" <> ?) UNION ALL SELECT "_H"."ID" AS "_C1", "DUBLINCORE"."MODIFIED" AS "_C2", "DUBLINCORE"."TITLE" AS "_C3" FROM "HIERARCHY" "_H" JOIN "PROXIES" ON "_H"."ID" = "PROXIES"."ID" JOIN "HIERARCHY" ON "HIERARCHY"."ID" = "PROXIES"."TARGETID" LEFT JOIN "MISC" ON "HIERARCHY"."ID" = "MISC"."ID" LEFT JOIN "DUBLINCORE" ON "HIERARCHY"."ID" = "DUBLINCORE"."ID" LEFT JOIN "VERSIONS" ON "_H"."ID" = "VERSIONS"."ID" WHERE "HIERARCHY"."PRIMARYTYPE" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) AND ("_H"."PARENTID" = ?) AND ("VERSIONS"."ID" IS NULL) AND ("MISC"."LIFECYCLESTATE" <> ?)) ORDER BY "_C2", "_C3"

      (C2 is the modified date and C3 the title)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: