drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ha_myisam Class Reference
Inheritance diagram for ha_myisam:
[legend]
Collaboration diagram for ha_myisam:
[legend]

Public Member Functions

 ha_myisam (drizzled::plugin::StorageEngine &engine, drizzled::Table &table_arg)
Cursor * clone (drizzled::memory::Root *mem_root)
const char * index_type (uint32_t key_number)
int doStartIndexScan (uint32_t idx, bool sorted)
int doEndIndexScan ()
uint32_t checksum () const
int doOpen (const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked)
int close (void)
int doInsertRecord (unsigned char *buf)
int doUpdateRecord (const unsigned char *old_data, unsigned char *new_data)
int doDeleteRecord (const unsigned char *buf)
int index_read_map (unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map, enum drizzled::ha_rkey_function find_flag)
 Positions an index cursor to the index specified in the handle. Fetches the row if available. If the key value is null, begin at the first key of the index.
int index_read_idx_map (unsigned char *buf, uint32_t index, const unsigned char *key, drizzled::key_part_map keypart_map, enum drizzled::ha_rkey_function find_flag)
 Positions an index cursor to the index specified in the handle. Fetches the row if available. If the key value is null, begin at the first key of the index.
int index_read_last_map (unsigned char *buf, const unsigned char *key, drizzled::key_part_map keypart_map)
 The following functions works like index_read, but it find the last row with the current key value or prefix.
int index_next (unsigned char *buf)
int index_prev (unsigned char *buf)
int index_first (unsigned char *buf)
int index_last (unsigned char *buf)
int index_next_same (unsigned char *buf, const unsigned char *key, uint32_t keylen)
int doStartTableScan (bool scan)
int rnd_next (unsigned char *buf)
int rnd_pos (unsigned char *buf, unsigned char *pos)
void position (const unsigned char *record)
int info (uint)
int extra (enum drizzled::ha_extra_function operation)
int extra_opt (enum drizzled::ha_extra_function operation, uint32_t cache_size)
int reset (void)
int external_lock (drizzled::Session *session, int lock_type)
int delete_all_rows (void)
int disable_indexes (uint32_t mode)
int enable_indexes (uint32_t mode)
int indexes_are_disabled (void)
void start_bulk_insert (drizzled::ha_rows rows)
int end_bulk_insert ()
drizzled::ha_rows records_in_range (uint32_t inx, drizzled::key_range *min_key, drizzled::key_range *max_key)
virtual void get_auto_increment (uint64_t offset, uint64_t increment, uint64_t nb_desired_values, uint64_t *first_value, uint64_t *nb_reserved_values)
MI_INFO * file_ptr (void)
int read_range_first (const drizzled::key_range *start_key, const drizzled::key_range *end_key, bool eq_range_arg, bool sorted)
int read_range_next ()
int reset_auto_increment (uint64_t value)
virtual bool isOrdered (void)
Public Member Functions inherited from drizzled::Cursor
plugin::StorageEngine * getEngine () const
TableShare * getShare ()
Table * getTable () const
uint64_t getNextInsertId () const
uint64_t getAutoIncrement () const
 Cursor (plugin::StorageEngine &engine_arg, Table &share_arg)
int ha_open (const identifier::Table &identifier, int mode, int test_if_locked)
int startIndexScan (uint32_t idx, bool sorted) __attribute__((warn_unused_result))
int endIndexScan ()
int startTableScan (bool scan) __attribute__((warn_unused_result))
int endTableScan ()
int ha_reset ()
int ha_index_or_rnd_end ()
int ha_external_lock (Session *session, int lock_type)
int insertRecord (unsigned char *buf) __attribute__((warn_unused_result))
int updateRecord (const unsigned char *old_data, unsigned char *new_data) __attribute__((warn_unused_result))
int deleteRecord (const unsigned char *buf) __attribute__((warn_unused_result))
void ha_release_auto_increment ()
int ha_check (Session *)
void ha_start_bulk_insert (ha_rows rows)
int ha_end_bulk_insert ()
int ha_delete_all_rows ()
int ha_reset_auto_increment (uint64_t value)
int ha_analyze (Session *)
int ha_disable_indexes (uint32_t mode)
int ha_enable_indexes (uint32_t mode)
int ha_discard_or_import_tablespace (bool discard)
void closeMarkForDelete ()
void adjust_next_insert_id_after_explicit_value (uint64_t nr)
int update_auto_increment ()
virtual double scan_time (void)
virtual double read_time (uint32_t, uint32_t ranges, ha_rows rows)
virtual double index_only_read_time (uint32_t keynr, double records)
virtual ha_rows multi_range_read_info_const (uint32_t keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint32_t n_ranges, uint32_t *bufsz, uint32_t *flags, optimizer::CostVector *cost)
virtual int multi_range_read_info (uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz, uint32_t *flags, optimizer::CostVector *cost)
virtual int multi_range_read_init (RANGE_SEQ_IF *seq, void *seq_init_param, uint32_t n_ranges, uint32_t mode)
virtual int multi_range_read_next (char **range_info)
virtual const key_map * keys_to_use_for_scanning ()
bool has_transactions ()
virtual bool is_fatal_error (int error, uint32_t flags)
virtual ha_rows records ()
virtual uint64_t tableSize ()
virtual uint64_t rowSize ()
virtual ha_rows estimate_rows_upper_bound ()
uint32_t get_index (void) const
int compare_key (key_range *range)
virtual int read_first_row (unsigned char *buf, uint32_t primary_key)
virtual int rnd_same (unsigned char *, uint32_t)
virtual int info (uint32_t)=0
virtual uint32_t calculate_key_hash_value (Field **)
virtual bool was_semi_consistent_read ()
virtual void try_semi_consistent_read (bool)
virtual void unlock_row (void)
void set_next_insert_id (uint64_t id)
void restore_auto_increment (uint64_t prev_insert_id)
virtual void append_create_info (String *)
virtual char * get_foreign_key_create_info (void)
virtual bool can_switch_engines (void)
virtual int get_foreign_key_list (Session *, List< ForeignKeyInfo > *)
virtual uint32_t referenced_by_foreign_key ()
virtual void free_foreign_key_create_info (char *)
virtual THR_LOCK_DATA ** store_lock (Session *, THR_LOCK_DATA **to, enum thr_lock_type)
virtual bool primary_key_is_clustered ()
virtual int cmp_ref (const unsigned char *ref1, const unsigned char *ref2)

Private Member Functions

int repair (drizzled::Session *session, MI_CHECK &param, bool optimize)

Private Attributes

MI_INFO * file
bool can_enable_indexes
bool is_ordered
drizzled::key_map keys_with_parts

Additional Inherited Members

Public Types inherited from drizzled::Cursor
enum  { NONE =0 , INDEX , RND }
Public Attributes inherited from drizzled::Cursor
unsigned char * ref
unsigned char * dup_ref
ha_statistics stats
range_seq_t mrr_iter
RANGE_SEQ_IF mrr_funcs
uint32_t ranges_in_seq
bool mrr_is_output_sorted
bool mrr_have_range
bool eq_range
KEY_MULTI_RANGE mrr_cur_range
key_range save_end_range
key_range * end_range
KeyPartInfo * range_key_part
int key_compare_result_on_equal
uint32_t errkey
uint32_t key_used_on_scan
uint32_t active_index
uint32_t ref_length
enum drizzled::Cursor:: { ... }  inited
bool locked
uint64_t next_insert_id
uint64_t insert_id_for_cur_row
Discrete_interval auto_inc_interval_for_cur_row
Protected Member Functions inherited from drizzled::Cursor
void ha_statistic_increment (uint64_t system_status_var::*offset) const
void ** ha_data (Session *) const
Protected Attributes inherited from drizzled::Cursor
ha_rows estimation_rows_to_insert

Detailed Description

Definition at line 26 of file ha_myisam.h.

Constructor & Destructor Documentation

◆ ha_myisam()

ha_myisam::ha_myisam ( drizzled::plugin::StorageEngine & engine,
drizzled::Table & table_arg )

Definition at line 546 of file ha_myisam.cc.

◆ ~ha_myisam()

ha_myisam::~ha_myisam ( )
inline

Definition at line 36 of file ha_myisam.h.

Member Function Documentation

◆ checksum()

uint32_t ha_myisam::checksum ( ) const

Definition at line 1468 of file ha_myisam.cc.

◆ clone()

Cursor * ha_myisam::clone ( drizzled::memory::Root * mem_root)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 554 of file ha_myisam.cc.

◆ close()

int ha_myisam::close ( void )
virtual

Implements drizzled::Cursor.

Definition at line 649 of file ha_myisam.cc.

◆ delete_all_rows()

int ha_myisam::delete_all_rows ( void )
virtual

This is called to delete all rows in a table If the Cursor don't support this, then this function will return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one by one.

Reimplemented from drizzled::Cursor.

Definition at line 1310 of file ha_myisam.cc.

◆ disable_indexes()

int ha_myisam::disable_indexes ( uint32_t mode)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 832 of file ha_myisam.cc.

◆ doDeleteRecord()

