Merge pull request #6007 from benbjohnson/explicit-system-names
Allow querying of system-like seriespull/6021/head
commit
eb2d49dbe4
|
@ -367,8 +367,19 @@ func (a *Sources) UnmarshalBinary(buf []byte) error {
|
|||
}
|
||||
|
||||
// IsSystemName returns true if name is an internal system name.
|
||||
// System names are prefixed with an underscore.
|
||||
func IsSystemName(name string) bool { return strings.HasPrefix(name, "_") }
|
||||
func IsSystemName(name string) bool {
|
||||
switch name {
|
||||
case "_fieldKeys",
|
||||
"_measurements",
|
||||
"_series",
|
||||
"_tagKey",
|
||||
"_tagKeys",
|
||||
"_tags":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// SortField represents a field to sort results by.
|
||||
type SortField struct {
|
||||
|
|
|
@ -180,7 +180,7 @@ func (d *DatabaseIndex) measurementsByExpr(expr influxql.Expr) (Measurements, bo
|
|||
// Match on name, if specified.
|
||||
if tag.Val == "name" {
|
||||
return d.measurementsByNameFilter(tf.Op, tf.Value, tf.Regex), true, nil
|
||||
} else if strings.HasPrefix(tag.Val, "_") {
|
||||
} else if influxql.IsSystemName(tag.Val) {
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue