summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-03-04 12:06:03 +0300
committerSergey Petrunya <psergey@askmonty.org>2011-03-04 12:06:03 +0300
commite6bd643c7573fcbf422635e7a7440260ed30c297 (patch)
treebfff2e674586499e895adb3f29b11a8f74e57604 /sql/sql_join_cache.cc
parentcdd214de1c3902e794940af6911666f7e40cbb4d (diff)
downloadmariadb-git-e6bd643c7573fcbf422635e7a7440260ed30c297.tar.gz
MRR interface: change range_info's type from char* to range_id_t typedef. The goals are:
- cleaner code - ability to change from using pointers to offsets at some point
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index d04f5eddfa8..e952cf3e2ef 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -3712,7 +3712,9 @@ int JOIN_TAB_SCAN_MRR::open()
int JOIN_TAB_SCAN_MRR::next()
{
char **ptr= (char **) cache->get_curr_association_ptr();
- int rc= join_tab->table->file->multi_range_read_next(ptr) ? -1 : 0;
+
+ DBUG_ASSERT(sizeof(range_id_t) == sizeof(*ptr));
+ int rc= join_tab->table->file->multi_range_read_next((range_id_t*)ptr) ? -1 : 0;
if (!rc)
{
/*
@@ -3836,7 +3838,7 @@ bool bka_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
*/
static
-bool bka_range_seq_skip_record(range_seq_t rseq, char *range_info, uchar *rowid)
+bool bka_range_seq_skip_record(range_seq_t rseq, range_id_t range_info, uchar *rowid)
{
DBUG_ENTER("bka_range_seq_skip_record");
JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
@@ -3867,7 +3869,7 @@ bool bka_range_seq_skip_record(range_seq_t rseq, char *range_info, uchar *rowid)
*/
static
-bool bka_skip_index_tuple(range_seq_t rseq, char *range_info)
+bool bka_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
{
DBUG_ENTER("bka_skip_index_tuple");
JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
@@ -4203,7 +4205,7 @@ start:
0 otherwise
*/
-bool JOIN_CACHE_BKA::skip_index_tuple(char *range_info)
+bool JOIN_CACHE_BKA::skip_index_tuple(range_id_t range_info)
{
DBUG_ENTER("JOIN_CACHE_BKA::skip_index_tuple");
get_record_by_pos((uchar*)range_info);
@@ -4311,7 +4313,7 @@ bool bkah_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
*/
static
-bool bkah_range_seq_skip_record(range_seq_t rseq, char *range_info,
+bool bkah_range_seq_skip_record(range_seq_t rseq, range_id_t range_info,
uchar *rowid)
{
DBUG_ENTER("bkah_range_seq_skip_record");
@@ -4342,7 +4344,7 @@ bool bkah_range_seq_skip_record(range_seq_t rseq, char *range_info,
*/
static
-bool bkah_skip_index_tuple(range_seq_t rseq, char *range_info)
+bool bkah_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
{
DBUG_ENTER("bka_unique_skip_index_tuple");
JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
@@ -4456,7 +4458,7 @@ int JOIN_CACHE_BKAH::init()
*/
-bool JOIN_CACHE_BKAH::skip_index_tuple(char *range_info)
+bool JOIN_CACHE_BKAH::skip_index_tuple(range_id_t range_info)
{
uchar *last_rec_ref_ptr= get_next_rec_ref((uchar*) range_info);
uchar *next_rec_ref_ptr= last_rec_ref_ptr;