SHOW STATS_BUCKETS lower bound upper bound string type displayed as two-byte Unicode format

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: SHOW STATS_BUCKETS lower bound upper bound字符串类型展示为两个字节的unicode的格式

| username: TiDBer_20QjYTLl

【TiDB Usage Environment】Production Environment / Testing / Poc
【TiDB Version】v6.1.0
【Reproduction Path】
The data in the tidb database is synchronized from MySQL through dm in all mode.
【Encountered Problem: Problem Phenomenon and Impact】
When executing SHOW STATS_BUCKETS, it is found that if the lower bound and upper bound fields are of string type, they are not displayed as the original string, but in double-byte Unicode format. Please see the attached screenshot for specific display conditions.
【Resource Configuration】
【Attachment: Screenshot/Log/Monitoring】

| username: tidb菜鸟一只 | Original post link

What are the character set formats of the corresponding fields on the source and target ends?

| username: TiDBer_20QjYTLl | Original post link

Both are utf8mb4, and the data in the table is normal, but the data in the stats_buckets table is abnormal.

| username: xingzhenxiang | Original post link

Try using the shell tool to execute it.

| username: wuxiangdong | Original post link

How about adding a cast function?

| username: TiDBer_20QjYTLl | Original post link

The key point is that I set up a new TiDB environment myself and used the same tool to query, but did not encounter this issue. When the sync_diff_inspector tool performs data comparison, it queries this table, which causes anomalies in the data comparison.