diff --git a/sql/opt_range.cc b/sql/opt_range.cc index b7b3c48..8304309 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -5976,6 +5976,20 @@ static SEL_TREE *get_func_mm_tree_from_in_predicate(RANGE_OPT_PARAM *param, get_mm_parts(param, op, field, Item_func::EQ_FUNC, value); and_tree = tree_and(param, and_tree, and_expr); +#if 1 // Bug#106542 + } + /* + The fields that can use partition index may not be in the foremost + positions, so we can't know if partition index can be used or not + before we check all fields in Item_row. + */ + /* + Short-circuit evaluation: If and_expr is NULL then no key part in + this disjunct can be used as a search key. Or in other words the + condition is always true. Hence the whole disjunction is always true. + */ + if (and_tree == nullptr) return nullptr; +#else /* Short-circuit evaluation: If and_expr is NULL then no key part in this disjunct can be used as a search key. Or in other words the @@ -5983,6 +5997,8 @@ static SEL_TREE *get_func_mm_tree_from_in_predicate(RANGE_OPT_PARAM *param, */ if (and_tree == nullptr) return nullptr; } +#endif