From ea15b1f617cd5b6bed62bdcb8807ce8f9dc31126 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Sat, 10 May 2025 18:20:16 -0300 Subject: [PATCH] extract primary key detection --- core/schema.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/schema.rs b/core/schema.rs index 09915e47f..93b245090 100644 --- a/core/schema.rs +++ b/core/schema.rs @@ -829,7 +829,8 @@ impl Index { // I wanted to just chain the iterator above but Rust type system get's messy with Iterators. // It would not allow me chain them even by using a core::iter::empty() // To circumvent this, I'm having to allocate a second Vec, and extend the other from it. - if table.get_rowid_alias_column().is_none() && !table.primary_key_columns.is_empty() { + let has_primary_key_index = table.get_rowid_alias_column().is_none() && !table.primary_key_columns.is_empty(); + if has_primary_key_index { let (index_name, root_page) = auto_indices.next().expect( "number of auto_indices in schema should be same number of indices calculated", );