From af1711c313cd511212793b0d0fe4194e18090bdb Mon Sep 17 00:00:00 2001 From: Abdenour Tadjer <134706841+AbdenourTadjer33@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:23:13 +0100 Subject: [PATCH 1/2] fix(mysql): decode DECIMAL and NEWDECIMAL to JSON string --- plugins/sql/src/decode/mysql.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/sql/src/decode/mysql.rs b/plugins/sql/src/decode/mysql.rs index 53fd20c7c4..4e1f6c45cf 100644 --- a/plugins/sql/src/decode/mysql.rs +++ b/plugins/sql/src/decode/mysql.rs @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MIT use serde_json::Value as JsonValue; -use sqlx::{mysql::MySqlValueRef, TypeInfo, Value, ValueRef}; +use sqlx::{mysql::MySqlValueRef, types::BigDecimal, TypeInfo, Value, ValueRef}; use time::{Date, OffsetDateTime, PrimitiveDateTime, Time}; use crate::Error; @@ -28,6 +28,13 @@ pub(crate) fn to_json(v: MySqlValueRef) -> Result { JsonValue::Null } } + "DECIMAL" | "NEWDECIMAL" => { + if let Ok(v) = ValueRef::to_owned(&v).try_decode::() { + JsonValue::String(v.to_string()) + } else { + JsonValue::Null + } + } "DOUBLE" => { if let Ok(v) = ValueRef::to_owned(&v).try_decode::() { JsonValue::from(v) From 75f4660b823c664f91b3e37793a8e8536f8d86a4 Mon Sep 17 00:00:00 2001 From: Abdenour Tadjer <134706841+AbdenourTadjer33@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:26:32 +0100 Subject: [PATCH 2/2] fix(sql): enable bigdecimal feature for MySQL decimal decoding --- plugins/sql/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index e1a5feefcf..e39ba0af3c 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -29,7 +29,7 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } futures-core = "0.3" -sqlx = { version = "0.8", features = ["json", "time", "uuid"] } +sqlx = { version = "0.8", features = ["json", "time", "uuid", "bigdecimal"] } time = "0.3" tokio = { version = "1", features = ["sync"] } indexmap = { version = "2", features = ["serde"] }