Commit eafc4bef authored by Sergey Petrunya's avatar Sergey Petrunya

MWL#121-125 DS-MRR improvements

- Address review feedback: change return type of RANGE_SEQ_IF::next()
parent 58b64600
......@@ -1197,10 +1197,10 @@ typedef struct st_range_seq_if
range OUT Information about the next range
RETURN
0 - Ok, the range structure filled with info about the next range
1 - No more ranges
FALSE - Ok, the range structure filled with info about the next range
TRUE - No more ranges
*/
uint (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
bool (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
/*
Check whether range_info orders to skip the next record
......
......@@ -426,17 +426,14 @@ int Mrr_ordered_index_reader::refill_buffer(bool initial)
if (source_exhausted)
DBUG_RETURN(HA_ERR_END_OF_FILE);
//if (know_key_tuple_params)
{
buf_manager->reset_buffer_sizes(buf_manager->arg);
key_buffer->reset();
key_buffer->setup_writing(&key_ptr, keypar.key_size_in_keybuf,
is_mrr_assoc? (uchar**)&range_info_ptr : NULL,
sizeof(uchar*));
}
buf_manager->reset_buffer_sizes(buf_manager->arg);
key_buffer->reset();
key_buffer->setup_writing(&key_ptr, keypar.key_size_in_keybuf,
is_mrr_assoc? (uchar**)&range_info_ptr : NULL,
sizeof(uchar*));
while (key_buffer->can_write() &&
!(source_exhausted= (bool)mrr_funcs.next(mrr_iter, &cur_range)))
!(source_exhausted= mrr_funcs.next(mrr_iter, &cur_range)))
{
DBUG_ASSERT(cur_range.range_flag & EQ_RANGE);
......
......@@ -373,7 +373,7 @@ typedef struct st_quick_range_seq_ctx
} QUICK_RANGE_SEQ_CTX;
range_seq_t quick_range_seq_init(void *init_param, uint n_ranges, uint flags);
uint quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);
bool quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);
/*
......@@ -461,7 +461,7 @@ private:
friend class QUICK_INDEX_MERGE_SELECT;
friend class QUICK_ROR_INTERSECT_SELECT;
friend class QUICK_GROUP_MIN_MAX_SELECT;
friend uint quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);
friend bool quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);
friend range_seq_t quick_range_seq_init(void *init_param,
uint n_ranges, uint flags);
};
......
......@@ -116,11 +116,11 @@ static void step_down_to(SEL_ARG_RANGE_SEQ *arg, SEL_ARG *key_tree)
- max_key_part
RETURN
0 Ok
1 No more ranges in the sequence
FALSE Ok
TRUE No more ranges in the sequence
*/
uint sel_arg_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
bool sel_arg_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{
SEL_ARG *key_tree;
SEL_ARG_RANGE_SEQ *seq= (SEL_ARG_RANGE_SEQ*)rseq;
......@@ -314,7 +314,7 @@ range_seq_t quick_range_seq_init(void *init_param, uint n_ranges, uint flags)
1 No more ranges in the sequence
*/
uint quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
bool quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{
QUICK_RANGE_SEQ_CTX *ctx= (QUICK_RANGE_SEQ_CTX*)rseq;
......
......@@ -3655,12 +3655,12 @@ range_seq_t bka_range_seq_init(void *init_param, uint n_ranges, uint flags)
This function are used only as a callback function.
RETURN VALUE
0 ok, the range structure filled with info about the next range/key
1 no more ranges
FALSE ok, the range structure filled with info about the next range/key
TRUE no more ranges
*/
static
uint bka_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
bool bka_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{
DBUG_ENTER("bka_range_seq_next");
JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
......@@ -4130,12 +4130,12 @@ range_seq_t bkah_range_seq_init(void *init_param, uint n_ranges, uint flags)
This function are used only as a callback function.
RETURN VALUE
0 ok, the range structure filled with info about the next range/key
1 no more ranges
FALSE ok, the range structure filled with info about the next range/key
TRUE no more ranges
*/
static
uint bkah_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
bool bkah_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{
DBUG_ENTER("bkah_range_seq_next");
JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
......
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