mirror of https://gitee.com/bigwinds/arangodb
delete views when dropping database
This commit is contained in:
parent
80197fc95e
commit
cea5fa8e4f
|
@ -719,14 +719,7 @@ Result RocksDBEngine::dropDatabase(TRI_voc_tick_t id) {
|
||||||
rocksdb::WriteOptions options; // TODO: check which options would make sense
|
rocksdb::WriteOptions options; // TODO: check which options would make sense
|
||||||
|
|
||||||
// remove views
|
// remove views
|
||||||
for (auto& val : indexKVPairs(id)) {
|
for (auto& val : viewKVPairs(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
|
|
||||||
globalRocksDBRemove(val.first.string(), options);
|
globalRocksDBRemove(val.first.string(), options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,8 +728,9 @@ Result RocksDBEngine::dropDatabase(TRI_voc_tick_t id) {
|
||||||
// delete index documents
|
// delete index documents
|
||||||
uint64_t objectId =
|
uint64_t objectId =
|
||||||
basics::VelocyPackHelper::stringUInt64(val.second.slice(), "objectId");
|
basics::VelocyPackHelper::stringUInt64(val.second.slice(), "objectId");
|
||||||
VPackSlice min, max; // TODO FIXME
|
RocksDBKeyBounds bounds = RocksDBKeyBounds::IndexRange(
|
||||||
RocksDBKeyBounds bounds = RocksDBKeyBounds::IndexRange(objectId, min, max);
|
objectId, VPackSlice::minKeySlice(), VPackSlice::maxKeySlice()
|
||||||
|
);
|
||||||
res = rocksutils::removeLargeRange(_db, bounds);
|
res = rocksutils::removeLargeRange(_db, bounds);
|
||||||
// delete index
|
// delete index
|
||||||
globalRocksDBRemove(val.first.string(), options);
|
globalRocksDBRemove(val.first.string(), options);
|
||||||
|
|
Loading…
Reference in New Issue