diff --git a/cmd/influxd/server_integration_test.go b/cmd/influxd/server_integration_test.go index 8182f7c80db..d737c33b8a0 100644 --- a/cmd/influxd/server_integration_test.go +++ b/cmd/influxd/server_integration_test.go @@ -350,6 +350,11 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent query: `select event from "%DB%"."%RP%".logs where event = 'nonsense'`, expected: `{"results":[{}]}`, }, + { + name: "missing measurement with `GROUP BY *`", + query: `select load from "%DB%"."%RP%".missing group by *`, + expected: `{"results":[{"error":"measurement not found: \"mydb\".\"myrp\".\"missing\""}]}`, + }, // Metadata display tests diff --git a/server.go b/server.go index cddf0bdd71c..4abf9c67287 100644 --- a/server.go +++ b/server.go @@ -1576,7 +1576,7 @@ func (s *Server) applyCreateMeasurementsIfNotExists(m *messaging.Message) error // Create each new field. mm := db.measurements[cm.Name] if mm == nil { - panic(fmt.Sprintf("Measurement %s does not exist", cm.Name)) + panic(fmt.Sprintf("measurement not found: %s", cm.Name)) } for _, f := range cm.Fields { if err := mm.createFieldIfNotExists(f.Name, f.Type); err != nil { @@ -1873,7 +1873,7 @@ func (s *Server) rewriteSelectStatement(stmt *influxql.SelectStatement) (*influx mm := s.databases[db].measurements[m] if mm == nil { - return nil, fmt.Errorf("measurement %s does not exist.", measurement.Name) + return nil, fmt.Errorf("measurement not found: %s", measurement.Name) } for _, f := range mm.Fields { diff --git a/server_test.go b/server_test.go index 0c7b6c5d02d..d11d38fb713 100644 --- a/server_test.go +++ b/server_test.go @@ -1035,7 +1035,7 @@ func TestServer_DropMeasurementSeriesTagsPreserved(t *testing.T) { } results = s.ExecuteQuery(MustParseQuery(`SELECT * FROM cpu`), "foo", nil) - if res := results.Results[0]; res.Err.Error() != `measurement "foo"."raw"."cpu" does not exist.` { + if res := results.Results[0]; res.Err.Error() != `measurement not found: "foo"."raw"."cpu"` { t.Fatalf("unexpected error: %s", res.Err) } else if len(res.Series) != 0 { t.Fatalf("unexpected row count: %d", len(res.Series))