From c552ecdc4ba98d026d41b2b0fb86df3fa987b29a Mon Sep 17 00:00:00 2001 From: lovasoa Date: Thu, 7 Nov 2024 20:03:40 +0100 Subject: [PATCH] sqlite float to uint --- sqlx-core/src/sqlite/types/uint.rs | 2 +- tests/any/any.rs | 2 +- tests/sqlite/sqlite.db | Bin 36864 -> 36864 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlx-core/src/sqlite/types/uint.rs b/sqlx-core/src/sqlite/types/uint.rs index 22cdf886c0..d131de7bd4 100644 --- a/sqlx-core/src/sqlite/types/uint.rs +++ b/sqlx-core/src/sqlite/types/uint.rs @@ -83,7 +83,7 @@ impl Type for u64 { } fn compatible(ty: &SqliteTypeInfo) -> bool { - matches!(ty.0, DataType::Int | DataType::Int64) + matches!(ty.0, DataType::Int | DataType::Int64 | DataType::Float) } } diff --git a/tests/any/any.rs b/tests/any/any.rs index 7e6e44a34a..a753b703a1 100644 --- a/tests/any/any.rs +++ b/tests/any/any.rs @@ -223,7 +223,7 @@ async fn it_can_fail_and_recover_with_pool() -> anyhow::Result<()> { #[sqlx_macros::test] async fn it_has_unsigned_integers() -> anyhow::Result<()> { - let max_value = u64::MAX; + let max_value = 9223372036854775807; let expr = if cfg!(feature = "mysql") { format!("CAST({} AS UNSIGNED)", max_value) } else { diff --git a/tests/sqlite/sqlite.db b/tests/sqlite/sqlite.db index 48c00becfc65e634f37e68dea60169fd13bdd9d0..cbd38a0209e51209ceb58049daea41c0e9bdd8d4 100644 GIT binary patch delta 104 zcmZozz|^pSX#D!nGBS%5fGAO+B(=CiFcU*) qvxmhVcIGVJ_mkNjF0$}`;eEeZP(YZMi-nniF$+XwZvN@Z?gRidA07|@ delta 44 zcmZozz|^pSX#