Fix the subset method on tags

If a point had no tags at all and was asked for the subset of tags with
at least one key, it would return a new set of tags that was completely
empty. In contrast, if the point had any tags at all, it would return a
set of tags with the tag value being an empty string. This lead to
a point with no tags being treated differently than a point with at
least one tag.

Fixing this so the tag value will always be an empty string for
consistency. A missing tag should always be empty.
pull/6283/head
Jonathan A. Sternberg 2016-04-11 11:00:58 -04:00
parent 23e2c40923
commit ca534bf09f
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
- [#6257](https://github.com/influxdata/influxdb/issues/6257): CreateShardGroup was incrementing meta data index even when it was idempotent.
- [#6223](https://github.com/influxdata/influxdb/issues/6223): Failure to start/run on Windows. Thanks @mvadu
- [#6229](https://github.com/influxdata/influxdb/issues/6229): Fixed aggregate queries with no GROUP BY to include the end time.
- [#6283](https://github.com/influxdata/influxdb/pull/6283): Fix GROUP BY tag to produce consistent results when a series has no tags.
## v0.12.0 [2016-04-05]
### Release Notes

View File

@ -89,7 +89,7 @@ func (t *Tags) Value(k string) string {
// Subset returns a new tags object with a subset of the keys.
func (t *Tags) Subset(keys []string) Tags {
if t.m == nil || len(keys) == 0 {
if len(keys) == 0 {
return Tags{}
}