Skip to content

Commit

Permalink
Fix SHOW TAG VALUES condition to not filter "name" erroneously
Browse files Browse the repository at this point in the history
Before #6038 was merged, we needed to filter "name" so that it didn't
accidentally hit the code path that used "name" to check the name of a
measurement. This was changed to "_name" to avoid a conflict with a
legitimate tag that used "name" as the key.

SHOW TAG VALUES was never modified to remove the code that filtered out
"name". This removes that line of code so a condition with "name"
doesn't get removed erroneously.

Example:

    SHOW TAG VALUES WITH KEY = host WHERE "name" = 'jsternberg'

Fixes #6581.
  • Loading branch information
jsternberg committed May 9, 2016
1 parent 4748bb1 commit 3f4072b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ func NewTagValuesIterator(sh *Shard, opt influxql.IteratorOptions) (influxql.Ite
switch e.Op {
case influxql.EQ, influxql.NEQ, influxql.EQREGEX, influxql.NEQREGEX:
tag, ok := e.LHS.(*influxql.VarRef)
if !ok || tag.Val == "name" || strings.HasPrefix(tag.Val, "_") {
if !ok || strings.HasPrefix(tag.Val, "_") {
return nil
}
}
Expand Down

0 comments on commit 3f4072b

Please sign in to comment.