Skip to content

Commit

Permalink
Support the ON syntax in SHOW TAG VALUES
Browse files Browse the repository at this point in the history
The parser was updated previously in #7295 and the functionality was
supposed to be there, but the wiring in the query engine for that to
happen was never written.
  • Loading branch information
jsternberg committed Nov 1, 2016
1 parent 90ec3ce commit 83e998f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions coordinator/statement_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,11 +857,11 @@ func (e *StatementExecutor) executeShowSubscriptionsStatement(stmt *influxql.Sho
}

func (e *StatementExecutor) executeShowTagValues(q *influxql.ShowTagValuesStatement, ctx *influxql.ExecutionContext) error {
if ctx.Database == "" {
if q.Database == "" {
return ErrDatabaseNameRequired
}

tagValues, err := e.TSDBStore.TagValues(ctx.Database, q.Condition)
tagValues, err := e.TSDBStore.TagValues(q.Database, q.Condition)
if err != nil {
ctx.Results <- &influxql.Result{
StatementID: ctx.StatementID,
Expand Down Expand Up @@ -1089,6 +1089,10 @@ func (e *StatementExecutor) NormalizeStatement(stmt influxql.Statement, defaultD
if node.Database == "" {
node.Database = defaultDatabase
}
case *influxql.ShowTagValuesStatement:
if node.Database == "" {
node.Database = defaultDatabase
}
case *influxql.Measurement:
switch stmt.(type) {
case *influxql.DropSeriesStatement, *influxql.DeleteSeriesStatement:
Expand Down
1 change: 1 addition & 0 deletions influxql/statement_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func rewriteShowTagValuesStatement(stmt *ShowTagValuesStatement) (Statement, err
condition = rewriteSourcesCondition(stmt.Sources, condition)

return &ShowTagValuesStatement{
Database: stmt.Database,
Op: stmt.Op,
TagKeyExpr: stmt.TagKeyExpr,
Condition: condition,
Expand Down

0 comments on commit 83e998f

Please sign in to comment.