Commit 490dcfd5 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin
parent f7579518
......@@ -3877,7 +3877,6 @@ int subselect_single_select_engine::exec()
tab->save_read_record= tab->read_record.read_record_func;
tab->read_record.read_record_func= rr_sequential;
tab->read_first_record= read_first_record_seq;
tab->read_record.record= tab->table->record[0];
tab->read_record.thd= join->thd;
tab->read_record.ref_length= tab->table->file->ref_length;
tab->read_record.unlock_row= rr_unlock_row;
......@@ -3895,7 +3894,6 @@ int subselect_single_select_engine::exec()
for (JOIN_TAB **ptab= changed_tabs; ptab != last_changed_tab; ptab++)
{
JOIN_TAB *tab= *ptab;
tab->read_record.record= 0;
tab->read_record.ref_length= 0;
tab->read_first_record= tab->save_read_first_record;
tab->read_record.read_record_func= tab->save_read_record;
......
......@@ -77,7 +77,6 @@ bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
bzero((char*) info,sizeof(*info));
info->thd= thd;
info->table= table;
info->record= table->record[0];
info->print_error= print_error;
info->unlock_row= rr_unlock_row;
......@@ -210,7 +209,6 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
else
{
empty_record(table);
info->record= table->record[0];
info->ref_length= (uint)table->file->ref_length;
}
info->select=select;
......@@ -393,7 +391,7 @@ static int rr_index_first(READ_RECORD *info)
return tmp;
}
tmp= info->table->file->ha_index_first(info->record);
tmp= info->table->file->ha_index_first(info->record());
info->read_record_func= rr_index;
if (tmp)
tmp= rr_handle_error(info, tmp);
......@@ -416,7 +414,7 @@ static int rr_index_first(READ_RECORD *info)
static int rr_index_last(READ_RECORD *info)
{
int tmp= info->table->file->ha_index_last(info->record);
int tmp= info->table->file->ha_index_last(info->record());
info->read_record_func= rr_index_desc;
if (tmp)
tmp= rr_handle_error(info, tmp);
......@@ -442,7 +440,7 @@ static int rr_index_last(READ_RECORD *info)
static int rr_index(READ_RECORD *info)
{
int tmp= info->table->file->ha_index_next(info->record);
int tmp= info->table->file->ha_index_next(info->record());
if (tmp)
tmp= rr_handle_error(info, tmp);
return tmp;
......@@ -467,7 +465,7 @@ static int rr_index(READ_RECORD *info)
static int rr_index_desc(READ_RECORD *info)
{
int tmp= info->table->file->ha_index_prev(info->record);
int tmp= info->table->file->ha_index_prev(info->record());
if (tmp)
tmp= rr_handle_error(info, tmp);
return tmp;
......@@ -477,7 +475,7 @@ static int rr_index_desc(READ_RECORD *info)
int rr_sequential(READ_RECORD *info)
{
int tmp;
while ((tmp= info->table->file->ha_rnd_next(info->record)))
while ((tmp= info->table->file->ha_rnd_next(info->record())))
{
tmp= rr_handle_error(info, tmp);
break;
......@@ -493,7 +491,7 @@ static int rr_from_tempfile(READ_RECORD *info)
{
if (my_b_read(info->io_cache,info->ref_pos,info->ref_length))
return -1; /* End of file */
if (!(tmp= info->table->file->ha_rnd_pos(info->record,info->ref_pos)))
if (!(tmp= info->table->file->ha_rnd_pos(info->record(), info->ref_pos)))
break;
/* The following is extremely unlikely to happen */
if (tmp == HA_ERR_KEY_NOT_FOUND)
......@@ -543,7 +541,7 @@ int rr_from_pointers(READ_RECORD *info)
cache_pos= info->cache_pos;
info->cache_pos+= info->ref_length;
if (!(tmp= info->table->file->ha_rnd_pos(info->record,cache_pos)))
if (!(tmp= info->table->file->ha_rnd_pos(info->record(), cache_pos)))
break;
/* The following is extremely unlikely to happen */
......@@ -638,7 +636,7 @@ static int rr_from_cache(READ_RECORD *info)
else
{
error=0;
memcpy(info->record,info->cache_pos,
memcpy(info->record(), info->cache_pos,
(size_t) info->table->s->reclength);
}
info->cache_pos+=info->reclength;
......
......@@ -19,9 +19,10 @@
#pragma interface /* gcc class implementation */
#endif
#include "table.h"
struct st_join_table;
class handler;
struct TABLE;
class THD;
class SQL_SELECT;
class Copy_field;
......@@ -58,7 +59,6 @@ struct READ_RECORD
SQL_SELECT *select;
uint ref_length, reclength, rec_cache_size, error_offset;
uchar *ref_pos; /* pointer to form->refpos */
uchar *record;
uchar *rec_buf; /* to read field values after filesort */
uchar *cache,*cache_pos,*cache_end,*read_positions;
struct st_sort_addon_field *addon_field; /* Pointer to the fields info */
......@@ -67,6 +67,7 @@ struct READ_RECORD
void (*unpack)(struct st_sort_addon_field *, uchar *, uchar *);
int read_record() { return read_record_func(this); }
uchar *record() const { return table->record[0]; }
/*
SJ-Materialization runtime may need to read fields from the materialized
......
......@@ -20439,7 +20439,6 @@ join_read_first(JOIN_TAB *tab)
tab->table->status=0;
tab->read_record.read_record_func= join_read_next;
tab->read_record.table=table;
tab->read_record.record=table->record[0];
if (!table->file->inited)
error= table->file->ha_index_init(tab->index, tab->sorted);
if (likely(!error))
......@@ -20459,7 +20458,7 @@ static int
join_read_next(READ_RECORD *info)
{
int error;
if (unlikely((error= info->table->file->ha_index_next(info->record))))
if (unlikely((error= info->table->file->ha_index_next(info->record()))))
return report_error(info->table, error);
return 0;
......@@ -20479,7 +20478,6 @@ join_read_last(JOIN_TAB *tab)
tab->table->status=0;
tab->read_record.read_record_func= join_read_prev;
tab->read_record.table=table;
tab->read_record.record=table->record[0];
if (!table->file->inited)
error= table->file->ha_index_init(tab->index, 1);
if (likely(!error))
......@@ -20496,7 +20494,7 @@ static int
join_read_prev(READ_RECORD *info)
{
int error;
if (unlikely((error= info->table->file->ha_index_prev(info->record))))
if (unlikely((error= info->table->file->ha_index_prev(info->record()))))
return report_error(info->table, error);
return 0;
}
......@@ -20526,7 +20524,7 @@ static int
join_ft_read_next(READ_RECORD *info)
{
int error;
if (unlikely((error= info->table->file->ha_ft_read(info->table->record[0]))))
if (unlikely((error= info->table->file->ha_ft_read(info->record()))))
return report_error(info->table, error);
return 0;
}
......
......@@ -898,7 +898,7 @@ class Table_read_cursor : public Rowid_seq_cursor
{
Rowid_seq_cursor::init(info);
table= info->table;
record= info->record;
record= info->record();
}
virtual int fetch()
......
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