From f89bf310b45475f966a640bf8cee4a396f50d1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=B3=E9=AB=98=E5=90=BE=E5=B0=9A?= Date: Wed, 17 Jun 2026 21:16:30 +0800 Subject: [PATCH] fix(mysql): fix garbled Chinese in sidebar table comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply fix_potential_double_encoding() to table/object comment fields returned by list_tables(), list_table_status_show(), and row_to_object(), consistent with the existing fix for column comments (c21b5d0). The sidebar tree displays TABLE_COMMENT directly from these functions, so when MySQL returns Latin1-decoded bytes for UTF-8 content, the comment shows as garbled text like 'OAéƒ¨é—¨åŒæ­¥è¡¨' instead of 'OA部门同步表'. --- crates/dbx-core/src/db/mysql.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rs index 428959072..74e2fc912 100644 --- a/crates/dbx-core/src/db/mysql.rs +++ b/crates/dbx-core/src/db/mysql.rs @@ -992,7 +992,9 @@ pub async fn list_tables(pool: &MySqlPool, database: &str) -> Result Result ObjectInfo { name: get_str_by_name(row, "object_name"), object_type: get_str_by_name(row, "object_type"), schema: Some(database.to_string()), - comment: get_opt_str(row, "object_comment").filter(|s| !s.is_empty()), + comment: get_opt_str(row, "object_comment") + .map(|s| fix_potential_double_encoding(&s)) + .filter(|s| !s.is_empty()), created_at: get_opt_str(row, "created_at"), updated_at: get_opt_str(row, "updated_at"), parent_schema: get_opt_str(row, "parent_schema"),