1
0
Fork 0

delete views when dropping database

This commit is contained in:
Jan Christoph Uhde 2017-04-04 11:22:22 +02:00
parent 80197fc95e
commit cea5fa8e4f
1 changed files with 4 additions and 10 deletions

View File

@ -719,14 +719,7 @@ Result RocksDBEngine::dropDatabase(TRI_voc_tick_t id) {
rocksdb::WriteOptions options; // TODO: check which options would make sense
// remove views
for (auto& val : indexKVPairs(id)) {
// delete view documents
// uint64_t objectId =
// basics::VelocyPackHelper::stringUInt64(val.second.slice(), "objectId");
// TODO FIXME get elements of views
// RocksDBKeyBounds bounds = RocksDBKeyBounds::DatabaseViewRange(); //really
// res = rocksutils::removeLargeRange(_db, bounds);
// delete view
for (auto& val : viewKVPairs(id)) {
globalRocksDBRemove(val.first.string(), options);
}
@ -735,8 +728,9 @@ Result RocksDBEngine::dropDatabase(TRI_voc_tick_t id) {
// delete index documents
uint64_t objectId =
basics::VelocyPackHelper::stringUInt64(val.second.slice(), "objectId");
VPackSlice min, max; // TODO FIXME
RocksDBKeyBounds bounds = RocksDBKeyBounds::IndexRange(objectId, min, max);
RocksDBKeyBounds bounds = RocksDBKeyBounds::IndexRange(
objectId, VPackSlice::minKeySlice(), VPackSlice::maxKeySlice()
);
res = rocksutils::removeLargeRange(_db, bounds);
// delete index
globalRocksDBRemove(val.first.string(), options);