Jira (PDB-3284) PQL operators sometimes whitespace sensitive

6 views
Skip to first unread message

Daniel Parks (JIRA)

unread,
Jan 27, 2017, 7:29:05 PM1/27/17
to puppe...@googlegroups.com
Daniel Parks created an issue
 
PuppetDB / Bug PDB-3284
PQL operators sometimes whitespace sensitive
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2017/01/27 4:28 PM
Environment:

CentOS Linux release 7.3.1611 (Core)
pe-puppetdb-4.2.5-1.el7.noarch

Priority: Normal Normal
Reporter: Daniel Parks

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
=
>
<
<=
>=
~>
~

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Ryan Senior (JIRA)

unread,
Feb 6, 2017, 11:45:03 AM2/6/17
to puppe...@googlegroups.com

Ryan Senior (JIRA)

unread,
Mar 9, 2017, 4:39:12 PM3/9/17
to puppe...@googlegroups.com

Ryan Senior (JIRA)

unread,
Mar 22, 2017, 7:12:02 PM3/22/17
to puppe...@googlegroups.com

Ryan Senior (JIRA)

unread,
Mar 22, 2017, 7:14:12 PM3/22/17
to puppe...@googlegroups.com
Ryan Senior updated an issue
Change By: Ryan Senior
Team: Foundational Features

Wyatt Alt (JIRA)

unread,
Mar 29, 2017, 6:41:02 PM3/29/17
to puppe...@googlegroups.com
Wyatt Alt commented on Bug PDB-3284
 
Re: PQL operators sometimes whitespace sensitive

This issue is specific to dotted notation style queries. The issue is that a parameter can have any name, including one that ends with an equals sign. The only thing I can think to do here is create a list of reserved symbols that require quoting or escaping when used in a field. We'll have to give some thought to the best approach for that.

David Kramer (JIRA)

unread,
Apr 25, 2017, 12:52:02 PM4/25/17
to puppe...@googlegroups.com
David Kramer updated an issue
 
Change By: David Kramer
Sprint: FF 2017-05-17

David Kramer (JIRA)

unread,
May 2, 2017, 1:20:03 PM5/2/17
to puppe...@googlegroups.com

David Kramer (JIRA)

unread,
May 2, 2017, 1:23:04 PM5/2/17
to puppe...@googlegroups.com
David Kramer updated an issue
Change By: David Kramer
Sprint: FF 2017-05-17

David Kramer (JIRA)

unread,
May 2, 2017, 1:23:04 PM5/2/17
to puppe...@googlegroups.com
David Kramer updated an issue
Change By: David Kramer
Team: Foundational Features

Austin Blatt (JIRA)

unread,
Jan 30, 2019, 5:24:05 PM1/30/19
to puppe...@googlegroups.com
Austin Blatt assigned an issue to Austin Blatt
Change By: Austin Blatt
Assignee: Austin Blatt
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Daniel Parks (JIRA)

unread,
Jan 31, 2019, 12:37:05 PM1/31/19
to puppe...@googlegroups.com
Daniel Parks commented on Bug PDB-3284
 
Re: PQL operators sometimes whitespace sensitive

I don't think that = suffixes will be an issue… with a LR(1) parser you should be able to distinguish since facts.endswithequals= "foo" is invalid, facts.endswithequals= = "foo" works.

If you have another fact named “endswithequals” it's exactly the opposite.

So, you should be able to distinguish them.

You're going to have problems with facts with spaces in the name anyway (I think those are allowed).

Even if you couldn't distinguish them, it would be a lot clearer to allow syntax like facts["endswithequals="] or facts.endswithequals\=.

Austin Blatt (JIRA)

unread,
Feb 1, 2019, 10:52:06 AM2/1/19
to puppe...@googlegroups.com
Austin Blatt updated an issue
 
Change By: Austin Blatt
Fix Version/s: PDB 7.0.0

Austin Blatt (JIRA)

unread,
Feb 1, 2019, 10:53:07 AM2/1/19
to puppe...@googlegroups.com
Austin Blatt commented on Bug PDB-3284
 
Re: PQL operators sometimes whitespace sensitive

Since this will be a breaking change, I have added a fix version of 7.0.0 and will put this in the backlog for now.

Robert Roland (JIRA)

unread,
Apr 22, 2019, 4:33:03 PM4/22/19
to puppe...@googlegroups.com
Robert Roland updated an issue
 
Change By: Robert Roland
Labels: maintenance query-engine-improvements

Austin Blatt (JIRA)

unread,
Sep 25, 2019, 7:50:04 PM9/25/19
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Fix Version/s: PDB 7.0.0
Fix Version/s: PDB 6.7.0
Fix Version/s: PDB 6.3.5
Fix Version/s: PDB 5.2.10

Nirupama Mantha (JIRA)

unread,
Sep 26, 2019, 7:36:04 PM9/26/19
to puppe...@googlegroups.com
Nirupama Mantha commented on Bug PDB-3284
 
Re: PQL operators sometimes whitespace sensitive

Austin Blatt Can you update the release notes field for this ticket?

Austin Blatt (JIRA)

unread,
Sep 27, 2019, 5:08:04 PM9/27/19
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Release Notes Summary: 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.
Release Notes: Bug Fix

Heston Hoffman (JIRA)

unread,
Oct 1, 2019, 12:06:03 PM10/1/19
to puppe...@googlegroups.com
Heston Hoffman updated an issue
Change By: Heston Hoffman
Labels: maintenance query-engine-improvements resolved-issue-added
Reply all
Reply to author
Forward
0 new messages