diff options
author | Igor Babaev <igor@askmonty.org> | 2013-03-11 07:44:24 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-03-11 07:44:24 -0700 |
commit | fc1c8ffdadfd14eb51969ecfde43e3204f10f6f8 (patch) | |
tree | 70ee4b3628cc62a706476d6c7b873fcfc9aa0e10 /sql/opt_range_mrr.cc | |
parent | 938d47dcdc50ae4f127197ed72fd044b33ea7524 (diff) | |
download | mariadb-git-fc1c8ffdadfd14eb51969ecfde43e3204f10f6f8.tar.gz |
The pilot patch for mwl#253.
Diffstat (limited to 'sql/opt_range_mrr.cc')
-rw-r--r-- | sql/opt_range_mrr.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc index 1f4e36178db..8029dbf000f 100644 --- a/sql/opt_range_mrr.cc +++ b/sql/opt_range_mrr.cc @@ -268,8 +268,10 @@ walk_up_n_right: range->end_key.keypart_map= make_prev_keypart_map(cur->max_key_parts); if (!(cur->min_key_flag & ~NULL_RANGE) && !cur->max_key_flag && - (uint)key_tree->part+1 == seq->param->table->key_info[seq->real_keyno].key_parts && - (seq->param->table->key_info[seq->real_keyno].flags & HA_NOSAME) && + (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].flags & HA_NOSAME))) && range->start_key.length == range->end_key.length && !memcmp(seq->param->min_key,seq->param->max_key,range->start_key.length)) range->range_flag= UNIQUE_RANGE | (cur->min_key_flag & NULL_RANGE); |