summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2010-12-13 20:01:32 +0300
committerSergey Petrunya <psergey@askmonty.org>2010-12-13 20:01:32 +0300
commiteafc4bef33386b566654053f49762825618416fa (patch)
tree466091a5b740918fda48f125584c583604ef8ec3 /sql
parent58b646001a1d9b00ca8e41bd2a6826ed40f81b5f (diff)
downloadmariadb-git-eafc4bef33386b566654053f49762825618416fa.tar.gz
MWL#121-125 DS-MRR improvements
- Address review feedback: change return type of RANGE_SEQ_IF::next()
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.h6
-rw-r--r--sql/multi_range_read.cc15
-rw-r--r--sql/opt_range.h4
-rw-r--r--sql/opt_range_mrr.cc8
-rw-r--r--sql/sql_join_cache.cc12
5 files changed, 21 insertions, 24 deletions
diff --git a/sql/handler.h b/sql/handler.h
index cf92c117935..760754b21e6 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -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
diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc
index 321298fafa1..c72c92889f5 100644
--- a/sql/multi_range_read.cc
+++ b/sql/multi_range_read.cc
@@ -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);
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 4761d95d0ca..fe8d3eae6c7 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -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);
};
diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc
index 9eeec653355..e5da9577f7f 100644
--- a/sql/opt_range_mrr.cc
+++ b/sql/opt_range_mrr.cc
@@ -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;
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 240e18ed913..2c28aae781c 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -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;