On DROP DATABASE remove from TSDB index
parent
371a17b6b8
commit
01700f79b0
|
@ -279,10 +279,11 @@ func (q *QueryExecutor) expandWildcards(stmt *influxql.SelectStatement) (*influx
|
|||
// Iterate measurements in the FROM clause getting the fields & dimensions for each.
|
||||
for _, src := range stmt.Sources {
|
||||
if m, ok := src.(*influxql.Measurement); ok {
|
||||
// Lookup the database.
|
||||
// Lookup the database. The database may not exist if no data for this database
|
||||
// was ever written to the shard.
|
||||
db := q.store.DatabaseIndex(m.Database)
|
||||
if db == nil {
|
||||
return nil, nil
|
||||
return stmt, nil
|
||||
}
|
||||
|
||||
// Lookup the measurement in the database.
|
||||
|
|
|
@ -103,7 +103,11 @@ func (s *Store) DeleteDatabase(name string, shardIDs []uint64) error {
|
|||
shard.Close()
|
||||
}
|
||||
}
|
||||
return os.RemoveAll(s.path)
|
||||
if err := os.RemoveAll(s.path); err != nil {
|
||||
return err
|
||||
}
|
||||
delete(s.databaseIndexes, name)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Store) Shard(shardID uint64) *Shard {
|
||||
|
|
Loading…
Reference in New Issue