ERROR 8118 (HY000): Failed to build executor

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

Original topic: ERROR 8118 (HY000): Failed to build executor

| username: TiDBer_wTKU9jv6

【TiDB Usage Environment】Testing
【TiDB Version】v6.1.0
【Encountered Problem】
ERROR 8118 (HY000): Failed to build executor

After modifying the SQL


【Reproduction Path】What operations were performed to encounter the problem
【Problem Phenomenon and Impact】

【Attachments】

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: xfworld | Original post link

You can try using CTE

| username: xiaohetao | Original post link

Learned.

| username: ShawnYan | Original post link

It might be the same bug. SQL 错误 [8118] [HY000]: Failed to build executor 。版本tidb-v6.1.0 - #22,来自 Lucien-卢西恩 - TiDB 的问答社区

| username: TiDBer_wTKU9jv6 | Original post link

After adjusting the condition position, it works fine.
Moving “and tcb.IS_NEWEST = 10041001” in the where clause to the first left join works fine.
explain analyze select A.ACTION_TYPE from
(SELECT ta.ACTION_TYPE, tcb.IS_NEWEST, tcb.REFERENCE_ID
FROM t1 ta
LEFT JOIN t2 tcb ON ta.CUSTOMER_BUSINESS_ID = tcb.CUSTOMER_BUSINESS_ID AND ta.CLUE_TYPE = 70241002 AND ta.ACTION_TYPE = 70211001 and tcb.IS_NEWEST = 10041001
LEFT JOIN t3 tpc2 ON ta.CUSTOMER_BUSINESS_ID = tpc2.POTENTIAL_CUSTOMERS_ID AND ta.ACTION_TYPE = 70211007
WHERE 1 = 1 ) A
left join t4 tt ON tt.SOURCE_ID = A.REFERENCE_ID;

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.