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

Panic using incorrectly quoted "queries" field key #6248

Closed
dougreese opened this issue Apr 7, 2016 · 0 comments · Fixed by #6255
Closed

Panic using incorrectly quoted "queries" field key #6248

dougreese opened this issue Apr 7, 2016 · 0 comments · Fixed by #6255
Assignees
Milestone

Comments

@dougreese
Copy link

Bug report

System info:

  • Version 0.12.0, branch 0.12, commit 4f29ba4
  • Ubuntu 14.04.4 LTS

Steps to reproduce:

  1. Using Telegraf MySQL input plugin
  2. Using CLI
  3. Attempt to display data based on the queries field key
  4. Screw up quotes on the query: SELECT 'queries', slow_queries FROM ...

Expected behavior:

Error because I should have used "queries" rather than 'queries'

Actual behavior:

[query] 2016/04/06 17:30:56 SELECT 'queries', slow_queries FROM telegraf."default".mysql WHERE time > now() - 1m
panic: unreachable

goroutine 127621 [running]:
github.com/influxdata/influxdb/influxql.buildAuxIterators(0xc21c8af8e0, 0x2, 0x2, 0x7f2401d879e8, 0xc20d1cbc60, 0x0, 0x0, 0xc21d9d7ba0, 0x1, 0x1, ...)
        /tmp/influxdb/src/github.com/influxdata/influxdb/influxql/select.go:125 +0x92f
github.com/influxdata/influxdb/influxql.Select(0xc20d1c4a90, 0x7f2401d879e8, 0xc20d1cbc60, 0xc20edb9b40, 0x0, 0x0, 0x0, 0x0, 0x0)
        /tmp/influxdb/src/github.com/influxdata/influxdb/influxql/select.go:49 +0x508
github.com/influxdata/influxdb/cluster.(*QueryExecutor).executeSelectStatement(0xc208072120, 0xc20d1c4a90, 0x2710, 0x0, 0x4614, 0xc213b8c0c0, 0xc21d9d4480, 0x0, 0x0)
        /tmp/influxdb/src/github.com/influxdata/influxdb/cluster/query_executor.go:500 +0x9c5
github.com/influxdata/influxdb/cluster.(*QueryExecutor).executeQuery(0xc208072120, 0xc217d46240, 0xc21c8a049b, 0x8, 0x2710, 0xc21d9d4480, 0xc213b8c0c0)
        /tmp/influxdb/src/github.com/influxdata/influxdb/cluster/query_executor.go:146 +0x9c0
created by github.com/influxdata/influxdb/cluster.(*QueryExecutor).ExecuteQuery
        /tmp/influxdb/src/github.com/influxdata/influxdb/cluster/query_executor.go:80 +0x8c

Additional info:

Using unquoted queries properly returns an error:

select queries, slow_queries from mysql where time > now() - 1m
ERR: error parsing query: found QUERIES, expected identifier, string, number, bool at line 1, char 8

Using double quoted "queries" returns valid data.

@jsternberg jsternberg self-assigned this Apr 7, 2016
@jsternberg jsternberg added this to the 0.12.1 milestone Apr 7, 2016
jsternberg added a commit that referenced this issue Apr 7, 2016
The following query was fixed previously:

    SELECT 'value' FROM cpu

This ended up hitting the `buildExprIterator()` code path and was
handled properly. But this query:

    SELECT 'value', value FROM cpu

This took a different code path that would trigger a panic because it
triggered a panic instead of an error condition. This code path has now
been modified to trigger an error instead of a panic.

Fixes #6248.
jsternberg added a commit that referenced this issue Apr 7, 2016
The following query was fixed previously:

    SELECT 'value' FROM cpu

This ended up hitting the `buildExprIterator()` code path and was
handled properly. But this query:

    SELECT 'value', value FROM cpu

This took a different code path that would trigger a panic because it
triggered a panic instead of an error condition. This code path has now
been modified to trigger an error instead of a panic.

Fixes #6248.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants