Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse fill causes bad query to parse correctly #6543

Closed
jsternberg opened this issue May 3, 2016 · 0 comments
Closed

Parse fill causes bad query to parse correctly #6543

jsternberg opened this issue May 3, 2016 · 0 comments
Milestone

Comments

@jsternberg
Copy link
Contributor

The code used to check for fill(0) gets parsed strangely that allows a query like this to work:

SELECT value FROM cpu value + LIMIT 1

This query shouldn't work, but it currently does work because the parser tries to check for a FILL() call right after the FROM. If it fails to parse the expression (as value + LIMIT is not a valid expression), it will only unread one token rather than all of the tokens used to parse the expression. This means only the LIMIT token gets unread from the token stream and the parser moves on to parse the LIMIT section of the query.

jsternberg added a commit that referenced this issue May 3, 2016
…xpression

The previous parseFill would try to parse an expression and only unscan
one token when it failed. This caused it to not put back the correct
number of tokens with some expression.

Now it has been modified to check for the fill ident ahead of time and
then use ParseExpr() to parse the call. If the expression fails to parse
into a call, it will send an error instead of trying to continue with an
invalid parser state.

Fixes #6543.
jsternberg added a commit that referenced this issue May 10, 2016
…xpression

The previous parseFill would try to parse an expression and only unscan
one token when it failed. This caused it to not put back the correct
number of tokens with some expression.

Now it has been modified to check for the fill ident ahead of time and
then use ParseExpr() to parse the call. If the expression fails to parse
into a call, it will send an error instead of trying to continue with an
invalid parser state.

Fixes #6543.
jsternberg added a commit that referenced this issue Aug 1, 2016
…xpression

The previous parseFill would try to parse an expression and only unscan
one token when it failed. This caused it to not put back the correct
number of tokens with some expression.

Now it has been modified to check for the fill ident ahead of time and
then use ParseExpr() to parse the call. If the expression fails to parse
into a call, it will send an error instead of trying to continue with an
invalid parser state.

Fixes #6543.
@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants