From 9b93ac777c8494ec5731a56cb36ca0209d4cecc3 Mon Sep 17 00:00:00 2001 From: zipg Date: Tue, 30 Jun 2026 17:40:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20MySQL=20=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=B3=A8=E9=87=8A=E5=9B=9E=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/dbx-core/src/db/mysql.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rs index ee53c40d9..33cef9df2 100644 --- a/crates/dbx-core/src/db/mysql.rs +++ b/crates/dbx-core/src/db/mysql.rs @@ -2594,7 +2594,7 @@ pub async fn list_indexes(pool: &MySqlPool, database: &str, table: &str) -> Resu let sql = format!( "SELECT INDEX_NAME, GROUP_CONCAT(COLUMN_NAME ORDER BY SEQ_IN_INDEX) AS columns, \ MIN(NON_UNIQUE) = 0 AS is_unique, INDEX_NAME = 'PRIMARY' AS is_primary, \ - INDEX_TYPE \ + INDEX_TYPE, MAX(NULLIF(INDEX_COMMENT, '')) AS INDEX_COMMENT \ FROM information_schema.STATISTICS \ WHERE TABLE_SCHEMA = {} AND TABLE_NAME = {} \ GROUP BY INDEX_NAME, INDEX_TYPE \ @@ -2618,7 +2618,7 @@ pub async fn list_indexes(pool: &MySqlPool, database: &str, table: &str) -> Resu filter: None, index_type: Some(get_str_by_name(row, "INDEX_TYPE")), included_columns: None, - comment: None, + comment: get_opt_str(row, "INDEX_COMMENT").filter(|value| !value.is_empty()), } }) .collect())