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

PQL operators sometimes whitespace sensitive

    XMLWordPrintable

Details

    • Hide

      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content= "a"}'
      []
      

      Show
      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \ -d 'query=resources { parameters.content= "a"}' []
    • PuppetDB
    • 2
    • Bug Fix
    • Hide
      PQL previously required a space to terminate a dotted field like `facts.os.family`. As a result, the query `inventory[]{ facts.os.family="Debian" }` would fail because the `=` operator was parsed as part of the dotted field. This space is no longer required and the inventory query example is a valid PQL query.
      Show
      PQL previously required a space to terminate a dotted field like `facts.os.family`. As a result, the query `inventory[]{ facts.os.family="Debian" }` would fail because the `=` operator was parsed as part of the dotted field. This space is no longer required and the inventory query example is a valid PQL query.
    • Needs Assessment

    Description

      When querying resources whitespace is required before the comparison operator on parameters. This is not true when using the comparison operator on, say, type.

      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content = "a"}'
      []
      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content ="a"}'
      []
      ❯ curl -sSXGET 'http://localhost:8080/pdb/query/v4' \
          -d 'query=resources { parameters.content= "a"}'
      PQL parse error at line 1, column 33:
       
      resources { parameters.content= "a"}
                                      ^
       
      Expected one of:
       
      is not null
      is null
      in
      =
      >
      <
      <=
      >=
      ~>
      ~
      

      Attachments

        Issue Links

          Activity

            People

              austin.blatt Austin Blatt
              daniel.parks Daniel Parks
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support