From a0310bd007ed60f56ce6fd2b3401d8a444f43217 Mon Sep 17 00:00:00 2001 From: BohuTANG Date: Sun, 17 Mar 2024 22:23:59 +0800 Subject: [PATCH] make the settings table range column no more than 64 bytes --- src/query/storages/system/src/settings_table.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/query/storages/system/src/settings_table.rs b/src/query/storages/system/src/settings_table.rs index 44672258d282..f4b17da579d3 100644 --- a/src/query/storages/system/src/settings_table.rs +++ b/src/query/storages/system/src/settings_table.rs @@ -65,7 +65,16 @@ impl SyncSystemTable for SettingsTable { // Range Value. match item.range { - Some(range) => ranges.push(format!("{}", range)), + Some(range) => { + // If the string range is larger than 64, we only show the first 64 characters and add "...". + let range_str = format!("{}", range); + let suffix = if range_str.len() > 64 { "..." } else { "" }; + ranges.push(format!( + "{}{}", + range_str.chars().take(64).collect::(), + suffix + )); + } None => ranges.push("None".to_string()), }