Commit 2a6f58b5 authored by Sergey Petrunya's avatar Sergey Petrunya

MWL#121-125 DS-MRR improvements

- Address Monty's review feedback, part 6: rename "handler *h" variable in all
  DS-MRR classes to something else.
parent 448834eb
This diff is collapsed.
...@@ -129,7 +129,7 @@ class Key_value_records_iterator ...@@ -129,7 +129,7 @@ class Key_value_records_iterator
/* /*
FALSE <=> we're right after the init() call, the record has been already FALSE <=> we're right after the init() call, the record has been already
read with owner->h->index_read_map() call read with owner->file->index_read_map() call
*/ */
bool get_next_row; bool get_next_row;
...@@ -200,7 +200,7 @@ class Mrr_reader ...@@ -200,7 +200,7 @@ class Mrr_reader
class Mrr_index_reader : public Mrr_reader class Mrr_index_reader : public Mrr_reader
{ {
protected: protected:
handler *h; /* Handler object to use */ handler *file; /* Handler object to use */
public: public:
virtual int init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, virtual int init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
void *seq_init_param, uint n_ranges, void *seq_init_param, uint n_ranges,
...@@ -232,11 +232,11 @@ class Mrr_simple_index_reader : public Mrr_index_reader ...@@ -232,11 +232,11 @@ class Mrr_simple_index_reader : public Mrr_index_reader
Buffer_manager *buf_manager_arg); Buffer_manager *buf_manager_arg);
int get_next(char **range_info); int get_next(char **range_info);
int refill_buffer(bool initial) { return initial? 0: HA_ERR_END_OF_FILE; } int refill_buffer(bool initial) { return initial? 0: HA_ERR_END_OF_FILE; }
uchar *get_rowid_ptr() { return h->ref; } uchar *get_rowid_ptr() { return file->ref; }
bool skip_record(char *range_id, uchar *rowid) bool skip_record(char *range_id, uchar *rowid)
{ {
return (h->mrr_funcs.skip_record && return (file->mrr_funcs.skip_record &&
h->mrr_funcs.skip_record(h->mrr_iter, range_id, rowid)); file->mrr_funcs.skip_record(file->mrr_iter, range_id, rowid));
} }
}; };
...@@ -255,7 +255,7 @@ class Mrr_ordered_index_reader : public Mrr_index_reader ...@@ -255,7 +255,7 @@ class Mrr_ordered_index_reader : public Mrr_index_reader
Buffer_manager *buf_manager_arg); Buffer_manager *buf_manager_arg);
int get_next(char **range_info); int get_next(char **range_info);
int refill_buffer(bool initial); int refill_buffer(bool initial);
uchar *get_rowid_ptr() { return h->ref; } uchar *get_rowid_ptr() { return file->ref; }
bool skip_record(char *range_info, uchar *rowid) bool skip_record(char *range_info, uchar *rowid)
{ {
...@@ -318,12 +318,12 @@ class Mrr_ordered_index_reader : public Mrr_index_reader ...@@ -318,12 +318,12 @@ class Mrr_ordered_index_reader : public Mrr_index_reader
class Mrr_ordered_rndpos_reader : public Mrr_reader class Mrr_ordered_rndpos_reader : public Mrr_reader
{ {
public: public:
int init(handler *h, Mrr_index_reader *index_reader, uint mode, int init(handler *file, Mrr_index_reader *index_reader, uint mode,
Lifo_buffer *buf); Lifo_buffer *buf);
int get_next(char **range_info); int get_next(char **range_info);
int refill_buffer(bool initial); int refill_buffer(bool initial);
private: private:
handler *h; /* Handler to use */ handler *file; /* Handler to use */
/* This what we get (rowid, range_info) pairs from */ /* This what we get (rowid, range_info) pairs from */
Mrr_index_reader *index_reader; Mrr_index_reader *index_reader;
...@@ -503,15 +503,16 @@ class DsMrr_impl ...@@ -503,15 +503,16 @@ class DsMrr_impl
typedef void (handler::*range_check_toggle_func_t)(bool on); typedef void (handler::*range_check_toggle_func_t)(bool on);
DsMrr_impl() DsMrr_impl()
: h2(NULL) {}; : secondary_file(NULL) {};
void init(handler *h_arg, TABLE *table_arg) void init(handler *h_arg, TABLE *table_arg)
{ {
h= h_arg; primary_file= h_arg;
table= table_arg; table= table_arg;
} }
int dsmrr_init(handler *h, RANGE_SEQ_IF *seq_funcs, void *seq_init_param, int dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
uint n_ranges, uint mode, HANDLER_BUFFER *buf); void *seq_init_param, uint n_ranges, uint mode,
HANDLER_BUFFER *buf);
void dsmrr_close(); void dsmrr_close();
int dsmrr_next(char **range_info); int dsmrr_next(char **range_info);
...@@ -529,14 +530,14 @@ class DsMrr_impl ...@@ -529,14 +530,14 @@ class DsMrr_impl
The "owner" handler object (the one that is expected to "own" this object The "owner" handler object (the one that is expected to "own" this object
and call its functions). and call its functions).
*/ */
handler *h; handler *primary_file;
TABLE *table; /* Always equal to h->table */ TABLE *table; /* Always equal to primary_file->table */
/* /*
Secondary handler object. (created when needed, we need it when we need Secondary handler object. (created when needed, we need it when we need
to run both index scan and rnd_pos() scan at the same time) to run both index scan and rnd_pos() scan at the same time)
*/ */
handler *h2; handler *secondary_file;
uint keyno; /* index we're running the scan on */ uint keyno; /* index we're running the scan on */
/* TRUE <=> need range association, buffers hold {rowid, range_id} pairs */ /* TRUE <=> need range association, buffers hold {rowid, range_id} pairs */
......
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