Skip to content

Commit

Permalink
Fix type mapping for sqlite SmallInt and Float
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Nov 23, 2021
1 parent bf3ff81 commit a6bcdcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions diesel/src/sqlite/connection/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) => {
Expand Down

0 comments on commit a6bcdcb

Please sign in to comment.