MySQL 5.6.14 Source Code Document
|
#include <ha_innodb.h>
Public Member Functions | |
ha_innobase (handlerton *hton, TABLE_SHARE *table_arg) | |
~ha_innobase () | |
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) |
Register a named table with a call back function to the query cache. | |
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) |
Public Member Functions inherited from handler | |
virtual void | unbind_psi () |
virtual void | rebind_psi () |
handler (handlerton *ht_arg, TABLE_SHARE *share_arg) | |
void | init () |
int | ha_open (TABLE *table, const char *name, int mode, int test_if_locked) |
Open database-handler. | |
int | ha_close (void) |
int | ha_index_init (uint idx, bool sorted) |
int | ha_index_end () |
int | ha_rnd_init (bool scan) |
int | ha_rnd_end () |
int | ha_rnd_next (uchar *buf) |
int | ha_rnd_pos (uchar *buf, uchar *pos) |
int | ha_index_read_map (uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) |
int | ha_index_read_last_map (uchar *buf, const uchar *key, key_part_map keypart_map) |
int | ha_index_read_idx_map (uchar *buf, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) |
int | ha_index_next (uchar *buf) |
int | ha_index_prev (uchar *buf) |
int | ha_index_first (uchar *buf) |
int | ha_index_last (uchar *buf) |
int | ha_index_next_same (uchar *buf, const uchar *key, uint keylen) |
int | ha_index_read (uchar *buf, const uchar *key, uint key_len, enum ha_rkey_function find_flag) |
int | ha_index_read_last (uchar *buf, const uchar *key, uint key_len) |
int | ha_reset () |
Check handler usage and reset state of file to after 'open'. | |
int | ha_index_or_rnd_end () |
Table_flags | ha_table_flags () const |
int | ha_external_lock (THD *thd, int lock_type) |
int | ha_write_row (uchar *buf) |
int | ha_update_row (const uchar *old_data, uchar *new_data) |
int | ha_delete_row (const uchar *buf) |
void | ha_release_auto_increment () |
int | check_collation_compatibility () |
int | ha_check_for_upgrade (HA_CHECK_OPT *check_opt) |
int | ha_check (THD *thd, HA_CHECK_OPT *check_opt) |
int | ha_repair (THD *thd, HA_CHECK_OPT *check_opt) |
void | ha_start_bulk_insert (ha_rows rows) |
int | ha_end_bulk_insert () |
int | ha_bulk_update_row (const uchar *old_data, uchar *new_data, uint *dup_key_found) |
int | ha_delete_all_rows () |
int | ha_truncate () |
int | ha_reset_auto_increment (ulonglong value) |
int | ha_optimize (THD *thd, HA_CHECK_OPT *check_opt) |
int | ha_analyze (THD *thd, HA_CHECK_OPT *check_opt) |
bool | ha_check_and_repair (THD *thd) |
int | ha_disable_indexes (uint mode) |
int | ha_enable_indexes (uint mode) |
int | ha_discard_or_import_tablespace (my_bool discard) |
int | ha_rename_table (const char *from, const char *to) |
int | ha_delete_table (const char *name) |
void | ha_drop_table (const char *name) |
int | ha_create (const char *name, TABLE *form, HA_CREATE_INFO *info) |
int | ha_create_handler_files (const char *name, const char *old_name, int action_flag, HA_CREATE_INFO *info) |
int | ha_change_partitions (HA_CREATE_INFO *create_info, const char *path, ulonglong *const copied, ulonglong *const deleted, const uchar *pack_frm_data, size_t pack_frm_len) |
int | ha_drop_partitions (const char *path) |
int | ha_rename_partitions (const char *path) |
void | adjust_next_insert_id_after_explicit_value (ulonglong nr) |
int | update_auto_increment () |
virtual void | print_error (int error, myf errflag) |
uint | get_dup_key (int error) |
virtual void | change_table_ptr (TABLE *table_arg, TABLE_SHARE *share) |
virtual double | index_only_read_time (uint keynr, double records) |
bool | has_transactions () |
virtual uint | extra_rec_buf_length () const |
virtual bool | is_fatal_error (int error, uint flags) |
virtual ha_rows | records () |
virtual void | column_bitmaps_signal () |
MySQL signal that it changed the column bitmap. | |
uint | get_index (void) const |
virtual bool | start_bulk_update () |
virtual bool | start_bulk_delete () |
virtual int | exec_bulk_update (uint *dup_key_found) |
virtual void | end_bulk_update () |
virtual int | end_bulk_delete () |
virtual int | read_range_first (const key_range *start_key, const key_range *end_key, bool eq_range, bool sorted) |
Read first row between two ranges. Store ranges for future calls to read_range_next. | |
virtual int | read_range_next () |
Read next row between two endpoints. | |
void | set_end_range (const key_range *range, enum_range_scan_direction direction) |
int | compare_key (key_range *range) |
int | compare_key_icp (const key_range *range) const |
virtual int | rnd_pos_by_record (uchar *record) |
virtual int | read_first_row (uchar *buf, uint primary_key) |
virtual int | restart_rnd_next (uchar *buf, uchar *pos) |
virtual int | rnd_same (uchar *buf, uint inx) |
virtual void | get_dynamic_partition_info (PARTITION_STATS *stat_info, uint part_id) |
virtual uint32 | calculate_key_hash_value (Field **field_array) |
virtual int | extra_opt (enum ha_extra_function operation, ulong cache_size) |
virtual bool | start_read_removal (void) |
virtual ha_rows | end_read_removal (void) |
void | set_next_insert_id (ulonglong id) |
void | restore_auto_increment (ulonglong prev_insert_id) |
int | check_old_types () |
virtual int | assign_to_keycache (THD *thd, HA_CHECK_OPT *check_opt) |
virtual int | preload_keys (THD *thd, HA_CHECK_OPT *check_opt) |
virtual int | indexes_are_disabled (void) |
virtual void | append_create_info (String *packet) |
virtual bool | is_fk_defined_on_table_or_index (uint index) |
virtual int | get_default_no_partitions (HA_CREATE_INFO *info) |
virtual void | set_auto_partitions (partition_info *part_info) |
virtual bool | get_no_parts (const char *name, uint *no_parts) |
virtual void | set_part_info (partition_info *part_info, bool early) |
uint | max_record_length () const |
uint | max_keys () const |
uint | max_key_parts () const |
uint | max_key_length () const |
uint | max_key_part_length () const |
virtual uint | max_supported_record_length () const |
virtual uint | max_supported_key_parts () const |
virtual uint | min_record_length (uint options) const |
virtual bool | low_byte_first () const |
virtual uint | checksum () const |
virtual bool | is_crashed () const |
virtual bool | auto_repair () const |
virtual uint | lock_count (void) const |
virtual const Item * | cond_push (const Item *cond) |
virtual void | cond_pop () |
virtual void | cancel_pushed_idx_cond () |
virtual uint | number_of_pushed_joins () const |
virtual const TABLE * | root_of_pushed_join () const |
virtual const TABLE * | parent_of_pushed_join () const |
virtual int | index_read_pushed (uchar *buf, const uchar *key, key_part_map keypart_map) |
virtual int | index_next_pushed (uchar *buf) |
bool | ha_prepare_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info) |
bool | ha_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info) |
bool | ha_commit_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit) |
void | ha_notify_table_changed () |
virtual void | use_hidden_primary_key () |
virtual uint | alter_table_flags (uint flags) |
virtual int | bulk_update_row (const uchar *old_data, uchar *new_data, uint *dup_key_found) |
virtual int | delete_all_rows () |
virtual bool | check_and_repair (THD *thd) |
virtual int | disable_indexes (uint mode) |
virtual int | enable_indexes (uint mode) |
virtual void | drop_table (const char *name) |
virtual int | create (const char *name, TABLE *form, HA_CREATE_INFO *info)=0 |
virtual int | create_handler_files (const char *name, const char *old_name, int action_flag, HA_CREATE_INFO *info) |
virtual int | change_partitions (HA_CREATE_INFO *create_info, const char *path, ulonglong *const copied, ulonglong *const deleted, const uchar *pack_frm_data, size_t pack_frm_len) |
virtual int | drop_partitions (const char *path) |
virtual int | rename_partitions (const char *path) |
virtual bool | set_ha_share_ref (Handler_share **arg_ha_share) |
int | get_lock_type () const |
Static Public Member Functions | |
static const char * | get_mysql_bin_log_name () |
static ulonglong | get_mysql_bin_log_pos () |
Multi Range Read interface @{ | |
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) |
Additional Inherited Members | |
Public Types inherited from handler | |
enum | enum_range_scan_direction { RANGE_SCAN_ASC, RANGE_SCAN_DESC } |
enum | { NONE = 0, INDEX, RND } |
typedef ulonglong | Table_flags |
Public Attributes inherited from handler | |
handlerton * | ht |
uchar * | ref |
uchar * | dup_ref |
ha_statistics | stats |
range_seq_t | mrr_iter |
RANGE_SEQ_IF | mrr_funcs |
HANDLER_BUFFER * | multi_range_buffer |
uint | ranges_in_seq |
bool | mrr_is_output_sorted |
bool | mrr_have_range |
KEY_MULTI_RANGE | mrr_cur_range |
key_range * | end_range |
uint | errkey |
uint | key_used_on_scan |
uint | active_index |
uint | ref_length |
FT_INFO * | ft_handler |
enum handler:: { ... } | inited |
bool | implicit_emptied |
const Item * | pushed_cond |
Item * | pushed_idx_cond |
uint | pushed_idx_cond_keyno |
ulonglong | next_insert_id |
ulonglong | insert_id_for_cur_row |
Discrete_interval | auto_inc_interval_for_cur_row |
uint | auto_inc_intervals_count |
PSI_table * | m_psi |
Protected Member Functions inherited from handler | |
virtual int | index_read_map (uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) |
Positions an index cursor to the index specified in the handle ('active_index'). Fetches the row if available. If the key value is null, begin at the first key of the index. | |
virtual int | index_read_idx_map (uchar *buf, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) |
Positions an index cursor to the index specified in argument. Fetches the row if available. If the key value is null, begin at the first key of the index. | |
virtual int | index_read_last_map (uchar *buf, const uchar *key, 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. | |
virtual void | notify_table_changed () |
void | ha_statistic_increment (ulonglong SSV::*offset) const |
void ** | ha_data (THD *) const |
THD * | ha_thd (void) const |
PSI_table_share * | ha_table_share_psi (const TABLE_SHARE *share) const |
Handler_share * | get_ha_share_ptr () |
void | set_ha_share_ptr (Handler_share *arg_ha_share) |
void | lock_shared_ha_data () |
void | unlock_shared_ha_data () |
Protected Attributes inherited from handler | |
TABLE_SHARE * | table_share |
TABLE * | table |
Table_flags | cached_table_flags |
ha_rows | estimation_rows_to_insert |
KEY_PART_INFO * | range_key_part |
bool | eq_range |
bool | in_range_check_pushed_down |
The class defining a handle to an Innodb table
Definition at line 60 of file ha_innodb.h.
UNIV_INTERN ha_innobase::ha_innobase | ( | handlerton * | hton, |
TABLE_SHARE * | table_arg | ||
) |
Construct ha_innobase handler.
Definition at line 2188 of file ha_innodb.cc.
UNIV_INTERN ha_innobase::~ha_innobase | ( | ) |
Destruct ha_innobase handler.
Definition at line 2210 of file ha_innodb.cc.
|
virtual |
Returns the table file name extension.
Implements handler.
Definition at line 3934 of file ha_innodb.cc.
|
virtual |
Used in ALTER TABLE to check if changing storage engine is allowed.
true | Changing storage engine is allowed. |
false | Changing storage engine not allowed. |
Reimplemented from handler.
|
virtual |
Part of old, deprecated in-place ALTER API.
Reimplemented from handler.
|
virtual |
On-line ALTER TABLE interface
altered_table | TABLE object for new version of table. |
ha_alter_info | Structure describing changes to be done by ALTER TABLE and holding data used during in-place alter. |
HA_ALTER_INPLACE_NOT_SUPPORTED | Not supported |
HA_ALTER_INPLACE_NO_LOCK | Supported |
HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE | Supported, but requires lock during main phase and exclusive lock during prepare phase. |
HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE | Supported, prepare phase requires exclusive lock. |
Check if InnoDB supports a particular alter table in-place
altered_table | TABLE object for new version of table. |
ha_alter_info | Structure describing changes to be done by ALTER TABLE and holding data used during in-place alter. |
HA_ALTER_INPLACE_NOT_SUPPORTED | Not supported |
HA_ALTER_INPLACE_NO_LOCK | Supported |
HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE | Supported, but requires lock during main phase and exclusive lock during prepare phase. |
HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE | Supported, prepare phase requires exclusive lock (any transactions that have accessed the table must commit or roll back first, and no transactions can access the table while prepare_inplace_alter_table() is executing) |
Reimplemented from handler.
Definition at line 225 of file handler0alter.cc.
name | in: table name |
mem_root | in: memory context |
Reimplemented from handler.
Definition at line 5010 of file ha_innodb.cc.
|
virtual |
Closes a handle to an InnoDB table.
Implements handler.
Definition at line 5048 of file ha_innodb.cc.
|
virtual |
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).
altered_table | TABLE object for new version of table. |
ha_alter_info | Structure describing changes to be done by ALTER TABLE and holding data used during in-place alter. |
commit | true => Commit, false => Rollback. |
true | Failure |
false | Success |
Reimplemented from handler.
UNIV_INTERN int ha_innobase::delete_row | ( | const uchar * | record | ) |
Deletes a row given as the parameter.
record | in: a row in MySQL format |
Definition at line 7116 of file ha_innodb.cc.
|
virtual |
Delete a table in the engine. Called for base as well as temporary tables.
Delete all files with extension from bas_ext().
name | Base name of table |
0 | If we successfully deleted at least one file from base_ext and didn't get any other errors than ENOENT |
!0 | Error |
Reimplemented from handler.
|
virtual |
Return upper bound of current number of records in the table (max. of how many records one will retrieve when doing a full table scan) If upper bound is not known, HA_POS_ERROR should be returned as a max possible upper bound.
Reimplemented from handler.
|
virtual |
Initialize FT index scan
Reimplemented from handler.
Definition at line 7984 of file ha_innodb.cc.
Initialize FT index scan
Reimplemented from handler.
Definition at line 8008 of file ha_innodb.cc.
|
virtual |
Fetch next result from the FT result set
buf | in/out: buf contain result row |
Reimplemented from handler.
Definition at line 8164 of file ha_innodb.cc.
|
virtual |
Reserves an interval of auto_increment values from the handler.
offset | offset (modulus increment) | |
increment | increment between calls | |
nb_desired_values | how many values we want | |
[out] | first_value | the first value reserved by the handler |
[out] | nb_reserved_values | how many values the handler reserved |
offset and increment means that we want values to be of the form offset + N * increment, where N>=0 is integer. If the function sets *first_value to ULONGLONG_MAX it means an error. If the function sets *nb_reserved_values to ULONGLONG_MAX it means it has reserved to "positive infinite".
Reimplemented from handler.
|
virtual |
|
virtual |
Retrieves the names of the table and the key for which there was a duplicate entry in the case of HA_ERR_FOREIGN_DUPLICATE_KEY.
If any of the table or key name is not available this method will return false and will not change any of child_table_name or child_key_name.
child_table_name[out] | Table name |
child_table_name_len[in] | Table name buffer size |
child_key_name[out] | Key name |
child_key_name_len[in] | Key name buffer size |
true | table and key names were available and were written into the corresponding out parameters. |
false | table and key names were not available, the out parameters were not touched. |
Reimplemented from handler.
|
virtual |
Get the list of foreign keys in this table.
thd | The thread handle. |
f_key_list[out] | The list of foreign keys. |
Reimplemented from handler.
|
virtual |
Return an estimate on the amount of memory the storage engine will use for caching data in memory. If this is unknown or the storage engine does not cache data in memory -1 is returned.
Reimplemented from handler.
|
virtual |
Get the list of foreign keys referencing this table.
thd | The thread handle. |
f_key_list[out] | The list of foreign keys. |
Reimplemented from handler.
|
virtual |
InnoDB database tables Get the record format from the data dictionary.
Reimplemented from handler.
Definition at line 3850 of file ha_innodb.cc.
Attempt to push down an index condition.
[in] | keyno | MySQL key number |
[in] | idx_cond | Index condition to be checked |
Attempt to push down an index condition.
[in] | keyno | MySQL key number |
[in] | idx_cond | Index condition to be checked |
Reimplemented from handler.
Definition at line 16708 of file ha_innodb.cc.
|
virtual |
Currently does nothing.
Reimplemented from handler.
Definition at line 7253 of file ha_innodb.cc.
|
virtual |
Positions a cursor on the first record in an index and reads the corresponding row to buf.
buf | in/out: buffer for the row |
Reimplemented from handler.
Definition at line 7826 of file ha_innodb.cc.
|
virtual |
Returns the operations supported for indexes.
Implements handler.
Definition at line 3945 of file ha_innodb.cc.
|
virtual |
Initializes a handle to use an index.
keynr | in: key (index) number |
sorted | in: 1 if result MUST be sorted according to index |
Reimplemented from handler.
Definition at line 7238 of file ha_innodb.cc.
|
virtual |
Positions a cursor on the last record in an index and reads the corresponding row to buf.
buf | in/out: buffer for the row |
Reimplemented from handler.
Definition at line 7852 of file ha_innodb.cc.
|
virtual |
Reads the next row from a cursor, which must have previously been positioned using index_read.
buf | in/out: buffer for next row in MySQL format |
Reimplemented from handler.
Definition at line 7779 of file ha_innodb.cc.
|
virtual |
Reads the next row matching to the key value given as the parameter.
buf | in/out: buffer for the row |
key | in: key value |
keylen | in: key value length |
Reimplemented from handler.
Definition at line 7794 of file ha_innodb.cc.
|
virtual |
Reads the previous row from a cursor, which must have previously been positioned using index_read.
buf | in/out: buffer for previous row in MySQL format |
Reimplemented from handler.
Definition at line 7811 of file ha_innodb.cc.
|
virtual |
Positions an index cursor to the index specified in the handle. Fetches the row if any.
buf | in/out: buffer for the returned row |
key_ptr | in: key value; if this is NULL we position the cursor at the start or end of index; this can also contain an InnoDB row id, in which case key_len is the InnoDB row id length; the key value can also be a prefix of a full key value, and the last column can be a prefix of a full column |
key_len | in: key value length |
find_flag | in: search flags from my_base.h |
Reimplemented from handler.
Definition at line 7375 of file ha_innodb.cc.
UNIV_INTERN int ha_innobase::index_read_idx | ( | uchar * | buf, |
uint | keynr, | ||
const uchar * | key, | ||
uint | key_len, | ||
enum ha_rkey_function | find_flag | ||
) |
Positions an index cursor to the index specified in keynr. Fetches the row if any. ??? This is only used to read whole keys ???
buf | in/out: buffer for the returned row |
keynr | in: use this index |
key | in: key value; if this is NULL we position the cursor at the start or end of index |
key_len | in: key value length |
find_flag | in: search flags from my_base.h |
Definition at line 7681 of file ha_innodb.cc.
|
virtual |
The following functions works like index_read, but it find the last row with the current key value or prefix.
buf | out: fetched row |
key_ptr | in: key value, or a prefix of a full key value |
key_len | in: length of the key val or prefix in bytes |
Reimplemented from handler.
Definition at line 7527 of file ha_innodb.cc.
|
virtual |
Returns the index type.
keynr | : index number |
Reimplemented from handler.
Definition at line 3916 of file ha_innodb.cc.
|
virtual |
Call this when you have opened a new table handle in HANDLER, before you call index_read_idx() etc. Actually, we can let the cursor stay open even over a transaction commit! Then you should call this before every operation, fetch next etc. This function inits the necessary things even after a transaction commit.
Reimplemented from handler.
Definition at line 2699 of file ha_innodb.cc.
|
virtual |
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().
altered_table | TABLE object for new version of table. |
ha_alter_info | Structure describing changes to be done by ALTER TABLE and holding data used during in-place alter. |
true | Failure |
false | Success |
Reimplemented from handler.
|
virtual |
Returns the key map of keys that are usable for scanning.
Reimplemented from handler.
Definition at line 4004 of file ha_innodb.cc.
|
virtual |
Returns the maximum key length.
Reimplemented from handler.
Definition at line 3974 of file ha_innodb.cc.
|
virtual |
Returns the maximum number of keys.
Reimplemented from handler.
Definition at line 3963 of file ha_innodb.cc.
|
virtual |
Initialize multi range read and get information.
keyno | |
seq | |
seq_init_param | |
n_ranges | |
bufsz | |
flags | |
cost |
Reimplemented from handler.
Definition at line 16659 of file ha_innodb.cc.
|
virtual |
Initialize multi range read and get information.
keyno | |
seq | |
seq_init_param | |
n_ranges | |
bufsz | |
flags | |
cost |
Reimplemented from handler.
Definition at line 16643 of file ha_innodb.cc.
|
virtual |
Initialize multi range read
seq | |
seq_init_param | |
n_ranges | |
mode | |
buf | Multi Range Read interface, DS-MRR calls |
Reimplemented from handler.
Definition at line 16624 of file ha_innodb.cc.
|
virtual |
Process next multi range read
range_info |
Reimplemented from handler.
Definition at line 16636 of file ha_innodb.cc.
|
virtual |
Creates and opens a handle to a table which already exists in an InnoDB database.
name | in: table name |
mode | in: not used |
test_if_locked | in: not used |
Implements handler.
Definition at line 4627 of file ha_innodb.cc.
|
virtual |
Stores a reference to the current row to 'ref' field of the handle. Note that in the case where we have generated the clustered index for the table, the function parameter is illogical: we MUST ASSUME that 'record' is the current 'position' of the handle, because if row ref is actually the row id internally generated in InnoDB, then 'record' does not contain it. We just guess that the row id must be for the record where the handle was positioned the last time.
record | in: row in MySQL format |
Implements handler.
Definition at line 8318 of file ha_innodb.cc.
|
virtual |
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().
altered_table | TABLE object for new version of table. |
ha_alter_info | Structure describing changes to be done by ALTER TABLE and holding data used during in-place alter. |
true | Failure |
false | Success |
Reimplemented from handler.
|
virtual |
Determines if the primary key is clustered index.
Reimplemented from handler.
Definition at line 4026 of file ha_innodb.cc.
|
virtual |
The cost of reading a set of ranges from the table using an index to access it.
index | The index number. |
ranges | The number of ranges to be read. |
rows | Total number of rows to be read. |
This method can be used to calculate the total cost of scanning a table using an index by calling it using read_time(index, 1, table_size).
Reimplemented from handler.
|
virtual |
Register a named table with a call back function to the query cache.
thd | The thread handle | |
table_key | A pointer to the table name in the table cache | |
key_length | The length of the table name | |
[out] | engine_callback | The pointer to the storage engine call back function |
[out] | engine_data | Storage engine specific data which could be anything |
This method offers the storage engine, the possibility to store a reference to a table name which is going to be used with query cache. The method is called each time a statement is written to the cache and can be used to verify if a specific statement is cachable. It also offers the possibility to register a generic (but static) call back function which is called each time a statement is matched against the query cache.
TRUE | Success |
FALSE | The specified table or current statement should not be cached |
Reimplemented from handler.
|
virtual |
Default rename_table() and delete_table() rename/delete files with a given name and extensions from bas_ext().
These methods can be overridden, but their default implementation provide useful functionality.
Reimplemented from handler.
|
virtual |
Reset state of file to after 'open'. This function is called after every statement for all tables used by that statement.
Reimplemented from handler.
|
virtual |
Reset the auto-increment counter to the given value, i.e. the next row inserted will get the given value. HA_ERR_WRONG_COMMAND is returned by storage engines that don't support this operation.
Reimplemented from handler.
|
virtual |
Ends a table scan.
Reimplemented from handler.
Definition at line 7909 of file ha_innodb.cc.
|
virtual |
Initialize a table scan.
scan | in: TRUE if table/index scan FALSE otherwise |
Implements handler.
Definition at line 7877 of file ha_innodb.cc.
|
virtual |
Reads the next row in a table scan (also used to read the FIRST row in a table scan).
buf | in/out: returns the row in this buffer, in MySQL format |
Implements handler.
Definition at line 7921 of file ha_innodb.cc.
|
virtual |
Fetches a row from the table based on a row reference.
buf | in/out: buffer for the row |
pos | in: primary key value of the row in the MySQL format, or the row id if the clustered index was internally generated by InnoDB; the length of data in pos has to be ref_length |
Implements handler.
Definition at line 7951 of file ha_innodb.cc.
|
virtual |
Is not invoked for non-transactional temporary tables.
Implements handler.
|
virtual |
Determines if table caching is supported.
Reimplemented from handler.
Definition at line 4015 of file ha_innodb.cc.
|
virtual |
Get the table flags to use for the statement.
Implements handler.
Definition at line 3878 of file ha_innodb.cc.
|
virtual |
Returns the table type (storage engine name).
Implements handler.
Definition at line 3905 of file ha_innodb.cc.
|
virtual |
Quickly remove all rows from a table.
Reimplemented from handler.
|
virtual |
Tell the engine whether it should avoid unnecessary lock waits. If yes, in an UPDATE or DELETE, if the row under the cursor was locked by another transaction, the engine may try an optimistic read of the last committed row value under the cursor.
Reimplemented from handler.
Definition at line 7214 of file ha_innodb.cc.
|
virtual |
Removes a new lock set on a row, if it was not read optimistically. This can be called after a row has been read in the processing of an UPDATE or a DELETE query, if the option innodb_locks_unsafe_for_binlog is set.
Reimplemented from handler.
Definition at line 7165 of file ha_innodb.cc.
UNIV_INTERN int ha_innobase::update_row | ( | const uchar * | old_row, |
uchar * | new_row | ||
) |
Updates a row given as a parameter to a new value. Note that we are given whole rows, not just the fields which are updated: this incurs some overhead for CPU when we check which fields are actually updated. TODO: currently InnoDB does not prevent the 'Halloween problem': in a searched update a single row can get updated several times if its index columns are updated!
old_row | in: old row in MySQL format |
new_row | in: new row in MySQL format |
Definition at line 6982 of file ha_innodb.cc.
|
virtual |
In an UPDATE or DELETE, if the row under the cursor was locked by another transaction, and the engine used an optimistic read of the last committed row value under the cursor, then the engine returns 1 from this function. MySQL must NOT try to update this optimistic value. If the optimistic value does not match the WHERE condition, MySQL can decide to skip over this row. Currently only works for InnoDB. This can be used to avoid unnecessary lock waits.
If this method returns nonzero, it will also signal the storage engine that the next read will be a locking re-read of the row.
Reimplemented from handler.
Definition at line 7205 of file ha_innodb.cc.
UNIV_INTERN int ha_innobase::write_row | ( | uchar * | record | ) |
Stores a row in an InnoDB database, to the table specified in this handle.
record | in: a row in MySQL format |
Definition at line 6439 of file ha_innodb.cc.