Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix a rare crash on startup (#19922)
Mikayla Makif3b7f5944d9a
diff --git a/crates/sqlez/src/statement.rs b/crates/sqlez/src/statement.rsindex 462f902239f..f1d89919ece 100644--- a/crates/sqlez/src/statement.rs+++ b/crates/sqlez/src/statement.rs@@ -58,13 +58,13 @@ impl<'a> Statement<'a> {&mut remaining_sql_ptr,);- remaining_sql = CStr::from_ptr(remaining_sql_ptr);- statement.raw_statements.push(raw_statement);-connection.last_error().with_context(|| {format!("Prepare call failed for query:\n{}", query.as_ref())})?;+ remaining_sql = CStr::from_ptr(remaining_sql_ptr);+ statement.raw_statements.push(raw_statement);+if !connection.can_write() && sqlite3_stmt_readonly(raw_statement) == 0 {let sql = CStr::from_ptr(sqlite3_sql(raw_statement));