diff --git a/src/location.rs b/src/location.rs index 81a23a5886..b505e042e5 100644 --- a/src/location.rs +++ b/src/location.rs @@ -707,9 +707,6 @@ pub(crate) async fn save( ))?; if timestamp > newest_timestamp { - // okay to drop, as we use cached prepared statements - drop(stmt_test); - drop(stmt_insert); newest_timestamp = timestamp; newest_location_id = Some(u32::try_from(conn.last_insert_rowid())?); } diff --git a/src/message.rs b/src/message.rs index f7467b009d..1416d40cc8 100644 --- a/src/message.rs +++ b/src/message.rs @@ -1613,7 +1613,7 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> { modified_chat_ids.insert(msg.chat_id); let target = context.get_delete_msgs_target().await?; - let update_db = |conn: &mut rusqlite::Connection| { + let update_db = |conn: &mut rusqlite::Transaction| { conn.execute( "UPDATE imap SET target=? WHERE rfc724_mid=?", (target, msg.rfc724_mid), @@ -1621,7 +1621,7 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> { conn.execute("DELETE FROM smtp WHERE msg_id=?", (msg_id,))?; Ok(()) }; - if let Err(e) = context.sql.call_write(update_db).await { + if let Err(e) = context.sql.transaction(update_db).await { error!(context, "delete_msgs: failed to update db: {e:#}."); res = Err(e); continue;