210
208
enum ha_choice transactional;
211
209
enum ha_choice page_checksum;
213
uint32_t ref_count; /* How many Table objects uses this */
214
uint32_t open_count; /* Number of tables in open list */
215
uint32_t blob_ptr_size; /* 4 or 8 */
216
uint32_t key_block_size; /* create key_block_size, if used */
217
uint32_t null_bytes, last_null_bit_pos;
218
uint32_t fields; /* Number of fields */
219
uint32_t stored_fields; /* Number of stored fields
220
(i.e. without generated-only ones) */
221
uint32_t rec_buff_length; /* Size of table->record[] buffer */
222
uint32_t keys, key_parts;
223
uint32_t max_key_length, max_unique_length, total_key_length;
224
uint32_t uniques; /* Number of UNIQUE index */
225
uint32_t null_fields; /* number of null fields */
226
uint32_t blob_fields; /* number of blob fields */
227
uint32_t timestamp_field_offset; /* Field number for timestamp field */
228
uint32_t varchar_fields; /* number of varchar fields */
229
uint32_t db_create_options; /* Create options from database */
230
uint32_t db_options_in_use; /* Options in use */
231
uint32_t db_record_offset; /* if HA_REC_IN_SEQ */
232
uint32_t rowid_field_offset; /* Field_nr +1 to rowid field */
211
uint ref_count; /* How many Table objects uses this */
212
uint open_count; /* Number of tables in open list */
213
uint blob_ptr_size; /* 4 or 8 */
214
uint key_block_size; /* create key_block_size, if used */
215
uint null_bytes, last_null_bit_pos;
216
uint fields; /* Number of fields */
217
uint rec_buff_length; /* Size of table->record[] buffer */
218
uint keys, key_parts;
219
uint max_key_length, max_unique_length, total_key_length;
220
uint uniques; /* Number of UNIQUE index */
221
uint null_fields; /* number of null fields */
222
uint blob_fields; /* number of blob fields */
223
uint timestamp_field_offset; /* Field number for timestamp field */
224
uint varchar_fields; /* number of varchar fields */
225
uint db_create_options; /* Create options from database */
226
uint db_options_in_use; /* Options in use */
227
uint db_record_offset; /* if HA_REC_IN_SEQ */
228
uint rowid_field_offset; /* Field_nr +1 to rowid field */
233
229
/* Index of auto-updated TIMESTAMP field in field array */
234
uint32_t primary_key;
235
uint32_t next_number_index; /* autoincrement key number */
236
uint32_t next_number_key_offset; /* autoinc keypart offset in a key */
237
uint32_t next_number_keypart; /* autoinc keypart number in a key */
238
uint32_t error, open_errno, errarg; /* error from open_table_def() */
239
uint32_t column_bitmap_size;
240
unsigned char frm_version;
241
uint32_t vfields; /* Number of virtual fields */
231
uint next_number_index; /* autoincrement key number */
232
uint next_number_key_offset; /* autoinc keypart offset in a key */
233
uint next_number_keypart; /* autoinc keypart number in a key */
234
uint error, open_errno, errarg; /* error from open_table_def() */
235
uint column_bitmap_size;
242
237
bool null_field_first;
243
238
bool db_low_byte_first; /* Portable row format */
351
346
/* SHARE methods */
352
347
inline TABLE_SHARE *getShare() { return s; } /* Get rid of this long term */
353
348
inline void setShare(TABLE_SHARE *new_share) { s= new_share; } /* Get rid of this long term */
354
inline uint32_t sizeKeys() { return s->keys; }
355
inline uint32_t sizeFields() { return s->fields; }
356
inline uint32_t getRecordLength() { return s->reclength; }
357
inline uint32_t sizeBlobFields() { return s->blob_fields; }
358
inline uint32_t *getBlobField() { return s->blob_field; }
359
inline uint32_t getNullBytes() { return s->null_bytes; }
360
inline uint32_t getNullFields() { return s->null_fields; }
349
inline uint sizeKeys() { return s->keys; }
350
inline uint sizeFields() { return s->fields; }
351
inline uint getRecordLength() { return s->reclength; }
352
inline uint sizeBlobFields() { return s->blob_fields; }
353
inline uint *getBlobField() { return s->blob_field; }
354
inline uint getNullBytes() { return s->null_bytes; }
355
inline uint getNullFields() { return s->null_fields; }
361
356
inline unsigned char *getDefaultValues() { return s->default_values; }
363
358
inline bool isNullFieldFirst() { return s->null_field_first; }
370
365
/* For TMP tables, should be pulled out as a class */
371
366
void updateCreateInfo(HA_CREATE_INFO *create_info);
372
void setup_tmp_table_column_bitmaps(unsigned char *bitmaps);
367
void setup_tmp_table_column_bitmaps(uchar *bitmaps);
373
368
bool create_myisam_tmp_table(KEY *keyinfo,
374
369
MI_COLUMNDEF *start_recinfo,
375
370
MI_COLUMNDEF **recinfo,
376
371
uint64_t options);
377
372
void free_tmp_table(THD *thd);
378
373
bool open_tmp_table();
379
size_t max_row_length(const unsigned char *data);
380
uint32_t find_shortest_key(const key_map *usable_keys);
374
size_t max_row_length(const uchar *data);
375
uint find_shortest_key(const key_map *usable_keys);
381
376
bool compare_record(Field **ptr);
382
377
bool compare_record();
384
bool table_check_intact(const uint32_t table_f_count, const TABLE_FIELD_W_TYPE *table_def);
379
bool table_check_intact(const uint table_f_count, const TABLE_FIELD_W_TYPE *table_def);
386
381
/* See if this can be blown away */
387
inline uint32_t getDBStat () { return db_stat; }
388
inline uint32_t setDBStat () { return db_stat; }
382
inline uint getDBStat () { return db_stat; }
383
inline uint setDBStat () { return db_stat; }
389
384
uint db_stat; /* mode of file as in handler.h */
394
389
THD *in_use; /* Which thread uses this */
395
390
Field **field; /* Pointer to fields */
397
unsigned char *record[2]; /* Pointer to records */
398
unsigned char *write_row_record; /* Used as optimisation in
392
uchar *record[2]; /* Pointer to records */
393
uchar *write_row_record; /* Used as optimisation in
399
394
THD::write_row */
400
unsigned char *insert_values; /* used by INSERT ... UPDATE */
395
uchar *insert_values; /* used by INSERT ... UPDATE */
402
397
Map of keys that can be used to retrieve all data from this table
403
398
needed by the query without reading the row.
425
420
Field *next_number_field; /* Set if next_number is activated */
426
421
Field *found_next_number_field; /* Set on open */
427
422
Field_timestamp *timestamp_field;
428
Field **vfield; /* Pointer to virtual fields*/
430
424
TableList *pos_in_table_list;/* Element referring to this table */
432
426
const char *alias; /* alias or table name */
433
unsigned char *null_flags;
434
428
my_bitmap_map *bitmap_init_value;
435
429
MY_BITMAP def_read_set, def_write_set, tmp_set; /* containers */
436
430
MY_BITMAP *read_set, *write_set; /* Active column sets */
491
485
timestamp_auto_set_type timestamp_field_type;
492
486
table_map map; /* ID bit of table (1,2,4,8,16...) */
494
uint32_t lock_position; /* Position in DRIZZLE_LOCK.table */
495
uint32_t lock_data_start; /* Start pos. in DRIZZLE_LOCK.locks */
496
uint32_t lock_count; /* Number of locks */
488
uint lock_position; /* Position in DRIZZLE_LOCK.table */
489
uint lock_data_start; /* Start pos. in DRIZZLE_LOCK.locks */
490
uint lock_count; /* Number of locks */
497
491
uint tablenr,used_fields;
498
uint32_t temp_pool_slot; /* Used by intern temp tables */
492
uint temp_pool_slot; /* Used by intern temp tables */
499
493
uint status; /* What's in record[0] */
500
494
/* number of select if it is derived table */
501
uint32_t derived_select_number;
495
uint derived_select_number;
502
496
int current_lock; /* Type of lock on table */
503
497
bool copy_blobs; /* copy_blobs when storing */
560
554
void reset_item_list(List<Item> *item_list) const;
561
555
void clear_column_bitmaps(void);
562
556
void prepare_for_position(void);
563
void mark_columns_used_by_index_no_reset(uint32_t index, MY_BITMAP *map);
564
void mark_columns_used_by_index(uint32_t index);
557
void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
558
void mark_columns_used_by_index(uint index);
565
559
void restore_column_maps_after_mark_index();
566
560
void mark_auto_increment_column(void);
567
561
void mark_columns_needed_for_update(void);
568
562
void mark_columns_needed_for_delete(void);
569
563
void mark_columns_needed_for_insert(void);
570
void mark_virtual_columns(void);
571
564
inline void column_bitmaps_set(MY_BITMAP *read_set_arg,
572
565
MY_BITMAP *write_set_arg)