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