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

PQL ~ operator matches empty strings incorrectly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      PE 2018.1.0-rc14

    • Template:
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      It looks like the ~ operator treats an empty string as if it were a pair of double quotes ("").

      Both of the following return one record:

      inventory { certname = 'mycert' and facts.a.b = '' }
      inventory { certname = 'mycert' and facts.a.b ~ '^""$' }
      

      The following returns no records:

      inventory { certname = 'mycert' and facts.a.b ~ '...' }
      

      To be clear, the mycert node has a fact a.b that contains an empty string.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  daniel.parks Daniel Parks
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: