Bug 反馈
清晰准确地描述您发现的问题,提供任何可能复现问题的步骤有助于研发同学及时处理问题
【 TiDB 版本】
> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.0.0
Edition: Community
Git Commit Hash: 36a9810441ca0e496cbd22064af274b3be771081
Git Branch: heads/refs/tags/v6.0.0
UTC Build Time: 2022-03-31 10:33:28
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.001 sec)
【 Bug 的影响】
处理不够优雅,连接会中断
【可能的问题复现步骤】
USE test;
DROP TABLE IF EXISTS t;
CREATE TABLE t (id int, dc datetime, cc1 char(20), cc2 char(20));
INSERT INTO t VALUES (1, '2022-05-01 15:33:33', 'UUtJeaV', 'snRXXCZHBPW'), (2, '2022-05-01 15:33:33', 'snRXXCZHBPW', 'UUtJeaV');
explain format = 'verbose' select id, DAYNAME(dc), MONTHNAME(dc) from t;
explain format='VERBOSE' select id, DAYNAME(dc), MONTHNAME(dc) from t;
【看到的非预期行为】
TiDB-v6> explain format = 'verbose' select id, DAYNAME(dc), MONTHNAME(dc) from t;
+-------------------------+----------+-----------+-----------+---------------+-------------------------------------------------------------------------+
| id | estRows | estCost | task | access object | operator info |
+-------------------------+----------+-----------+-----------+---------------+-------------------------------------------------------------------------+
| Projection_3 | 10000.00 | 72852.67 | root | | test.t.id, dayname(test.t.dc)->Column#6, monthname(test.t.dc)->Column#7 |
| └─TableReader_5 | 10000.00 | 66834.67 | root | | data:TableFullScan_4 |
| └─TableFullScan_4 | 10000.00 | 840020.00 | cop[tikv] | table:t | keep order:false, stats:pseudo |
+-------------------------+----------+-----------+-----------+---------------+-------------------------------------------------------------------------+
3 rows in set (0.001 sec)
TiDB-v6> explain format='VERBOSE' select id, DAYNAME(dc), MONTHNAME(dc) from t;
ERROR 1105 (HY000): runtime error: index out of range [0] with length 0
ERROR 2013 (HY000): Lost connection to MySQL server during query
ERROR 2013 (HY000): Lost connection to MySQL server during query
【期望看到的行为】
explain format = 'verbose'
与 explain format='VERBOSE'
查询结果应该一致。
【相关组件及具体版本】
【其他背景信息或者截图】
如集群拓扑,系统和内核版本,应用 app 信息等;如果问题跟 SQL 有关,请提供 SQL 语句和相关表的 Schema 信息;如果节点日志存在关键报错,请提供相关节点的日志内容或文件;如果一些业务敏感信息不便提供,请留下联系方式,我们与您私下沟通。