From 50772ced08348106bd44057891d9094e3f22ac1e Mon Sep 17 00:00:00 2001 From: "hope.lb" Date: Thu, 30 Nov 2023 14:54:21 +0800 Subject: [PATCH] Bugfix LEFT JOIN cannot actually use dynamic range to access data --- sql/range_optimizer/range_analysis.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/range_optimizer/range_analysis.cc b/sql/range_optimizer/range_analysis.cc index 8e61ffd5072..4d53d3ce433 100644 --- a/sql/range_optimizer/range_analysis.cc +++ b/sql/range_optimizer/range_analysis.cc @@ -850,6 +850,10 @@ SEL_TREE *get_mm_tree(THD *thd, RANGE_OPT_PARAM *param, table_map prev_tables, if (param->has_errors()) return nullptr; + if (cond->type() == Item::FUNC_ITEM && + down_cast(cond)->functype() == Item_func::TRIG_COND_FUNC) + cond = down_cast(cond)->arguments()[0]; + if (cond->type() == Item::COND_ITEM) { Item_func::Functype functype = down_cast(cond)->functype(); -- 2.19.1.6.gb485710b