summaryrefslogtreecommitdiff
path: root/sql/opt_range_mrr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/opt_range_mrr.cc')
-rw-r--r--sql/opt_range_mrr.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc
index 8029dbf000f..bff96c7d4cb 100644
--- a/sql/opt_range_mrr.cc
+++ b/sql/opt_range_mrr.cc
@@ -270,7 +270,7 @@ walk_up_n_right:
if (!(cur->min_key_flag & ~NULL_RANGE) && !cur->max_key_flag &&
(seq->real_keyno == MAX_KEY ||
((uint)key_tree->part+1 ==
- seq->param->table->key_info[seq->real_keyno].key_parts &&
+ seq->param->table->key_info[seq->real_keyno].user_defined_key_parts &&
(seq->param->table->key_info[seq->real_keyno].flags & HA_NOSAME))) &&
range->start_key.length == range->end_key.length &&
!memcmp(seq->param->min_key,seq->param->max_key,range->start_key.length))
@@ -295,7 +295,7 @@ walk_up_n_right:
}
}
seq->param->range_count++;
- seq->param->max_key_part=max(seq->param->max_key_part,key_tree->part);
+ seq->param->max_key_part=MY_MAX(seq->param->max_key_part,key_tree->part);
return 0;
}