From 8e338d3e7aee619f331ff334437c3d65c66dcbdf Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 17 Jul 2025 13:40:54 +0300 Subject: [PATCH] core/vdbe: Fix SetCookie when MVCC is enabled --- core/vdbe/execute.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index b00313225..39038a010 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -5882,15 +5882,16 @@ pub fn op_set_cookie( header_accessor::set_incremental_vacuum_enabled(pager, *value as u32)?; } Cookie::SchemaVersion => { - // we update transaction state to indicate that the schema has changed - match program.connection.transaction_state.get() { - TransactionState::Write { schema_did_change } => { - program.connection.transaction_state.set(TransactionState::Write { schema_did_change: true }); - }, - TransactionState::Read => unreachable!("invalid transaction state for SetCookie: TransactionState::Read, should be write"), - TransactionState::None => unreachable!("invalid transaction state for SetCookie: TransactionState::None, should be write"), + if mv_store.is_none() { + // we update transaction state to indicate that the schema has changed + match program.connection.transaction_state.get() { + TransactionState::Write { schema_did_change } => { + program.connection.transaction_state.set(TransactionState::Write { schema_did_change: true }); + }, + TransactionState::Read => unreachable!("invalid transaction state for SetCookie: TransactionState::Read, should be write"), + TransactionState::None => unreachable!("invalid transaction state for SetCookie: TransactionState::None, should be write"), + } } - program .connection .with_schema_mut(|schema| schema.schema_version = *value as u32);