From 294db6de2de686172ff242ca35b9e7f866afa1ad Mon Sep 17 00:00:00 2001 From: Pavan-Nambi Date: Sat, 20 Sep 2025 12:36:30 +0530 Subject: [PATCH] Prevent sqlite_sequence updates from overwriting last_insert_rowid --- core/vdbe/execute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index be8c94e38..b7c689378 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -5609,7 +5609,7 @@ pub fn op_insert( let cursor = cursor.as_btree_mut(); cursor.root_page() }; - if root_page != 1 { + if root_page != 1 && table_name != "sqlite_sequence"{ state.op_insert_state.sub_state = OpInsertSubState::UpdateLastRowid; } else { let schema = program.connection.schema.borrow();