diff --git a/sqlx-core/src/type_checking.rs b/sqlx-core/src/type_checking.rs index 9e9ddb6ac..f10dc79dc 100644 --- a/sqlx-core/src/type_checking.rs +++ b/sqlx-core/src/type_checking.rs @@ -413,7 +413,7 @@ macro_rules! impl_type_checking { $( if <$bigdecimal_ty as sqlx_core::types::Type<$database>>::type_info() == *info { if cfg!(feature = "rust_decimal") { - return Err($crate::type_checking::Error::AmbiguousDateTimeType { + return Err($crate::type_checking::Error::AmbiguousNumericType { fallback: stringify!($bigdecimal_ty), }); } @@ -425,7 +425,7 @@ macro_rules! impl_type_checking { $( if <$bigdecimal_ty as sqlx_core::types::Type<$database>>::compatible(info) { if cfg!(feature = "rust_decimal") { - return Err($crate::type_checking::Error::AmbiguousDateTimeType { + return Err($crate::type_checking::Error::AmbiguousNumericType { fallback: stringify!($bigdecimal_ty), }); } diff --git a/tests/postgres/macros.rs b/tests/postgres/macros.rs index 07ae96201..04c1fe9d1 100644 --- a/tests/postgres/macros.rs +++ b/tests/postgres/macros.rs @@ -295,6 +295,7 @@ async fn query_by_bigdecimal() -> anyhow::Result<()> { let decimal = "1234".parse::()?; let ref tuple = ("51245.121232".parse::()?,); + #[cfg_attr(feature = "rust_decimal", allow(deprecated))] // TODO: upgrade to `expect` let result = sqlx::query!( "SELECT * from (VALUES(1234.0)) decimals(decimal)\ where decimal in ($1, $2, $3, $4, $5, $6, $7)",