Fix decimal deserialisation (#2687)

This commit is contained in:
Rushmore Mushambi 2023-09-12 15:34:58 +01:00 committed by GitHub
parent 5446666e7d
commit 3c48558ca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -96,7 +96,7 @@ reqwest = { version = "0.11.18", default-features = false, features = ["json", "
revision = "0.5.0"
roaring = { version = "0.10.2", features = ["serde"] }
rocksdb = { version = "0.21.0", optional = true }
rust_decimal = { version = "1.31.0", features = ["maths"] }
rust_decimal = { version = "1.31.0", features = ["maths", "serde-str"] }
rust-stemmers = "1.2.0"
rustls = { version = "0.20.8", optional = true }
scrypt = "0.11.0"

View file

@ -191,6 +191,18 @@ async fn query() {
assert_eq!(name, "John Doe");
}
#[tokio::test]
async fn query_decimals() {
let db = new_db().await;
db.use_ns(NS).use_db(Ulid::new().to_string()).await.unwrap();
let sql = "
DEFINE TABLE foo;
DEFINE FIELD bar ON foo TYPE decimal;
CREATE foo CONTENT { bar: 42.69 };
";
let _ = db.query(sql).await.unwrap().check().unwrap();
}
#[tokio::test]
async fn query_binds() {
let db = new_db().await;