Dynamicer builds (#13074)
Fixes https://github.com/zed-industries/zed/issues/13073 Note that, contrary to the issue's text, we're still shipping a statically bundled sqlite3 after this PR. We use enough new features of sqlite, like `sqlite3_error_offset` and `STRICT`, that our minimum version (v3.38.0) is higher than is presumably accessible on Ubuntu. Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
edca195e3c
commit
fe7d53cb96
9 changed files with 42 additions and 20 deletions
|
@ -128,9 +128,15 @@ impl Connection {
|
|||
&mut remaining_sql_ptr,
|
||||
);
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let offset = sqlite3_error_offset(temp_connection.sqlite3);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let offset = 0;
|
||||
|
||||
(
|
||||
sqlite3_errcode(temp_connection.sqlite3),
|
||||
sqlite3_error_offset(temp_connection.sqlite3),
|
||||
offset,
|
||||
sqlite3_errmsg(temp_connection.sqlite3),
|
||||
Some(temp_connection),
|
||||
)
|
||||
|
@ -142,9 +148,16 @@ impl Connection {
|
|||
&mut raw_statement,
|
||||
&mut remaining_sql_ptr,
|
||||
);
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let offset = sqlite3_error_offset(self.sqlite3);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let offset = 0;
|
||||
|
||||
(
|
||||
sqlite3_errcode(self.sqlite3),
|
||||
sqlite3_error_offset(self.sqlite3),
|
||||
offset,
|
||||
sqlite3_errmsg(self.sqlite3),
|
||||
None,
|
||||
)
|
||||
|
@ -395,6 +408,7 @@ mod test {
|
|||
);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[test]
|
||||
fn test_sql_has_syntax_errors() {
|
||||
let connection = Connection::open_memory(Some("test_sql_has_syntax_errors"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue