121
121
=================
122
122
[Warning: this description is work in progress and may be incomplete]
123
123
The table record is stored in a fixed-size buffer:
125
125
record: null_bytes, column1_data, column2_data, ...
127
The offsets of the parts of the buffer are also fixed: every column has
127
The offsets of the parts of the buffer are also fixed: every column has
128
128
an offset to its column{i}_data, and if it is nullable it also has its own
131
131
The record buffer only includes data about columns that are marked in the
132
132
relevant column set (table->read_set and/or table->write_set, depending on
134
134
<not-sure>It could be that it is required that null bits of non-present
135
135
columns are set to 1</not-sure>
137
137
VARIOUS EXCEPTIONS AND SPECIAL CASES
139
f the table has no nullable columns, then null_bytes is still
140
present, its length is one byte <not-sure> which must be set to 0xFF
139
f the table has no nullable columns, then null_bytes is still
140
present, its length is one byte <not-sure> which must be set to 0xFF
141
141
at all times. </not-sure>
143
143
If the table has columns of type BIT, then certain bits from those columns
144
144
may be stored in null_bytes as well. Grep around for Field_bit for
147
For blob columns (see Field_blob), the record buffer stores length of the
148
data, following by memory pointer to the blob data. The pointer is owned
147
For blob columns (see Field_blob), the record buffer stores length of the
148
data, following by memory pointer to the blob data. The pointer is owned
149
149
by the storage engine and is valid until the next operation.
151
151
If a blob column has NULL value, then its length and blob data pointer
317
317
{ return rows2double(ranges+rows); }
319
319
virtual double index_only_read_time(uint32_t keynr, double records);
321
321
virtual ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
322
void *seq_init_param,
322
void *seq_init_param,
323
323
uint32_t n_ranges, uint32_t *bufsz,
324
324
uint32_t *flags, COST_VECT *cost);
325
325
virtual int multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
683
683
This method offers the storage engine, the possibility to store a reference
684
to a table name which is going to be used with query cache.
684
to a table name which is going to be used with query cache.
685
685
The method is called each time a statement is written to the cache and can
686
686
be used to verify if a specific statement is cachable. It also offers
687
687
the possibility to register a generic (but static) call back function which
739
739
The pushed conditions form a stack (from which one can remove the
740
740
last pushed condition using cond_pop).
741
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
741
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
742
742
AND ... AND pushed_condN)
743
743
or less restrictive condition, depending on handler's capabilities.
745
745
handler->ha_reset() call empties the condition stack.
746
746
Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
749
749
virtual const COND *cond_push(const COND *cond) { return cond; }
893
893
This procedure defines if the storage engine supports virtual columns.
894
894
Default false means "not supported".
896
virtual bool check_if_supported_virtual_columns(void)
896
virtual bool check_if_supported_virtual_columns(void)
897
897
{ return false; }
1004
1004
virtual void start_bulk_insert(ha_rows)
1006
1006
virtual int end_bulk_insert(void) { return 0; }
1007
virtual int index_read(unsigned char *, const unsigned char *,
1007
virtual int index_read(unsigned char *, const unsigned char *,
1008
1008
uint32_t, enum ha_rkey_function)
1009
1009
{ return HA_ERR_WRONG_COMMAND; }
1010
1010
virtual int index_read_last(unsigned char *, const unsigned char *, uint32_t)
1069
1069
A Disk-Sweep MRR interface implementation
1071
1071
This implementation makes range (and, in the future, 'ref') scans to read
1072
table rows in disk sweeps.
1072
table rows in disk sweeps.
1074
1074
Currently it is used by MyISAM and InnoDB. Potentially it can be used with
1075
1075
any table handler that has non-clustered indexes and on-disk rows.
1108
1108
void init(handler *h_arg, Table *table_arg)
1111
1111
table= table_arg;
1113
int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
1114
void *seq_init_param, uint32_t n_ranges, uint32_t mode,
1113
int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
1114
void *seq_init_param, uint32_t n_ranges, uint32_t mode,
1115
1115
HANDLER_BUFFER *buf);
1116
1116
void dsmrr_close();
1117
1117
int dsmrr_fill_buffer(handler *h);
1120
1120
int dsmrr_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz,
1121
1121
uint32_t *flags, COST_VECT *cost);
1123
ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1123
ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1124
1124
void *seq_init_param, uint32_t n_ranges, uint32_t *bufsz,
1125
1125
uint32_t *flags, COST_VECT *cost);
1127
1127
bool key_uses_partial_cols(uint32_t keyno);
1128
bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
1128
bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
1129
1129
COST_VECT *cost);
1130
bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
1130
bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
1131
1131
uint32_t *buffer_size, COST_VECT *cost);
1352
1352
Table *drop_locked_tables(Session *session,const char *db, const char *table_name);
1353
1353
void abort_locked_tables(Session *session,const char *db, const char *table_name);
1354
1354
void execute_init_command(Session *session, sys_var_str *init_command_var,
1355
pthread_rwlock_t *var_mutex);
1355
rw_lock_t *var_mutex);
1356
1356
extern Field *not_found_field;
1357
1357
extern Field *view_ref_found;