|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <ha_innodb.h>
Public Member Functions | |
| UNIV_INTERN | ha_innobase (plugin::StorageEngine &engine, Table &table_arg) |
| UNIV_INTERN | ~ha_innobase () |
| UNIV_INTERN plugin::TransactionalStorageEngine * | getTransactionalEngine () |
| UNIV_INTERN const char * | index_type (uint key_number) |
| UNIV_INTERN const key_map * | keys_to_use_for_scanning () |
| UNIV_INTERN int | doOpen (const drizzled::identifier::Table &identifier, int mode, uint test_if_locked) |
| UNIV_INTERN int | close (void) |
| UNIV_INTERN double | scan_time () |
| UNIV_INTERN double | read_time (uint index, uint ranges, ha_rows rows) |
| UNIV_INTERN int | doInsertRecord (unsigned char *buf) |
| UNIV_INTERN int | doUpdateRecord (const unsigned char *old_data, unsigned char *new_data) |
| UNIV_INTERN int | doDeleteRecord (const unsigned char *buf) |
| UNIV_INTERN bool | was_semi_consistent_read () |
| UNIV_INTERN void | try_semi_consistent_read (bool yes) |
| UNIV_INTERN void | unlock_row () |
| UNIV_INTERN int | doStartIndexScan (uint index, bool sorted) |
| UNIV_INTERN int | doEndIndexScan () |
| UNIV_INTERN int | index_read (unsigned char *buf, const unsigned char *key, uint key_len, enum ha_rkey_function find_flag) |
| UNIV_INTERN int | index_read_idx (unsigned char *buf, uint index, const unsigned char *key, uint key_len, enum ha_rkey_function find_flag) |
| UNIV_INTERN int | index_read_last (unsigned char *buf, const unsigned char *key, uint key_len) |
| UNIV_INTERN int | index_next (unsigned char *buf) |
| UNIV_INTERN int | index_next_same (unsigned char *buf, const unsigned char *key, uint keylen) |
| UNIV_INTERN int | index_prev (unsigned char *buf) |
| UNIV_INTERN int | index_first (unsigned char *buf) |
| UNIV_INTERN int | index_last (unsigned char *buf) |
| UNIV_INTERN int | doStartTableScan (bool scan) |
| UNIV_INTERN int | doEndTableScan () |
| UNIV_INTERN int | rnd_next (unsigned char *buf) |
| UNIV_INTERN int | rnd_pos (unsigned char *buf, unsigned char *pos) |
| UNIV_INTERN void | position (const unsigned char *record) |
| UNIV_INTERN int | info (uint) |
| UNIV_INTERN int | analyze (Session *session) |
| UNIV_INTERN int | discard_or_import_tablespace (bool discard) |
| UNIV_INTERN int | extra (enum ha_extra_function operation) |
| UNIV_INTERN int | reset () |
| UNIV_INTERN int | external_lock (Session *session, int lock_type) |
| void | position (unsigned char *record) |
| UNIV_INTERN ha_rows | records_in_range (uint inx, key_range *min_key, key_range *max_key) |
| UNIV_INTERN ha_rows | estimate_rows_upper_bound () |
| UNIV_INTERN int | delete_all_rows () |
| UNIV_INTERN int | check (Session *session) |
| UNIV_INTERN char * | update_table_comment (const char *comment) |
| UNIV_INTERN char * | get_foreign_key_create_info () |
| UNIV_INTERN int | get_foreign_key_list (Session *session, List< ForeignKeyInfo > *f_key_list) |
| UNIV_INTERN bool | can_switch_engines () |
| UNIV_INTERN uint | referenced_by_foreign_key () |
| UNIV_INTERN void | free_foreign_key_create_info (char *str) |
| UNIV_INTERN THR_LOCK_DATA ** | store_lock (Session *session, THR_LOCK_DATA **to, enum thr_lock_type lock_type) |
| virtual UNIV_INTERN void | get_auto_increment (uint64_t offset, uint64_t increment, uint64_t nb_desired_values, uint64_t *first_value, uint64_t *nb_reserved_values) |
| UNIV_INTERN int | reset_auto_increment (uint64_t value) |
| UNIV_INTERN bool | primary_key_is_clustered () |
| UNIV_INTERN int | cmp_ref (const unsigned char *ref1, const unsigned char *ref2) |
| int | read_range_first (const key_range *start_key, const key_range *end_key, bool eq_range_arg, bool sorted) |
| int | read_range_next () |
| 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) | |
| virtual Cursor * | clone (memory::Root *mem_root) |
| 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 | 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) |
| 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 const char * | index_type (uint32_t) |
| uint32_t | get_index (void) const |
| virtual int | index_read_map (unsigned char *buf, const unsigned char *key, key_part_map keypart_map, enum 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. | |
| virtual int | index_read_idx_map (unsigned char *buf, uint32_t index, const unsigned char *key, key_part_map keypart_map, enum 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. | |
| virtual int | index_next_same (unsigned char *, const unsigned char *, uint32_t) |
| virtual int | index_read_last_map (unsigned char *buf, const unsigned char *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. | |
| 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 ha_rows | records_in_range (uint32_t, key_range *, key_range *) |
| virtual int | info (uint32_t)=0 |
| virtual uint32_t | calculate_key_hash_value (Field **) |
| virtual int | extra_opt (enum ha_extra_function operation, uint32_t) |
| void | set_next_insert_id (uint64_t id) |
| void | restore_auto_increment (uint64_t prev_insert_id) |
| virtual int | indexes_are_disabled (void) |
| virtual void | append_create_info (String *) |
| virtual bool | isOrdered (void) |
Private Member Functions | |
| UNIV_INTERN uint | store_key_val_for_row (uint keynr, char *buff, uint buff_len, const unsigned char *record) |
| UNIV_INTERN void | update_session (Session *session) |
| UNIV_INTERN int | change_active_index (uint32_t keynr) |
| UNIV_INTERN int | general_fetch (unsigned char *buf, uint32_t direction, uint32_t match_mode) |
| UNIV_INTERN ulint | innobase_lock_autoinc () |
| UNIV_INTERN uint64_t | innobase_peek_autoinc () |
| UNIV_INTERN ulint | innobase_set_max_autoinc (uint64_t auto_inc) |
| UNIV_INTERN ulint | innobase_reset_autoinc (uint64_t auto_inc) |
| UNIV_INTERN ulint | innobase_get_autoinc (uint64_t *value) |
| ulint | innobase_update_autoinc (uint64_t auto_inc) |
| UNIV_INTERN void | innobase_initialize_autoinc () |
| UNIV_INTERN dict_index_t * | innobase_get_index (uint keynr) |
Private Attributes | |
| row_prebuilt_t * | prebuilt |
| Session * | user_session |
| THR_LOCK_DATA | lock |
| INNOBASE_SHARE * | share |
| std::vector< unsigned char > | upd_buff |
| std::vector< unsigned char > | key_val_buff |
| ulong | upd_and_key_val_buff_len |
| uint | primary_key |
| ulong | start_of_scan |
| uint | last_match_mode |
| uint | num_write_row |
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 |
The class defining a handle to an Innodb table
Definition at line 80 of file ha_innodb.h.
| UNIV_INTERN ha_innobase::ha_innobase | ( | plugin::StorageEngine & | engine_arg, |
| Table & | table_arg ) |
Construct ha_innobase Cursor.
Definition at line 1685 of file ha_innodb.cc.
| UNIV_INTERN ha_innobase::~ha_innobase | ( | ) |
Destruct ha_innobase Cursor.
Definition at line 1699 of file ha_innodb.cc.
|
virtual |
Updates index cardinalities of the table, based on 8 random dives into each index tree. This does NOT calculate exact statistics on the table.
| session | in: connection thread handle |
Reimplemented from drizzled::Cursor.
Definition at line 7692 of file ha_innodb.cc.
|
virtual |
Checks if ALTER TABLE may change the storage engine of the table. Changing storage engines is not allowed for tables for which there are foreign key constraints (parent or child tables).
Reimplemented from drizzled::Cursor.
Definition at line 8101 of file ha_innodb.cc.
|
private |
Changes the active index of a handle.
Definition at line 5588 of file ha_innodb.cc.
|
virtual |
Tries to check that an InnoDB table is not corrupted. If corruption is noticed, prints to stderr information about it. In case of corruption may also assert a failure and crash the server.
| session | in: user thread handle |
Reimplemented from drizzled::Cursor.
Definition at line 7709 of file ha_innodb.cc.
|
virtual |
Closes a handle to an InnoDB table.
Implements drizzled::Cursor.
Definition at line 3837 of file ha_innodb.cc.
|
virtual |
Compares two 'refs'. A 'ref' is the (internal) primary key value of the row. If there is no explicitly declared non-null unique key or a primary key, then InnoDB internally uses the row id as the primary key.
| ref1 | in: an (internal) primary key value in the MySQL key value format |
| ref2 | in: an (internal) primary key value in the MySQL key value format |
Reimplemented from drizzled::Cursor.
Definition at line 9043 of file ha_innodb.cc.
|
virtual |
Deletes all rows of an InnoDB table.
Reimplemented from drizzled::Cursor.
Definition at line 6684 of file ha_innodb.cc.
|
virtual |
Discards or imports an InnoDB tablespace.
Reimplemented from drizzled::Cursor.
Definition at line 6653 of file ha_innodb.cc.
|
virtual |
Deletes a row given as the parameter.
| record | in: a row in MySQL format |
Reimplemented from drizzled::Cursor.
Definition at line 5146 of file ha_innodb.cc.
|
virtual |
Currently does nothing.
Reimplemented from drizzled::Cursor.
Definition at line 5266 of file ha_innodb.cc.
|
virtual |
Ends a table scan.
Reimplemented from drizzled::Cursor.
Definition at line 5848 of file ha_innodb.cc.
|
virtual |
Stores a row in an InnoDB database, to the table specified in this handle.
| record | in: a row in MySQL format |
Reimplemented from drizzled::Cursor.
Definition at line 4616 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::doOpen | ( | const drizzled::identifier::Table & | identifier, |
| int | mode, | ||
| uint | test_if_locked ) |
Creates and opens a handle to a table which already exists in an InnoDB database.
| mode | in: not used |
| test_if_locked | in: not used |
Definition at line 3534 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::doStartIndexScan | ( | uint | keynr, |
| bool | sorted ) |
Initializes a handle to use an index.
| keynr | in: key (index) number |
| sorted | in: 1 if result MUST be sorted according to index |
Definition at line 5253 of file ha_innodb.cc.
|
virtual |
Initialize a table scan.
| scan | in: TRUE if table/index scan FALSE otherwise |
Implements drizzled::Cursor.
Definition at line 5816 of file ha_innodb.cc.
|
virtual |
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 |
Reimplemented from drizzled::Cursor.
Definition at line 5008 of file ha_innodb.cc.
|
virtual |
Gives an UPPER BOUND to the number of rows in a table. This is used in filesort.cc.
Reimplemented from drizzled::Cursor.
Definition at line 7151 of file ha_innodb.cc.
|
virtual |
As MySQL will execute an external lock for every new table it uses when it starts to process an SQL statement. We can use this function to store the pointer to the Session in the handle.
| session | in: handle to the user thread |
| lock_type | in: lock type |
Reimplemented from drizzled::Cursor.
Definition at line 8255 of file ha_innodb.cc.
|
virtual |
Tells something additional to the Cursor about how to do things.
| operation | in: HA_EXTRA_FLUSH or some other flag |
Reimplemented from drizzled::Cursor.
Definition at line 8157 of file ha_innodb.cc.
|
virtual |
Frees the foreign key create info for a table stored in InnoDB, if it is non-NULL.
| str | in, own: create info string to free |
Reimplemented from drizzled::Cursor.
Definition at line 8145 of file ha_innodb.cc.
|
private |
Reads the next or previous row from a cursor, which must have previously been positioned using index_read.
Definition at line 5671 of file ha_innodb.cc.
|
virtual |
This function initializes the auto-inc counter if it has not been initialized yet. This function does not change the value of the auto-inc counter if it already has been initialized. Returns the value of the auto-inc counter in *first_value, and UINT64_T_MAX in *nb_reserved_values (as we have a table-level lock). offset, increment, nb_desired_values are ignored. first_value is set to -1 if error (deadlock or lock wait timeout)
| offset | in: table autoinc offset |
| increment | in: table autoinc increment |
| nb_desired_values | in: number of values reqd |
| first_value | out: the autoinc value |
| nb_reserved_values | out: count of reserved values |
Implements drizzled::Cursor.
Definition at line 8888 of file ha_innodb.cc.
|
virtual |
Gets the foreign key create info for a table stored in InnoDB.
Reimplemented from drizzled::Cursor.
Definition at line 7949 of file ha_innodb.cc.
|
virtual |
used in REPLACE; is > 0 if table is referred by a FOREIGN KEY
Foreign id
Foreign Fields
Reimplemented from drizzled::Cursor.
Definition at line 8003 of file ha_innodb.cc.
|
inline |
Returns the plugin::TransactionStorageEngine pointer of the cursor's underlying engine.
Have a TransactionalCursor subclass...
Definition at line 135 of file ha_innodb.h.
|
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 drizzled::Cursor.
Definition at line 5767 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 drizzled::Cursor.
Definition at line 5792 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 drizzled::Cursor.
Definition at line 5720 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::index_next_same | ( | unsigned char * | buf, |
| const unsigned char * | key, | ||
| uint | keylen ) |
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 |
Definition at line 5735 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 drizzled::Cursor.
Definition at line 5752 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::index_read | ( | unsigned char * | buf, |
| const unsigned char * | key_ptr, | ||
| uint | key_len, | ||
| enum ha_rkey_function | find_flag ) |
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 |
Definition at line 5394 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::index_read_idx | ( | unsigned char * | buf, |
| uint | keynr, | ||
| const unsigned char * | 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 5646 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::index_read_last | ( | unsigned char * | buf, |
| const unsigned char * | key_ptr, | ||
| uint | key_len ) |
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 |
Definition at line 5517 of file ha_innodb.cc.
| UNIV_INTERN const char * ha_innobase::index_type | ( | uint | key_number | ) |
InnoDB database tables Returns the index type.
| key_number | out: index type |
Definition at line 3126 of file ha_innodb.cc.
| UNIV_INTERN int ha_innobase::info | ( | uint | flag | ) |
Returns statistics information of the table to the MySQL interpreter, in various fields of the handle object.
| flag | in: what information MySQL requests |
Definition at line 7417 of file ha_innodb.cc.
|
private |
Read the next autoinc value. Acquire the relevant locks before reading the AUTOINC value. If SUCCESS then the table AUTOINC mutex will be locked on return and all relevant locks acquired.
| value | out: autoinc value |
Definition at line 8828 of file ha_innodb.cc.
|
private |
Get the index for a handle. Does not change active index.
| keynr | in: use this index; MAX_KEY means always clustered index, even if it was internally generated by InnoDB |
Definition at line 5533 of file ha_innodb.cc.
|
private |
Set the autoinc column max value. This should only be called once from ha_innobase::open(). Therefore there's no need for a covering lock.
Definition at line 3437 of file ha_innodb.cc.
|
private |
This special handling is really to overcome the limitations of MySQL's binlogging. We need to eliminate the non-determinism that will arise in INSERT ... SELECT type of statements, since MySQL binlog only stores the min value of the autoinc interval. Once that is fixed we can get rid of the special lock handling.
Definition at line 4567 of file ha_innodb.cc.
|
private |
This function reads the global auto-inc counter. It doesn't use the AUTOINC lock even if the lock mode is set to TRADITIONAL.
Definition at line 8854 of file ha_innodb.cc.
|
private |
Reset the autoinc value in the table.
| autoinc | in: value to store |
Definition at line 4582 of file ha_innodb.cc.
|
private |
Store the autoinc value in the table. The autoinc value is only set if it's greater than the existing autoinc value in the table.
| auto_inc | in: value to store |
Definition at line 4599 of file ha_innodb.cc.
|
virtual |
Returns the key map of keys that are usable for scanning.
Reimplemented from drizzled::Cursor.
Definition at line 3166 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 drizzled::Cursor.
Definition at line 5942 of file ha_innodb.cc.
|
virtual |
Determines if the primary key is clustered index.
Reimplemented from drizzled::Cursor.
Definition at line 3177 of file ha_innodb.cc.
|
virtual |
Fast index creation (smart ALTER TABLE)
Reimplemented from drizzled::Cursor.
Definition at line 9659 of file ha_innodb.cc.
|
virtual |
Read next row between two endpoints.
| 0 | Found row |
| HA_ERR_END_OF_FILE | No rows in range |
# Error code
Reimplemented from drizzled::Cursor.
Definition at line 9674 of file ha_innodb.cc.
| UNIV_INTERN double ha_innobase::read_time | ( | uint | index, |
| uint | ranges, | ||
| ha_rows | rows ) |
Calculate the time it takes to read a set of ranges through an index This enables us to optimise reads for clustered indexes.
| index | in: key number |
| ranges | in: how many ranges |
| rows | in: estimated number of rows in the ranges |
Definition at line 7220 of file ha_innodb.cc.
| UNIV_INTERN ha_rows ha_innobase::records_in_range | ( | uint | keynr, |
| key_range * | min_key, | ||
| key_range * | max_key ) |
Estimates the number of index records in a range.
| keynr | in: index number |
| min_key | in: start key value of the range, may also be 0 |
| max_key | in: range end key val, may also be 0 |
Definition at line 7034 of file ha_innodb.cc.
|
virtual |
Checks if a table is referenced by a foreign key. The MySQL manual states that a REPLACE is either equivalent to an INSERT, or DELETE(s) + INSERT. Only a delete is then allowed internally to resolve a duplicate key conflict in REPLACE, not an update.
Reimplemented from drizzled::Cursor.
Definition at line 8129 of file ha_innodb.cc.
|
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 8213 of file ha_innodb.cc.
|
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.
| value | in: new value for table autoinc |
Reimplemented from drizzled::Cursor.
Definition at line 8995 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 drizzled::Cursor.
Definition at line 5860 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 drizzled::Cursor.
Definition at line 5889 of file ha_innodb.cc.
|
virtual |
How many seeks it will take to read through the table. This is to be comparable to the number returned by records_in_range so that we can decide if we should scan the table or use keys.
Reimplemented from drizzled::Cursor.
Definition at line 7203 of file ha_innodb.cc.
|
private |
Stores a key value for a row to a buffer.
| keynr | in: key number |
| buff | in/out: buffer for the key value (in MySQL format) |
| buff_len | in: buffer length |
| record | in: row in MySQL format |
Definition at line 4122 of file ha_innodb.cc.
|
virtual |
Converts a MySQL table lock stored in the 'lock' field of the handle to a proper type before storing pointer to the lock into an array of pointers. MySQL also calls this if it wants to reset some table locks to a not-locked state during the processing of an SQL query. An example is that during a SELECT the read lock is released early on the 'const' tables where we only fetch one row. MySQL does not call this when it releases all locks at the end of an SQL statement.
| session | in: user thread handle |
| to | in: pointer to an array of pointers to lock structs; pointer to the 'lock' field of current handle is stored next to this array |
| lock_type | in: lock type to store in 'lock'; this may also be TL_IGNORE |
Reimplemented from drizzled::Cursor.
Definition at line 8687 of file ha_innodb.cc.
|
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 drizzled::Cursor.
Definition at line 5229 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 drizzled::Cursor.
Definition at line 5188 of file ha_innodb.cc.
|
inlineprivate |
Updates the user_thd field in a handle and also allocates a new InnoDB transaction handle if needed, and updates the transaction fields in the prebuilt struct.
| session | in: thd to use the handle |
Definition at line 1709 of file ha_innodb.cc.
| UNIV_INTERN char * ha_innobase::update_table_comment | ( | const char * | comment | ) |
Adds information about free space in the InnoDB tablespace to a table comment which is printed out when a user calls SHOW TABLE STATUS. Adds also info on foreign keys.
| comment | in: table comment defined by user |
Definition at line 7874 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 drizzled::Cursor.
Definition at line 5220 of file ha_innodb.cc.
|
private |
buffer used in converting search key values from MySQL format to Innodb format
Definition at line 93 of file ha_innodb.h.
|
private |
Definition at line 103 of file ha_innodb.h.
|
private |
Definition at line 88 of file ha_innodb.h.
|
private |
number of doInsertRecord() calls
Definition at line 106 of file ha_innodb.h.
|
private |
prebuilt struct in InnoDB, used to save CPU time with prebuilt data structures
Definition at line 82 of file ha_innodb.h.
|
private |
Definition at line 99 of file ha_innodb.h.
|
private |
information for MySQL table locking
Definition at line 89 of file ha_innodb.h.
|
private |
this is set to 1 when we are starting a table scan but have not yet fetched any row, else 0
Definition at line 100 of file ha_innodb.h.
|
private |
Definition at line 96 of file ha_innodb.h.
|
private |
buffer used in updates
Definition at line 92 of file ha_innodb.h.
|
private |
the thread handle of the user currently using the handle; this is set in external_lock function
Definition at line 85 of file ha_innodb.h.