int ha_myisam::doDeleteRecord ( const unsigned char * buf)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1039 of file ha_myisam.cc.

◆ doEndIndexScan()

int ha_myisam::doEndIndexScan ( void )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1053 of file ha_myisam.cc.

◆ doInsertRecord()

int ha_myisam::doInsertRecord ( unsigned char * buf)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 656 of file ha_myisam.cc.

◆ doOpen()

int ha_myisam::doOpen ( const drizzled::identifier::Table & identifier,
int mode,
uint32_t test_if_locked )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 568 of file ha_myisam.cc.

◆ doStartIndexScan()

int ha_myisam::doStartIndexScan ( uint32_t idx,
bool sorted )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1045 of file ha_myisam.cc.

◆ doStartTableScan()

int ha_myisam::doStartTableScan ( bool scan)
virtual

doStartTableScan() can be called two times without doEndTableScan() in between (it only makes sense if scan=1). then the second call should prepare for the new table scan (e.g if rnd_init allocates the cursor, second call should position it to the start of the table, no need to deallocate and allocate it again

Implements drizzled::Cursor.

Definition at line 1169 of file ha_myisam.cc.

◆ doUpdateRecord()

int ha_myisam::doUpdateRecord ( const unsigned char * old_data,
unsigned char * new_data )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1034 of file ha_myisam.cc.

◆ enable_indexes()

int ha_myisam::enable_indexes ( uint32_t mode)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 884 of file ha_myisam.cc.

◆ end_bulk_insert()

int ha_myisam::end_bulk_insert ( void )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1024 of file ha_myisam.cc.

◆ external_lock()

int ha_myisam::external_lock ( drizzled::Session * ,
int  )
virtual

Is not invoked for non-transactional temporary tables.

Tells the storage engine that we intend to read or write data from the table. This call is prefixed with a call to Cursor::store_lock() and is invoked only for those Cursor instances that stored the lock.

Calls to rnd_init/index_init are prefixed with this call. When table IO is complete, we call external_lock(F_UNLCK). A storage engine writer should expect that each call to ::external_lock(F_[RD|WR]LOCK is followed by a call to ::external_lock(F_UNLCK). If it is not, it is a bug in MySQL.

The name and signature originate from the first implementation in MyISAM, which would call fcntl to set/clear an advisory lock on the data file in this method.

Parameters
lock_typeF_RDLCK, F_WRLCK, F_UNLCK
Returns
non-0 in case of failure, 0 in case of success. When lock_type is F_UNLCK, the return value is ignored.

Reimplemented from drizzled::Cursor.

Definition at line 1324 of file ha_myisam.cc.

◆ extra()

int ha_myisam::extra ( enum drizzled::ha_extra_function operation)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1293 of file ha_myisam.cc.

◆ extra_opt()

int ha_myisam::extra_opt ( enum drizzled::ha_extra_function operation,
uint32_t cache_size )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1305 of file ha_myisam.cc.

◆ file_ptr()

MI_INFO * ha_myisam::file_ptr ( void )
inline

Definition at line 79 of file ha_myisam.h.

◆ get_auto_increment()

void ha_myisam::get_auto_increment ( uint64_t offset,
uint64_t increment,
uint64_t nb_desired_values,
uint64_t * first_value,
uint64_t * nb_reserved_values )
virtual

Implements drizzled::Cursor.

Definition at line 1387 of file ha_myisam.cc.

◆ index_first()

int ha_myisam::index_first ( unsigned char * buf)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1110 of file ha_myisam.cc.

◆ index_last()

int ha_myisam::index_last ( unsigned char * buf)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1119 of file ha_myisam.cc.

◆ index_next()

int ha_myisam::index_next ( unsigned char * buf)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1092 of file ha_myisam.cc.

◆ index_next_same()

int ha_myisam::index_next_same ( unsigned char * buf,
const unsigned char * key,
uint32_t keylen )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1128 of file ha_myisam.cc.

◆ index_prev()

int ha_myisam::index_prev ( unsigned char * buf)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1101 of file ha_myisam.cc.

◆ index_read_idx_map()

int ha_myisam::index_read_idx_map ( unsigned char * buf,
uint32_t index,
const unsigned char * key,
drizzled::key_part_map keypart_map,
enum drizzled::ha_rkey_function find_flag )
virtual

Positions an index cursor to the index specified in the handle. Fetches the row if available. If the key value is null, begin at the first key of the index.

Reimplemented from drizzled::Cursor.

Definition at line 1071 of file ha_myisam.cc.

◆ index_read_last_map()

int ha_myisam::index_read_last_map ( unsigned char * buf,
const unsigned char * key,
drizzled::key_part_map keypart_map )
virtual

The following functions works like index_read, but it find the last row with the current key value or prefix.

Reimplemented from drizzled::Cursor.

Definition at line 1081 of file ha_myisam.cc.

◆ index_read_map()

int ha_myisam::index_read_map ( unsigned char * buf,
const unsigned char * key,
drizzled::key_part_map keypart_map,
enum drizzled::ha_rkey_function find_flag )
virtual

Positions an index cursor to the index specified in the handle. Fetches the row if available. If the key value is null, begin at the first key of the index.

Reimplemented from drizzled::Cursor.

Definition at line 1060 of file ha_myisam.cc.

◆ index_type()

const char * ha_myisam::index_type ( uint32_t key_number)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 562 of file ha_myisam.cc.

◆ indexes_are_disabled()

int ha_myisam::indexes_are_disabled ( void )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 959 of file ha_myisam.cc.

◆ info()

int ha_myisam::info ( uint )

Definition at line 1199 of file ha_myisam.cc.

◆ isOrdered()

virtual bool ha_myisam::isOrdered ( void )
inlinevirtual

Reimplemented from drizzled::Cursor.

Definition at line 88 of file ha_myisam.h.

◆ position()

void ha_myisam::position ( const unsigned char * record)
virtual

Implements drizzled::Cursor.

Definition at line 1193 of file ha_myisam.cc.

◆ read_range_first()

int ha_myisam::read_range_first ( const drizzled::key_range * start_key,
const drizzled::key_range * end_key,
bool eq_range_arg,
bool sorted )
virtual

Read first row between two ranges.

Parameters
start_keyStart key. Is 0 if no min range
end_keyEnd key. Is 0 if no max range
eq_range_argSet to 1 if start_key == end_key
sortedSet to 1 if result should be sorted per key
Note
Record is read into table->getInsertRecord()
Return values
0Found row
HA_ERR_END_OF_FILENo rows in range

# Error code

Reimplemented from drizzled::Cursor.

Definition at line 1143 of file ha_myisam.cc.

◆ read_range_next()

int ha_myisam::read_range_next ( )
virtual

Read next row between two endpoints.

Note
Record is read into table->getInsertRecord()
Return values
0Found row
HA_ERR_END_OF_FILENo rows in range

# Error code

Reimplemented from drizzled::Cursor.

Definition at line 1160 of file ha_myisam.cc.

◆ records_in_range()

ha_rows ha_myisam::records_in_range ( uint32_t inx,
drizzled::key_range * min_key,
drizzled::key_range * max_key )
virtual

Reimplemented from drizzled::Cursor.

Definition at line 1461 of file ha_myisam.cc.

◆ repair()

int ha_myisam::repair ( drizzled::Session * session,
MI_CHECK & param,
bool optimize )
private

Definition at line 672 of file ha_myisam.cc.

◆ reset()

int ha_myisam::reset ( void )
virtual

Reset state of file to after 'open'. This function is called after every statement for all tables used by that statement.

Reimplemented from drizzled::Cursor.

Definition at line 1298 of file ha_myisam.cc.

◆ reset_auto_increment()

int ha_myisam::reset_auto_increment ( uint64_t )
virtual

Reset the auto-increment counter to the given value, i.e. the next row inserted will get the given value. This is called e.g. after TRUNCATE is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is returned by storage engines that don't support this operation.

Reimplemented from drizzled::Cursor.

Definition at line 350 of file ha_myisam.cc.

◆ rnd_next()

int ha_myisam::rnd_next ( unsigned char * buf)
virtual

Implements drizzled::Cursor.

Definition at line 1176 of file ha_myisam.cc.

◆ rnd_pos()

int ha_myisam::rnd_pos ( unsigned char * buf,
unsigned char * pos )
virtual

Implements drizzled::Cursor.

Definition at line 1184 of file ha_myisam.cc.

◆ start_bulk_insert()

void ha_myisam::start_bulk_insert ( drizzled::ha_rows rows)
virtual

Reimplemented from drizzled::Cursor.

Definition at line 980 of file ha_myisam.cc.

Member Data Documentation

◆ can_enable_indexes

bool ha_myisam::can_enable_indexes
private

Definition at line 29 of file ha_myisam.h.

◆ file

MI_INFO* ha_myisam::file
private

Definition at line 28 of file ha_myisam.h.

◆ is_ordered

bool ha_myisam::is_ordered
private

Definition at line 30 of file ha_myisam.h.

◆ keys_with_parts

drizzled::key_map ha_myisam::keys_with_parts
private

Definition at line 94 of file ha_myisam.h.


The documentation for this class was generated from the following files: