From 40822c81493722900087d3dca93fa959ec27a686 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 26 Nov 2010 00:30:39 +0300 Subject: [PATCH] Fix buildbot failure --- sql/multi_range_read.cc | 14 +++++++++++--- sql/multi_range_read.h | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index c04a215f433..ea6a0ab58c1 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -834,10 +834,15 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, goto error; } } - + strategy_exhausted= FALSE; + res= strategy->refill_buffer(TRUE); - if (res && res != HA_ERR_END_OF_FILE) //psergey-todo: remove EOF check here - goto error; + if (res) + { + if (res != HA_ERR_END_OF_FILE) + goto error; + strategy_exhausted= TRUE; + } /* If we have scanned through all intervals in *seq, then adjust *buf to @@ -1232,6 +1237,9 @@ void Key_value_records_iterator::move_to_next_key_value() int DsMrr_impl::dsmrr_next(char **range_info) { int res; + if (strategy_exhausted) + return HA_ERR_END_OF_FILE; + while ((res= strategy->get_next(range_info)) == HA_ERR_END_OF_FILE) { if ((res= strategy->refill_buffer(FALSE))) diff --git a/sql/multi_range_read.h b/sql/multi_range_read.h index 1e03cd9bbc0..13baac0a0dc 100644 --- a/sql/multi_range_read.h +++ b/sql/multi_range_read.h @@ -544,7 +544,10 @@ private: bool is_mrr_assoc; Mrr_reader_factory reader_factory; + Mrr_reader *strategy; + bool strategy_exhausted; + Mrr_index_reader *index_strategy; /* The whole buffer space that we're using */