【 TiDB 使用环境】生产环境
【 TiDB 版本】V8.1.0
【复现路径】执行较复杂SQL
【遇到的问题:问题现象及影响】执行报错:[HY000][1105] runtime error: index out of range [1] with length 1
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
报错截图:
执行SQL1报错,执行SQL2不报错,SQL1与SQL2的区别是指定了的查询字段
SQL1
select TT.zgxwmc FROM (
SELECT t.project_id xmid,
t.member_type cylxdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c90810a4de1fc0a014de205c5d2000c'
AND t.member_type = t2.code) cylxmc,
t.person_code xgh,
t.person_name xm,
t.unit_name gzdw,
'' zyjszwdm,
(SELECT name FROM kyxt_dm_title_define d WHERE d.srms_id = t.title_id) zyjszwmc,
NULL zgxwdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c9081c74c9c5944014c9c5fcac00007'
AND t.edu_degree_id = t2.code) zgxwmc,
t.order_id smsx,
t.bear_type_id cdlxdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c90810a4de5556e014de55d23dc0012'
AND t.bear_type_id = t2.code) cdlxmc,
t.join_state_id cyztdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c90810a4de5556e014de55e04720016'
AND t.join_state_id = t2.code) cyztmc,
t.work_ratio gxl,
NULL xmfldm,
'纵向' xmflmc
FROM kyxt_biz_zx_project_member t
LEFT JOIN szzydwd_dwd_jzg_jzgjbsj t2 ON t.person_code = t2.gh) TT
where TT.zgxwmc is not null
SQL2
select TT.* FROM (
SELECT t.project_id xmid,
t.member_type cylxdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c90810a4de1fc0a014de205c5d2000c'
AND t.member_type = t2.code) cylxmc,
t.person_code xgh,
t.person_name xm,
t.unit_name gzdw,
'' zyjszwdm,
(SELECT name FROM kyxt_dm_title_define d WHERE d.srms_id = t.title_id) zyjszwmc,
NULL zgxwdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c9081c74c9c5944014c9c5fcac00007'
AND t.edu_degree_id = t2.code) zgxwmc,
t.order_id smsx,
t.bear_type_id cdlxdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c90810a4de5556e014de55d23dc0012'
AND t.bear_type_id = t2.code) cdlxmc,
t.join_state_id cyztdm,
(SELECT name
FROM kyxt_cfg_category_entry t2
WHERE t2.categoryid = '2c90810a4de5556e014de55e04720016'
AND t.join_state_id = t2.code) cyztmc,
t.work_ratio gxl,
NULL xmfldm,
'纵向' xmflmc
FROM kyxt_biz_zx_project_member t
LEFT JOIN szzydwd_dwd_jzg_jzgjbsj t2 ON t.person_code = t2.gh) TT
where TT.zgxwmc is not null