summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-05-20 12:47:39 -0700
committerIgor Babaev <igor@askmonty.org>2011-05-20 12:47:39 -0700
commit89cf840cd9709c875bb6494398970624c85e4ab0 (patch)
treeb6926318d94f0bcd733468587a4bed4101c81612 /sql/opt_range.cc
parentbe6d6e1b3eb0d243dfa9f1d0de108069df5774e4 (diff)
parentd015b8fa0ad2bfb853da174c1c959374a24a5063 (diff)
downloadmariadb-git-89cf840cd9709c875bb6494398970624c85e4ab0.tar.gz
Merge
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 13afffd6ba9..3512edd9602 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -9510,7 +9510,7 @@ ha_rows check_quick_select(PARAM *param, uint idx, bool index_only,
SEL_ARG_RANGE_SEQ seq;
RANGE_SEQ_IF seq_if = {NULL, sel_arg_range_seq_init, sel_arg_range_seq_next, 0, 0};
handler *file= param->table->file;
- ha_rows rows;
+ ha_rows rows= HA_POS_ERROR;
uint keynr= param->real_keynr[idx];
DBUG_ENTER("check_quick_select");
@@ -9550,8 +9550,13 @@ ha_rows check_quick_select(PARAM *param, uint idx, bool index_only,
*mrr_flags |= HA_MRR_USE_DEFAULT_IMPL;
*bufsize= param->thd->variables.mrr_buff_size;
- rows= file->multi_range_read_info_const(keynr, &seq_if, (void*)&seq, 0,
- bufsize, mrr_flags, cost);
+ /*
+ Skip materialized derived table/view result table from MRR check as
+ they aren't contain any data yet.
+ */
+ if (param->table->pos_in_table_list->is_non_derived())
+ rows= file->multi_range_read_info_const(keynr, &seq_if, (void*)&seq, 0,
+ bufsize, mrr_flags, cost);
if (rows != HA_POS_ERROR)
{
param->quick_rows[keynr]= rows;