Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-9709

Artifactory AQL can produce bad queries for MSSQL databases

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.4.3, 4.6.1
    • Fix Version/s: 4.8.0
    • Component/s: AQL
    • Labels:
      None

      Description

      Artifactory AQL can produce bad queries for MSSQL databases. The issue happens with certain queries which produce order by with duplicate entries. The result is an error and a failed AQL query.

      The error is:

      Failed to execute the following sql querySqlQuery
      ...
      order by ap.path_id ASC,an.name_id ASC,an.name_id ASC,ap.path_id ASC ', params=[aql-test-repo, subfolder1, %.txt]}
      cause: A column has been specified more than once in the order by list. Columns in the order by list must be unique.
      

      There is a Microsoft article https://support.microsoft.com/en-us/kb/890771 that described this error as intended behavior caused by a user error (bad query).

      To reproduce, run an AQL query like this:

      curl -k -X POST -u admin:password -H "Content-Type: text/plain" --data @test.aql <artifactory-url-and-port>/artifactory/api/search/aql

      test.aql

      archive.entries.find({
        "archive.item.repo": {
          "$match": "aql-test-repo"
        }
      ,
        "archive.item.path": {
          "$match": "subfolder1"
        }
      ,
        "archive.entry.name": {
          "$match": "*.txt"
        }
      }).include("archive.entry.*","archive.item.*")
      

        Attachments

          Activity

            People

            • Assignee:
              gidis Gidi Shabat
              Reporter:
              arturoa Arturo Aparicio
              Assigned QA:
              Yogev Abergel (Inactive)
            • Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: