SQL 错误 [8118] [HY000]: Failed to build executor 。版本tidb-v6.1.0

如果觉得SQL不标准,可以这样执行:
select d.code2,a.code,b.code,
SUM(CASE WHEN d.period < ‘2020-01’ THEN d.pay ELSE 0 END) AS beforeYearAmt
FROM testdbs.m_info smi INNER JOIN testdbs.b2_info d ON smi.code = d.code1
AND d.type1 = ‘03’ AND smi.code3 = ‘S21011’
LEFT JOIN testdbs.h_info a ON smi.code4 = a.code AND smi.type3 = ‘01’
LEFT JOIN testdbs.b1_info b ON a.btestcode = b.code
WHERE d.code2 = ‘S21011’
AND d.period <= ‘2021-12’
group by d.code2,a.code,b.code
LIMIT 10