From 68b82f30301c8629094b36d50f47b9b6b5cf5c36 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Mon, 10 Aug 2015 14:59:26 -0600 Subject: [PATCH] Fix regex queries regression ValidateGroupBy was returning an error if a tag does not exist but it appears that function was supposed to be validating that a field name was not used as a group by field. Fixes #3326 --- CHANGELOG.md | 1 + tsdb/meta.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af677e6f9..7265bb11a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - [#3401](https://github.com/influxdb/influxdb/issues/3401): Derivative on non-numeric fields panics db - [#3583](https://github.com/influxdb/influxdb/issues/3583): Inserting value in scientific notation with a trailing i causes panic - [#3611](https://github.com/influxdb/influxdb/pull/3611): Fix query arithmetic with integers +- [#3326](https://github.com/influxdb/influxdb/issues/3326): simple regex query fails with cryptic error ## v0.9.2 [2015-07-24] diff --git a/tsdb/meta.go b/tsdb/meta.go index 6ef4cb009a..217dd2d95e 100644 --- a/tsdb/meta.go +++ b/tsdb/meta.go @@ -349,7 +349,7 @@ func (m *Measurement) ValidateGroupBy(stmt *influxql.SelectStatement) error { for _, d := range stmt.Dimensions { switch e := d.Expr.(type) { case *influxql.VarRef: - if !m.HasTagKey(e.Val) { + if m.HasField(e.Val) { return fmt.Errorf("can not use field in GROUP BY clause: %s", e.Val) } }