Fixed an overflow with a negative scale

This commit is contained in:
Julius de Bruijn
2020-07-04 13:02:16 +02:00
committed by Austin Bonander
parent 245d53e484
commit f246d41aed
3 changed files with 12 additions and 7 deletions

View File

@@ -343,8 +343,7 @@ test_type!(bigdecimal<sqlx::types::BigDecimal>(Postgres,
test_type!(decimal<sqlx::types::Decimal>(Postgres,
"0::numeric" == sqlx::types::Decimal::from_str("0").unwrap(),
"1::numeric" == sqlx::types::Decimal::from_str("1").unwrap(),
// bug in rust_decimal: https://github.com/paupino/rust-decimal/issues/251
//"10000::numeric" == sqlx::types::Decimal::from_str("10000").unwrap(),
"10000::numeric" == sqlx::types::Decimal::from_str("10000").unwrap(),
"0.1::numeric" == sqlx::types::Decimal::from_str("0.1").unwrap(),
"0.01234::numeric" == sqlx::types::Decimal::from_str("0.01234").unwrap(),
"12.34::numeric" == sqlx::types::Decimal::from_str("12.34").unwrap(),