Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-2474

PQL: explicit subqueries using fact 'value' doesn't join all types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDB 4.0.2
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      2
    • Sprint:
      PuppetDB 2016-03-09, PuppetDB 2016-03-23, PuppetDB 2016-04-06

      Description

      I think this is an AST bug rather then PQL, but the join semantics below don't match all types.

      So dumb things like:

      # curl -X GET 'http://localhost:8080/pdb/query/v4?pretty=true' \
        --data-urlencode 'query=facts { [name, value] in facts[name, value]
      { value = false } }'
      [ {
        "certname" : "macbook-pro-7.corp.puppetlabs.net",
        "environment" : "production",
        "name" : "is_pe",
        "value" : false
      }, {
        "certname" : "macbook-pro-7.corp.puppetlabs.net",
        "environment" : "production",
        "name" : "is_virtual",
        "value" : false
      } ]%
      

      Work nows with https://github.com/puppetlabs/puppetdb/pull/1866, but when you specify a join on any other type, it doesn't
      work, point in case:

      # curl -X GET 'http://localhost:8080/pdb/query/v4?pretty=true' \
        --data-urlencode 'query=facts { [name, value] in facts[name, value] { } }'
      [ {
        "certname" : "macbook-pro-7.corp.puppetlabs.net",
        "environment" : "production",
        "name" : "is_pe",
        "value" : false
      }, {
        "certname" : "macbook-pro-7.corp.puppetlabs.net",
        "environment" : "production",
        "name" : "swapencrypted",
        "value" : true
      }, {
        "certname" : "macbook-pro-7.corp.puppetlabs.net",
        "environment" : "production",
        "name" : "clientnoop",
        "value" : true
      }, {
        "certname" : "macbook-pro-7.corp.puppetlabs.net",
        "environment" : "production",
        "name" : "is_virtual",
        "value" : false
      } ]%
      

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                ken Ken Barber
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: