Commit 1e82320d authored by Sergey Petrunya's avatar Sergey Petrunya

DS-MRR improvements

- buildbot test failure fixes: don't try to get more records from SimpleIndexReader
  if we've already got EOF for it.
parent a88bd5cf
...@@ -303,6 +303,7 @@ int Mrr_simple_index_reader::init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, ...@@ -303,6 +303,7 @@ int Mrr_simple_index_reader::init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
{ {
HANDLER_BUFFER no_buffer = {NULL, NULL, NULL}; HANDLER_BUFFER no_buffer = {NULL, NULL, NULL};
h= h_arg; h= h_arg;
res= 0;
return h->handler::multi_range_read_init(seq_funcs, seq_init_param, n_ranges, return h->handler::multi_range_read_init(seq_funcs, seq_init_param, n_ranges,
mode, &no_buffer); mode, &no_buffer);
} }
...@@ -559,6 +560,9 @@ int Mrr_ordered_rndpos_reader::refill_buffer() ...@@ -559,6 +560,9 @@ int Mrr_ordered_rndpos_reader::refill_buffer()
last_identical_rowid= NULL; last_identical_rowid= NULL;
if (index_reader->eof())
DBUG_RETURN(0);
while (rowid_buffer->can_write()) while (rowid_buffer->can_write())
{ {
res= index_reader->get_next(&range_info); res= index_reader->get_next(&range_info);
......
...@@ -126,8 +126,8 @@ class Buffer_manager ...@@ -126,8 +126,8 @@ class Buffer_manager
index tuple or a table record. index tuple or a table record.
Getting HA_ERR_END_OF_FILE from get_next() means that the source should be Getting HA_ERR_END_OF_FILE from get_next() means that the source should be
re-filled. if eof() returns true after refill attempt, then end of stream has re-filled. if eof() returns true after refill attempt, then the end of
been reached and get_next() must not be called anymore. stream has been reached and get_next() must not be called anymore.
*/ */
class Mrr_reader class Mrr_reader
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment