diff options
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index a02b6171a20..f1657b51bf3 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -10642,9 +10642,15 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2) */ tmp->maybe_flag|= key2_cpy.maybe_flag; key2_cpy.increment_use_count(key1->use_count+1); + + uint old_weight= tmp->next_key_part? tmp->next_key_part->weight: 0; + tmp->next_key_part= key_or(param, tmp->next_key_part, key2_cpy.next_key_part); + uint new_weight= tmp->next_key_part? tmp->next_key_part->weight: 0; + key1->weight += (new_weight - old_weight); + if (!cmp) break; // case b: done with this key2 range |