Ensure all index data is removed when defining an index

This commit is contained in:
Tobie Morgan Hitchcock 2022-03-20 14:27:03 +00:00
parent cb740dfcb0
commit 9778600304

View file

@ -973,7 +973,7 @@ impl DefineIndexStatement {
run.add_tb(opt.ns(), opt.db(), &self.what).await?;
run.set(key, self).await?;
// Remove the index data
let key = crate::key::index::new(opt.ns(), opt.db(), &self.what, &self.name, Value::None);
let key = crate::key::guide::new(opt.ns(), opt.db(), &self.what, &self.name);
run.delp(key, u32::MAX).await?;
// Release the transaction
drop(run);