Bug 反馈
清晰准确地描述您发现的问题,提供任何可能复现问题的步骤有助于研发同学及时处理问题
【 TiDB 版本】v7.5.3
【看到的非预期行为】
sql如下
EXPLAIN
SELECT
CONCAT(a.ad_id, '') ad_id,
a.`name` ad_name,
CONCAT(a.advertiser_id, '') advertiser_id,
a.`status`,
a.opt_status,
b.`name` advertiser_name,
e.id customer_id,
e.customer_short_name
FROM
Synads_Qc_Ad_Detail a
JOIN mbg_core.qc_advertiser b ON a.advertiser_id = b.advertiser_id
JOIN mbg_core.emarbox_project c ON c.project_id = b.project_id
JOIN mbg_core.yxt_finance_customer_entity d ON d.id = c.pig_advertiser_id
JOIN mbg_core.yxt_finance_customer e ON e.id = d.customer_id
WHERE
1 = 1
AND a.advertiser_id IN (
SELECT
b.platform_account_id advertiser_id
FROM
(
SELECT
a.project_id
FROM
mbg_core.tb_agent_user_project a
WHERE
a.user_id = 103680
) a
JOIN (
SELECT
b.project_id,
b.platform_account_id
FROM
mbg_core.emarbox_project b
WHERE
b.deleted = 0
AND b.media_id = 6
) b ON a.project_id = b.project_id
WHERE
1 = 1
UNION
SELECT
a.advertiser_id
FROM
mbg_core.qc_advertiser a
JOIN (
SELECT
b.project_id,
b.pig_advertiser_id
FROM
mbg_core.emarbox_project b
WHERE
b.media_id = 6
AND b.deleted = 0
) b ON a.project_id = b.project_id
JOIN mbg_core.yxt_finance_customer_entity c ON c.id = b.pig_advertiser_id
JOIN mbg_core.yxt_finance_customer d ON d.id = c.customer_id
WHERE
d.id IN (
SELECT
a.customer_id
FROM
mbg_core.tb_agent_user_customer a
WHERE
a.user_id =103680
)
)
AND a.advertiser_id IN (1779611088864333);
如果去掉最后一行的AND内容查询就正常,或者把mbg_core.emarbox_project 的tiflash 副本数去掉也正常