From a6bcdcbc03b818a30e22da0a58e8bc84d512bad7 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Tue, 23 Nov 2021 18:30:16 +0100 Subject: [PATCH] Fix type mapping for sqlite SmallInt and Float --- diesel/src/sqlite/connection/stmt.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/diesel/src/sqlite/connection/stmt.rs b/diesel/src/sqlite/connection/stmt.rs index 9d2f3b803b16..2cdcf3dda08f 100644 --- a/diesel/src/sqlite/connection/stmt.rs +++ b/diesel/src/sqlite/connection/stmt.rs @@ -93,12 +93,14 @@ impl Statement { bytes.len() as libc::c_int, ffi::SQLITE_STATIC(), ), - (SqliteType::Double, SqliteBindValue::F64(value)) => ffi::sqlite3_bind_double( + (SqliteType::Float, SqliteBindValue::F64(value)) + | (SqliteType::Double, SqliteBindValue::F64(value)) => ffi::sqlite3_bind_double( self.inner_statement.as_ptr(), bind_index, *value as libc::c_double, ), - (SqliteType::Integer, SqliteBindValue::I32(value)) => { + (SqliteType::SmallInt, SqliteBindValue::I32(value)) + | (SqliteType::Integer, SqliteBindValue::I32(value)) => { ffi::sqlite3_bind_int(self.inner_statement.as_ptr(), bind_index, *value) } (SqliteType::Long, SqliteBindValue::I64(value)) => {