InnoDB Plugin  1.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ha_innobase Class Reference

#include <ha_innodb.h>

Collaboration diagram for ha_innobase:
Collaboration graph
[legend]

Public Member Functions

 ha_innobase (handlerton *hton, TABLE_SHARE *table_arg)
enum row_type get_row_type () const
const char * table_type () const
const char * index_type (uint key_number)
const char ** bas_ext () const
Table_flags table_flags () const
ulong index_flags (uint idx, uint part, bool all_parts) const
uint max_supported_keys () const
uint max_supported_key_length () const
uint max_supported_key_part_length () const
const key_map * keys_to_use_for_scanning ()
int open (const char *name, int mode, uint test_if_locked)
handler * clone (const char *name, MEM_ROOT *mem_root)
int close (void)
double scan_time ()
double read_time (uint index, uint ranges, ha_rows rows)
longlong get_memory_buffer_size () const
int write_row (uchar *buf)
int update_row (const uchar *old_data, uchar *new_data)
int delete_row (const uchar *buf)
bool was_semi_consistent_read ()
void try_semi_consistent_read (bool yes)
void unlock_row ()
int index_init (uint index, bool sorted)
int index_end ()
int index_read (uchar *buf, const uchar *key, uint key_len, enum ha_rkey_function find_flag)
int index_read_idx (uchar *buf, uint index, const uchar *key, uint key_len, enum ha_rkey_function find_flag)
int index_read_last (uchar *buf, const uchar *key, uint key_len)
int index_next (uchar *buf)
int index_next_same (uchar *buf, const uchar *key, uint keylen)
int index_prev (uchar *buf)
int index_first (uchar *buf)
int index_last (uchar *buf)
int rnd_init (bool scan)
int rnd_end ()
int rnd_next (uchar *buf)
int rnd_pos (uchar *buf, uchar *pos)
int ft_init ()
void ft_end ()
FT_INFO * ft_init_ext (uint flags, uint inx, String *key)
int ft_read (uchar *buf)
void position (const uchar *record)
int info (uint)
int analyze (THD *thd, HA_CHECK_OPT *check_opt)
int optimize (THD *thd, HA_CHECK_OPT *check_opt)
int discard_or_import_tablespace (my_bool discard)
int extra (enum ha_extra_function operation)
int reset ()
int external_lock (THD *thd, int lock_type)
int transactional_table_lock (THD *thd, int lock_type)
int start_stmt (THD *thd, thr_lock_type lock_type)
void position (uchar *record)
ha_rows records_in_range (uint inx, key_range *min_key, key_range *max_key)
ha_rows estimate_rows_upper_bound ()
void update_create_info (HA_CREATE_INFO *create_info)
int parse_table_name (const char *name, HA_CREATE_INFO *create_info, ulint flags, ulint flags2, char *norm_name, char *temp_path, char *remote_path)
int create (const char *name, register TABLE *form, HA_CREATE_INFO *create_info)
int truncate ()
int delete_table (const char *name)
int rename_table (const char *from, const char *to)
int check (THD *thd, HA_CHECK_OPT *check_opt)
char * update_table_comment (const char *comment)
char * get_foreign_key_create_info ()
int get_foreign_key_list (THD *thd, List< FOREIGN_KEY_INFO > *f_key_list)
int get_parent_foreign_key_list (THD *thd, List< FOREIGN_KEY_INFO > *f_key_list)
bool can_switch_engines ()
uint referenced_by_foreign_key ()
void free_foreign_key_create_info (char *str)
THR_LOCK_DATA ** store_lock (THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type)
void init_table_handle_for_HANDLER ()
virtual void get_auto_increment (ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values)
int reset_auto_increment (ulonglong value)
virtual bool get_error_message (int error, String *buf)
virtual bool get_foreign_dup_key (char *, uint, char *, uint)
uint8 table_cache_type ()
my_bool register_query_cache_table (THD *thd, char *table_key, uint key_length, qc_engine_callback *call_back, ulonglong *engine_data)
bool primary_key_is_clustered ()
int cmp_ref (const uchar *ref1, const uchar *ref2)
bool check_if_incompatible_data (HA_CREATE_INFO *info, uint table_changes)
enum_alter_inplace_result check_if_supported_inplace_alter (TABLE *altered_table, Alter_inplace_info *ha_alter_info)
bool prepare_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info)
bool inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info)
bool commit_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit)

Static Public Member Functions

static const char * get_mysql_bin_log_name ()
static ulonglong get_mysql_bin_log_pos ()

Private Member Functions

uint store_key_val_for_row (uint keynr, char *buff, uint buff_len, const uchar *record)
void update_thd (THD *thd)
void update_thd ()
int change_active_index (uint keynr)
int general_fetch (uchar *buf, uint direction, uint match_mode)
dberr_t innobase_lock_autoinc ()
ulonglong innobase_peek_autoinc ()
dberr_t innobase_set_max_autoinc (ulonglong auto_inc)
dberr_t innobase_reset_autoinc (ulonglong auto_inc)
dberr_t innobase_get_autoinc (ulonglong *value)
void innobase_initialize_autoinc ()
dict_index_tinnobase_get_index (uint keynr)
void build_template (bool whole_row)
void reset_template ()
int info_low (uint, bool)

Private Attributes

row_prebuilt_tprebuilt
THD * user_thd
THR_LOCK_DATA lock
INNOBASE_SHAREshare
uchar * upd_buf
ulint upd_buf_size
Table_flags int_table_flags
uint primary_key
ulong start_of_scan
uint last_match_mode
uint num_write_row

