From f8af23a19ec02d09fb804061e2e8abe6f8a26abf Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Fri, 20 Jan 2023 18:19:33 +0800 Subject: [PATCH] disallow destroying relations with indices --- cozo-core/src/runtime/relation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cozo-core/src/runtime/relation.rs b/cozo-core/src/runtime/relation.rs index 6e6282ec..b1140b84 100644 --- a/cozo-core/src/runtime/relation.rs +++ b/cozo-core/src/runtime/relation.rs @@ -584,7 +584,7 @@ impl<'a> SessionTx<'a> { bail!("Cannot destroy temp relation"); } let store = self.get_relation(name, true)?; - if !stored.indices.is_empty() { + if !store.indices.is_empty() { bail!("Cannot remove stored relation `{}` with indices attached.", name); } if store.access_level < AccessLevel::Normal {