132
boost::dynamic_bitset<> *read_set; /* Active column sets */
133
boost::dynamic_bitset<> *write_set; /* Active column sets */
133
MyBitmap *read_set; /* Active column sets */
134
MyBitmap *write_set; /* Active column sets */
135
136
uint32_t tablenr;
136
137
uint32_t db_stat; /**< information about the cursor as in Cursor.h */
138
boost::dynamic_bitset<> def_read_set; /**< Default read set of columns */
139
boost::dynamic_bitset<> def_write_set; /**< Default write set of columns */
140
boost::dynamic_bitset<> tmp_set; /* Not sure about this... */
139
MyBitmap def_read_set; /**< Default read set of columns */
140
MyBitmap def_write_set; /**< Default write set of columns */
141
MyBitmap tmp_set; /* Not sure about this... */
142
143
Session *in_use; /**< Pointer to the current session using this object */
143
144
Session *getSession()
370
371
void resetTable(Session *session, TableShare *share, uint32_t db_stat_arg);
372
373
/* SHARE methods */
373
virtual const TableShare *getShare() const { assert(_share); return _share; } /* Get rid of this long term */
374
virtual TableShare *getMutableShare() { assert(_share); return _share; } /* Get rid of this long term */
375
inline bool hasShare() const { return _share ? true : false ; } /* Get rid of this long term */
376
inline void setShare(TableShare *new_share) { _share= new_share; } /* Get rid of this long term */
377
inline uint32_t sizeKeys() { return _share->sizeKeys(); }
378
inline uint32_t sizeFields() { return _share->sizeFields(); }
379
inline uint32_t getRecordLength() const { return _share->getRecordLength(); }
380
inline uint32_t sizeBlobFields() { return _share->blob_fields; }
381
inline uint32_t *getBlobField() { return &_share->blob_field[0]; }
374
inline const TableShare *getShare() const { assert(s); return s; } /* Get rid of this long term */
375
inline bool hasShare() const { return s ? true : false ; } /* Get rid of this long term */
376
inline TableShare *getMutableShare() { assert(s); return s; } /* Get rid of this long term */
377
inline void setShare(TableShare *new_share) { s= new_share; } /* Get rid of this long term */
378
inline uint32_t sizeKeys() { return s->sizeKeys(); }
379
inline uint32_t sizeFields() { return s->sizeFields(); }
380
inline uint32_t getRecordLength() const { return s->getRecordLength(); }
381
inline uint32_t sizeBlobFields() { return s->blob_fields; }
382
inline uint32_t *getBlobField() { return &s->blob_field[0]; }
383
384
Field_blob *getBlobFieldAt(uint32_t arg) const
385
if (arg < getShare()->blob_fields)
386
return (Field_blob*) field[getShare()->blob_field[arg]]; /*NOTE: Using 'Table.field' NOT SharedTable.field. */
386
if (arg < s->blob_fields)
387
return (Field_blob*) field[s->blob_field[arg]]; /*NOTE: Using 'Table.field' NOT SharedTable.field. */
390
inline uint8_t getBlobPtrSize() { return getShare()->blob_ptr_size; }
391
inline uint32_t getNullBytes() { return getShare()->null_bytes; }
392
inline uint32_t getNullFields() { return getShare()->null_fields; }
393
inline unsigned char *getDefaultValues() { return getMutableShare()->getDefaultValues(); }
394
inline const char *getSchemaName() const { return getShare()->getSchemaName(); }
395
inline const char *getTableName() const { return getShare()->getTableName(); }
391
inline uint8_t getBlobPtrSize() { return s->blob_ptr_size; }
392
inline uint32_t getNullBytes() { return s->null_bytes; }
393
inline uint32_t getNullFields() { return s->null_fields; }
394
inline unsigned char *getDefaultValues() { return s->getDefaultValues(); }
395
inline const char *getSchemaName() const { return s->getSchemaName(); }
396
inline const char *getTableName() const { return s->getTableName(); }
397
inline bool isDatabaseLowByteFirst() { return getShare()->db_low_byte_first; } /* Portable row format */
398
inline bool isNameLock() const { return getShare()->isNameLock(); }
399
inline bool isReplaceWithNameLock() { return getShare()->replace_with_name_lock; }
398
inline bool isDatabaseLowByteFirst() { return s->db_low_byte_first; } /* Portable row format */
399
inline bool isNameLock() const { return s->isNameLock(); }
400
inline bool isReplaceWithNameLock() { return s->replace_with_name_lock; }
401
402
uint32_t index_flags(uint32_t idx) const
403
return getShare()->storage_engine->index_flags(getShare()->getKeyInfo(idx).algorithm);
404
return s->storage_engine->index_flags(s->getKeyInfo(idx).algorithm);
406
407
inline plugin::StorageEngine *getEngine() const /* table_type for handler */
408
return getShare()->storage_engine;
409
return s->storage_engine;
411
412
Cursor &getCursor() const /* table_type for handler */
456
457
bool fill_item_list(List<Item> *item_list) const;
457
458
void clear_column_bitmaps(void);
458
459
void prepare_for_position(void);
459
void mark_columns_used_by_index_no_reset(uint32_t index, boost::dynamic_bitset<>& bitmap);
460
void mark_columns_used_by_index_no_reset(uint32_t index, MyBitmap *map);
460
461
void mark_columns_used_by_index_no_reset(uint32_t index);
461
462
void mark_columns_used_by_index(uint32_t index);
462
463
void restore_column_maps_after_mark_index();
464
465
void mark_columns_needed_for_update(void);
465
466
void mark_columns_needed_for_delete(void);
466
467
void mark_columns_needed_for_insert(void);
467
void column_bitmaps_set(boost::dynamic_bitset<>& read_set_arg,
468
boost::dynamic_bitset<>& write_set_arg);
470
void restore_column_map(const boost::dynamic_bitset<>& old);
472
const boost::dynamic_bitset<> use_all_columns(boost::dynamic_bitset<>& map);
468
inline void column_bitmaps_set(MyBitmap *read_set_arg,
469
MyBitmap *write_set_arg)
471
read_set= read_set_arg;
472
write_set= write_set_arg;
475
void restore_column_map(my_bitmap_map *old);
477
my_bitmap_map *use_all_columns(MyBitmap *bitmap);
473
478
inline void use_all_columns()
475
column_bitmaps_set(getMutableShare()->all_set, getMutableShare()->all_set);
480
column_bitmaps_set(&s->all_set, &s->all_set);
478
483
inline void default_column_bitmaps()
484
489
/* Both of the below should go away once we can move this bit to the field objects */
485
490
inline bool isReadSet(uint32_t index)
487
return read_set->test(index);
492
return read_set->isBitSet(index);
490
495
inline void setReadSet(uint32_t index)
492
read_set->set(index);
497
read_set->setBit(index);
495
500
inline void setReadSet()
500
505
inline void clearReadSet(uint32_t index)
502
read_set->reset(index);
507
read_set->clearBit(index);
505
510
inline void clearReadSet()
512
read_set->clearAll();
510
515
inline bool isWriteSet(uint32_t index)
512
return write_set->test(index);
517
return write_set->isBitSet(index);
515
520
inline void setWriteSet(uint32_t index)
517
write_set->set(index);
522
write_set->setBit(index);
520
525
inline void setWriteSet()
525
530
inline void clearWriteSet(uint32_t index)
527
write_set->reset(index);
532
write_set->clearBit(index);
530
535
inline void clearWriteSet()
537
write_set->clearAll();
535
540
/* Is table open or should be treated as such by name-locking? */