summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 6ca9ff5e823..2435492061e 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1093,7 +1093,7 @@ int SEL_IMERGE::or_sel_tree_with_checks(RANGE_OPT_PARAM *param,
{
bool must_be_ored= sel_trees_must_be_ored(param, *or_tree, tree,
ored_keys);
- if (must_be_ored == is_first_check_pass)
+ if (must_be_ored || !is_first_check_pass)
{
result_keys.clear_all();
result= *or_tree;
@@ -1138,8 +1138,7 @@ int SEL_IMERGE::or_sel_tree_with_checks(RANGE_OPT_PARAM *param,
*or_tree= result;
if (is_first_check_pass)
return 0;
- else
- was_ored= TRUE;
+ was_ored= TRUE;
}
}
if (was_ored)