mysql.tidb_ttl_task乱码

【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
查看tidb_ttl_task表

mysql> select * from tidb_ttl_task;
+--------------------------------------+----------+---------+------------------+----------------+---------------------+--------------------------------------+------------+---------------------+----------+---------------------+-----------------------------------------------------------------------------+---------------------+
| job_id                               | table_id | scan_id | scan_range_start | scan_range_end | expire_time         | owner_id                             | owner_addr | owner_hb_time       | status   | status_update_time  | state                                                                       | created_time        |
+--------------------------------------+----------+---------+------------------+----------------+---------------------+--------------------------------------+------------+---------------------+----------+---------------------+-----------------------------------------------------------------------------+---------------------+
| 41225aee-77a1-4f7e-aab6-0e98884b0595 |      224 |       0 | �                |                | 2024-06-18 11:55:26 | 48fb76ff-fe56-4ebb-be69-9268184590e5 | NULL       | 2024-06-25 11:55:30 | finished | 2024-06-25 11:55:35 | {"total_rows":0,"success_rows":0,"error_rows":0,"scan_task_err":""}         | 2024-06-25 11:55:27 |
| 41225aee-77a1-4f7e-aab6-0e98884b0595 |      224 |       1 |                  |     �w       | 2024-06-18 11:55:26 | 48fb76ff-fe56-4ebb-be69-9268184590e5 | NULL       | 2024-06-25 11:55:30 | finished | 2024-06-25 11:55:35 | {"total_rows":0,"success_rows":0,"error_rows":0,"scan_task_err":""}         | 2024-06-25 11:55:27 |
| 41225aee-77a1-4f7e-aab6-0e98884b0595 |      224 |       2 |     �w         |     E��        | 2024-06-18 11:55:26 | 48fb76ff-fe56-4ebb-be69-9268184590e5 | NULL       | 2024-06-25 11:55:30 | finished | 2024-06-25 11:55:35 | {"total_rows":0,"success_rows":0,"error_rows":0,"scan_task_err":""}         | 2024-06-25 11:55:27 |
| 41225aee-77a1-4f7e-aab6-0e98884b0595 |      224 |       3 |     E��          |     I�Z       | 2024-06-18 11:55:26 | 9a87b082-b8d6-4aac-93ba-d996da7a53b4 | NULL       | 2024-06-25 11:56:15 | finished | 2024-06-25 11:56:15 | {"total_rows":0,"success_rows":0,"error_rows":0,"scan_task_err":""}         | 2024-06-25 11:55:27 |
| 41225aee-77a1-4f7e-aab6-0e98884b0595 |      224 |       4 |     I�Z         |     M�$       | 2024-06-18 11:55:26 | 9a87b082-b8d6-4aac-93ba-d996da7a53b4 | NULL       | 2024-06-25 11:56:15 | finished | 2024-06-25 11:56:15 | {"total_rows":0,"success_rows":0,"error_rows":0,"scan_task_err":""}         | 2024-06-25 11:55:27 |
| 41225aee-77a1-4f7e-aab6-0e98884b0595 |      224 |       5 |     M�$         |     Q��        | 2024-06-18 11:55:26 | 9a87b082-b8d6-4aac-93ba-d996da7a53b4 | NULL       | 2024-06-25 11:56:15 | finished | 2024-06-25 11:56:15 | {"total_rows":0,"success_rows":0,"error_rows":0,"scan_task_err":""}         | 2024-06-25 11:55:27
\s
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb4
Conn.  characterset:	utf8mb4

:thinking:会不会是原表里有乱码?

在官方文档上没找到,这个字段记录的是啥信息

可能是存入的时候就是乱码,就是客户端那里出现了转码导致的乱码

:thinking:字面意思应该是扫描区间吧。

有没有可能是ttl job对应的表建表时候用的字符集不对(不是UTF8MB4)?

有这个可能,我看看

所有的varchar列都是utf8mb4

scan_range_start BLOB,
scan_range_end BLOB,

这两个字段是BLOB.直接select出来当然是看不懂的啊。 :rofl:

1 个赞

有什么办法可以看懂,或者有需要看的必要吗

blob?二进制的图片吗?这个用代码做个转换就能看到内容的吧。

你可以试试用 MySQL 8.0 client,应该就不是乱码了。

1 个赞

这么说可以用mysql workbench来查看,里面有一个BLOB viewer

1 个赞

:joy:一直没有注意这个字段的类型

学习了

直接读二进制确实 :crazy_face: