Fix panic at 'SQLite API not initialized or SQLite feature omitted'

`to_sqlite_error` needs `sqlite3_malloc`

```
sqlite> .log on
sqlite> .load target/debug/examples/libloadable_extension.so
Error: error during initialization: SQLite version mismatch: 3014000 < 3042000
```
This commit is contained in:
gwenn
2023-07-14 15:56:43 +02:00
parent c8858bbb68
commit f9d69410ef
5 changed files with 13 additions and 18 deletions

View File

@@ -275,8 +275,6 @@ pub fn code_to_str(code: c_int) -> &'static str {
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum InitError {
/// Invalid sqlite3_api_routines pointer
NullApiPointer,
/// Version mismatch between the extension and the SQLite3 library
VersionMismatch { compile_time: i32, runtime: i32 },
/// Invalid function pointer in one of sqlite3_api_routines fields
@@ -286,9 +284,6 @@ pub enum InitError {
impl ::std::fmt::Display for InitError {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
InitError::NullApiPointer => {
write!(f, "Invalid sqlite3_api_routines pointer")
}
InitError::VersionMismatch {
compile_time,
runtime,