Multi Range Read interface @{

DsMrr_impl ds_mrr
int multi_range_read_init (RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf)
int multi_range_read_next (char **range_info)
ha_rows multi_range_read_info_const (uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, uint *flags, Cost_estimate *cost)
ha_rows multi_range_read_info (uint keyno, uint n_ranges, uint keys, uint *bufsz, uint *flags, Cost_estimate *cost)
class Item * idx_cond_push (uint keyno, class Item *idx_cond)

Detailed Description

The class defining a handle to an Innodb table

Member Function Documentation

void ha_innobase::build_template ( bool  whole_row)
private
Builds a 'template' to the prebuilt struct.

The template is used in fast retrieval of just those column values MySQL needs in its processing.

Parameters
whole_rowtrue if access is needed to a whole row, false if accessing individual fields is enough
enum_alter_inplace_result ha_innobase::check_if_supported_inplace_alter ( TABLE *  altered_table,
Alter_inplace_info *  ha_alter_info 
)

On-line ALTER TABLE interface

See Also
handler0alter.cc Check if InnoDB supports a particular alter table in-place
Parameters
altered_tableTABLE object for new version of table.
ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
Return values
HA_ALTER_INPLACE_NOT_SUPPORTEDNot supported
HA_ALTER_INPLACE_NO_LOCKSupported
HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARESupported, but requires lock during main phase and exclusive lock during prepare phase.
HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARESupported, prepare phase requires exclusive lock.
bool ha_innobase::commit_inplace_alter_table ( TABLE *  altered_table,
Alter_inplace_info *  ha_alter_info,
bool  commit 
)
Commit or rollback the changes made during

prepare_inplace_alter_table() and inplace_alter_table() inside the storage engine. Note that the allowed level of concurrency during this operation will be the same as for inplace_alter_table() and thus might be higher than during prepare_inplace_alter_table(). (E.g concurrent writes were blocked during prepare, but might not be during commit).

Parameters
altered_tableTABLE object for new version of table.
ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
committrue => Commit, false => Rollback.
Return values
trueFailure
falseSuccess
class Item* ha_innobase::idx_cond_push ( uint  keyno,
class Item *  idx_cond 
)

Attempt to push down an index condition.

Parameters
[in]keynoMySQL key number
[in]idx_condIndex condition to be checked
Returns
idx_cond if pushed; NULL if not pushed
bool ha_innobase::inplace_alter_table ( TABLE *  altered_table,
Alter_inplace_info *  ha_alter_info 
)
Alter the table structure in-place with operations

specified using HA_ALTER_FLAGS and Alter_inplace_information. The level of concurrency allowed during this operation depends on the return value from check_if_supported_inplace_alter().

Parameters
altered_tableTABLE object for new version of table.
ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
Return values
trueFailure
falseSuccess
ha_rows ha_innobase::multi_range_read_info ( uint  keyno,
uint  n_ranges,
uint  keys,
uint *  bufsz,
uint *  flags,
Cost_estimate *  cost 
)

Initialize multi range read and get information.

See Also
DsMrr_impl::dsmrr_info
Parameters
keyno
seq
seq_init_param
n_ranges
bufsz
flags
cost
ha_rows ha_innobase::multi_range_read_info_const ( uint  keyno,
RANGE_SEQ_IF *  seq,
void *  seq_init_param,
uint  n_ranges,
uint *  bufsz,
uint *  flags,
Cost_estimate *  cost 
)

Initialize multi range read and get information.

See Also
ha_myisam::multi_range_read_info_const
DsMrr_impl::dsmrr_info_const
Parameters
keyno
seq
seq_init_param
n_ranges
bufsz
flags
cost
int ha_innobase::multi_range_read_init ( RANGE_SEQ_IF *  seq,
void *  seq_init_param,
uint  n_ranges,
uint  mode,
HANDLER_BUFFER *  buf 
)

Initialize multi range read

See Also
DsMrr_impl::dsmrr_init
Parameters
seq
seq_init_param
n_ranges
mode
buf
int ha_innobase::multi_range_read_next ( char **  range_info)

Process next multi range read

See Also
DsMrr_impl::dsmrr_next
Parameters
range_info
bool ha_innobase::prepare_inplace_alter_table ( TABLE *  altered_table,
Alter_inplace_info *  ha_alter_info 
)
Allows InnoDB to update internal structures with concurrent

writes blocked (provided that check_if_supported_inplace_alter() did not return HA_ALTER_INPLACE_NO_LOCK). This will be invoked before inplace_alter_table().

Parameters
altered_tableTABLE object for new version of table.
ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
Return values
trueFailure
falseSuccess
void ha_innobase::reset_template ( )
inlineprivate
Resets a query execution 'template'.
See Also
build_template()

Field Documentation

DsMrr_impl ha_innobase::ds_mrr
private

The multi range read session object

uint ha_innobase::num_write_row
private

number of write_row() calls

row_prebuilt_t* ha_innobase::prebuilt
private

prebuilt struct in InnoDB, used to save CPU time with prebuilt data structures

INNOBASE_SHARE* ha_innobase::share
private

information for MySQL table locking

ulong ha_innobase::start_of_scan
private

this is set to 1 when we are starting a table scan but have not yet fetched any row, else 0

uchar* ha_innobase::upd_buf
private

buffer used in updates

ulint ha_innobase::upd_buf_size
private

the size of upd_buf in bytes

THD* ha_innobase::user_thd
private

the thread handle of the user currently using the handle; this is set in external_lock function


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