#include <row0mysql.h>
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; these are used to save CPU time.
Definition at line 587 of file row0mysql.h.
ulint row_prebuilt_struct::autoinc_error |
The actual error code encountered while trying to init or read the autoinc value from the table. We store it here so that we can return it to MySQL
Definition at line 767 of file row0mysql.h.
Referenced by ha_innobase::doInsertRecord(), ha_innobase::innobase_get_autoinc(), and row_create_prebuilt().
ib_uint64_t row_prebuilt_struct::autoinc_increment |
The increment step of the auto increment column. Value must be greater than or equal to 1. Required to calculate the next value
Definition at line 760 of file row0mysql.h.
Referenced by ha_innobase::doInsertRecord(), ha_innobase::doUpdateRecord(), ha_innobase::get_auto_increment(), and row_create_prebuilt().
ib_uint64_t row_prebuilt_struct::autoinc_last_value |
last value of AUTO-INC interval
Definition at line 758 of file row0mysql.h.
Referenced by ha_innobase::doInsertRecord(), ha_innobase::get_auto_increment(), ha_innobase::info(), ha_innobase::reset(), and row_create_prebuilt().
mem_heap_t* row_prebuilt_struct::blob_heap |
in SELECTS BLOB fields are copied to this heap
Definition at line 753 of file row0mysql.h.
Referenced by ha_innobase::extra(), ha_innobase::reset(), row_mysql_prebuilt_free_blob_heap(), and row_prebuilt_free().
unsigned row_prebuilt_struct::clust_index_was_generated |
if the user did not define a primary key in MySQL, then Innobase automatically generated a clustered index where the ordering column is the row id: in this case this flag is set to TRUE
Definition at line 604 of file row0mysql.h.
Referenced by ha_innobase::cmp_ref(), ha_innobase::doOpen(), ha_innobase::doStartTableScan(), ha_innobase::info(), ha_innobase::position(), ha_innobase::rnd_pos(), and row_search_for_mysql().
btr_pcur_t* row_prebuilt_struct::clust_pcur |
persistent cursor used in some selects and updates
Definition at line 671 of file row0mysql.h.
Referenced by row_create_prebuilt(), row_prebuilt_free(), row_unlock_for_mysql(), and row_update_for_mysql().
dtuple_t* row_prebuilt_struct::clust_ref |
prebuilt dtuple used in sel/upd/del
Definition at line 681 of file row0mysql.h.
Referenced by row_create_prebuilt().
const byte* row_prebuilt_struct::default_rec |
the default values of all columns (a "default row") in MySQL format
Definition at line 652 of file row0mysql.h.
Referenced by ha_innobase::doOpen().
byte* row_prebuilt_struct::fetch_cache[MYSQL_FETCH_CACHE_SIZE] |
a cache for fetched rows if we fetch many rows from the same cursor: it saves CPU time to fetch them in a batch; we reserve mysql_row_len bytes for each such row; these pointers point 4 bytes past the allocated mem buf start, because there is a 4 byte magic number at the start and at the end
Definition at line 735 of file row0mysql.h.
Referenced by row_prebuilt_free().
ulint row_prebuilt_struct::fetch_cache_first |
position of the first not yet fetched row in fetch_cache
Definition at line 749 of file row0mysql.h.
Referenced by row_search_for_mysql().
ulint row_prebuilt_struct::fetch_direction |
ROW_SEL_NEXT or ROW_SEL_PREV
Definition at line 734 of file row0mysql.h.
Referenced by row_search_for_mysql().
mem_heap_t* row_prebuilt_struct::heap |
memory heap from which these auxiliary structures are allocated when needed
Definition at line 643 of file row0mysql.h.
Referenced by row_create_prebuilt(), row_get_prebuilt_update_vector(), row_prebuild_sel_graph(), and row_prebuilt_free().
ulint row_prebuilt_struct::hint_need_to_fetch_extra_cols |
normally this is set to 0; if this is set to ROW_RETRIEVE_PRIMARY_KEY, then we should at least retrieve all columns in the primary key; if this is set to ROW_RETRIEVE_ALL_COLS, then we must retrieve all columns in the key (if read_just_key == 1), or all columns in the table
Definition at line 654 of file row0mysql.h.
Referenced by build_template(), and ha_innobase::external_lock().
dict_index_t* row_prebuilt_struct::index |
current index for a search, if any
Definition at line 593 of file row0mysql.h.
Referenced by build_template(), ha_innobase::change_active_index(), ha_innobase::check(), ha_innobase::index_read(), and row_search_for_mysql().
unsigned row_prebuilt_struct::index_usable |
caches the value of row_merge_is_index_usable(trx,index)
Definition at line 611 of file row0mysql.h.
Referenced by ha_innobase::change_active_index(), ha_innobase::check(), ha_innobase::index_read(), and row_search_for_mysql().
que_fork_t* row_prebuilt_struct::ins_graph |
Innobase SQL query graph used in inserts
Definition at line 665 of file row0mysql.h.
Referenced by row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_prebuilt_free(), and row_update_prebuilt_trx().
ins_node_t* row_prebuilt_struct::ins_node |
Innobase SQL insert node used to perform inserts to the table
Definition at line 646 of file row0mysql.h.
Referenced by row_insert_for_mysql(), and row_lock_table_autoinc_for_mysql().
byte* row_prebuilt_struct::ins_upd_rec_buff |
buffer for storing data converted to the Innobase format from the MySQL format
Definition at line 649 of file row0mysql.h.
ibool row_prebuilt_struct::keep_other_fields_on_keyread |
when using fetch cache with HA_EXTRA_KEYREAD, don't overwrite other fields in mysql row row buffer.
Definition at line 745 of file row0mysql.h.
Referenced by ha_innobase::extra(), and reset_template().
ulint row_prebuilt_struct::magic_n |
this magic number is set to ROW_PREBUILT_ALLOCATED when created, or ROW_PREBUILT_FREED when the struct has been freed
Definition at line 588 of file row0mysql.h.
Referenced by row_create_prebuilt(), row_insert_for_mysql(), row_prebuilt_free(), row_search_for_mysql(), row_update_for_mysql(), and row_update_prebuilt_trx().
ulint row_prebuilt_struct::magic_n2 |
this should be the same as magic_n
Definition at line 773 of file row0mysql.h.
Referenced by row_create_prebuilt(), and row_prebuilt_free().
unsigned row_prebuilt_struct::mysql_has_locked |
this is set TRUE when MySQL calls external_lock on this handle with a lock flag, and set FALSE when with the F_UNLOCK flag
Definition at line 600 of file row0mysql.h.
Referenced by ha_innobase::external_lock().
ulint row_prebuilt_struct::mysql_prefix_len |
byte offset of the end of the last requested column
Definition at line 728 of file row0mysql.h.
Referenced by build_template().
ulint row_prebuilt_struct::mysql_row_len |
length in bytes of a row in the MySQL format
Definition at line 730 of file row0mysql.h.
Referenced by ha_innobase::doOpen(), row_prebuilt_free(), and row_search_for_mysql().
mysql_row_templ_t* row_prebuilt_struct::mysql_template |
template used to transform rows fast between MySQL and Innobase formats; memory for this template is not allocated from 'heap'
Definition at line 639 of file row0mysql.h.
Referenced by build_template(), ha_innobase::check(), ha_innobase::doInsertRecord(), and row_prebuilt_free().
ulint row_prebuilt_struct::n_fetch_cached |
number of not yet fetched rows in fetch_cache
Definition at line 751 of file row0mysql.h.
Referenced by row_search_for_mysql().
ulint row_prebuilt_struct::n_rows_fetched |
number of rows fetched after positioning the current cursor
Definition at line 732 of file row0mysql.h.
Referenced by row_search_for_mysql().
unsigned row_prebuilt_struct::n_template |
number of elements in the template
Definition at line 623 of file row0mysql.h.
Referenced by build_template(), and ha_innobase::check().
unsigned row_prebuilt_struct::need_to_access_clustered |
if we are fetching columns through a secondary index and at least one column is not in the secondary index, then this is set to TRUE
Definition at line 628 of file row0mysql.h.
Referenced by build_template(), ha_innobase::check(), and row_search_for_mysql().
ulint row_prebuilt_struct::new_rec_locks |
normally 0; if srv_locks_unsafe_for_binlog is TRUE or session is using READ COMMITTED or READ UNCOMMITTED isolation level, set in row_search_for_mysql() if we set a new record lock on the secondary or clustered index; this is used in row_unlock_for_mysql() when releasing the lock under the cursor if we determine after retrieving the row that it does not need to be locked ('mini-rollback')
Definition at line 714 of file row0mysql.h.
Referenced by row_search_for_mysql(), and row_unlock_for_mysql().
unsigned row_prebuilt_struct::null_bitmap_len |
number of bytes in the SQL NULL bitmap at the start of a row in the MySQL format
Definition at line 625 of file row0mysql.h.
Referenced by build_template().
mem_heap_t* row_prebuilt_struct::old_vers_heap |
memory heap where a previous version is built in consistent read
Definition at line 755 of file row0mysql.h.
Referenced by row_prebuilt_free().
btr_pcur_t* row_prebuilt_struct::pcur |
persistent cursor used in selects and updates
Definition at line 669 of file row0mysql.h.
Referenced by row_create_prebuilt(), row_prebuilt_free(), row_search_for_mysql(), row_unlock_for_mysql(), and row_update_for_mysql().
unsigned row_prebuilt_struct::read_just_key |
set to 1 when MySQL calls ha_innobase::extra with the argument HA_EXTRA_KEYREAD; it is enough to read just columns defined in the index (i.e., no read of the clustered index record necessary)
Definition at line 613 of file row0mysql.h.
Referenced by build_template(), ha_innobase::extra(), and reset_template().
byte row_prebuilt_struct::row_id[DATA_ROW_ID_LEN] |
if the clustered index was generated, the row id of the last row fetched is stored here
Definition at line 676 of file row0mysql.h.
Referenced by ha_innobase::position().
ulint row_prebuilt_struct::row_read_type |
ROW_READ_WITH_LOCKS if row locks should be the obtained for records under an UPDATE or DELETE cursor. If innodb_locks_unsafe_for_binlog is TRUE, this can be set to ROW_READ_TRY_SEMI_CONSISTENT, so that if the row under an UPDATE or DELETE cursor was locked by another transaction, InnoDB will resort to reading the last committed value ('semi-consistent read'). Then, this field will be set to ROW_READ_DID_SEMI_CONSISTENT to indicate that. If the row does not match the WHERE condition, MySQL will invoke handler::unlock_row() to clear the flag back to ROW_READ_TRY_SEMI_CONSISTENT and to simply skip the row. If the row matches, the next call to row_search_for_mysql() will lock the row. This eliminates lock waits in some cases; note that this breaks serializability.
Definition at line 689 of file row0mysql.h.
Referenced by row_search_for_mysql(), ha_innobase::try_semi_consistent_read(), ha_innobase::unlock_row(), and ha_innobase::was_semi_consistent_read().
dtuple_t* row_prebuilt_struct::search_tuple |
prebuilt dtuple used in selects
Definition at line 675 of file row0mysql.h.
Referenced by ha_innobase::change_active_index(), ha_innobase::check(), ha_innobase::index_read(), row_create_prebuilt(), and row_search_for_mysql().
que_fork_t* row_prebuilt_struct::sel_graph |
dummy query graph used in selects
Definition at line 673 of file row0mysql.h.
Referenced by row_lock_table_for_mysql(), row_prebuild_sel_graph(), row_prebuilt_free(), row_search_for_mysql(), and row_update_prebuilt_trx().
ulint row_prebuilt_struct::select_lock_type |
LOCK_NONE, LOCK_S, or LOCK_X
Definition at line 683 of file row0mysql.h.
Referenced by build_template(), ha_innobase::check(), ha_innobase::external_lock(), row_create_prebuilt(), row_lock_table_for_mysql(), row_search_for_mysql(), row_unlock_for_mysql(), ha_innobase::store_lock(), and ha_innobase::unlock_row().
unsigned row_prebuilt_struct::sql_stat_start |
TRUE when we start processing of an SQL statement: we may have to set an intention lock on the table, create a consistent read view etc.
Definition at line 596 of file row0mysql.h.
Referenced by ha_innobase::check(), ha_innobase::doInsertRecord(), ha_innobase::external_lock(), ha_innobase::index_read(), row_create_prebuilt(), row_insert_for_mysql(), row_search_for_mysql(), and row_update_for_mysql().
ulint row_prebuilt_struct::stored_select_lock_type |
this field is used to remember the original select_lock_type that was decided in ha_innodb.cc, ::store_lock(), ::external_lock(), etc.
Definition at line 684 of file row0mysql.h.
Referenced by ha_innobase::external_lock(), row_create_prebuilt(), and ha_innobase::store_lock().
dict_table_t* row_prebuilt_struct::table |
Innobase table handle
Definition at line 592 of file row0mysql.h.
Referenced by build_template(), calc_row_difference(), ha_innobase::can_switch_engines(), ha_innobase::check(), ha_innobase::delete_all_rows(), ha_innobase::discard_or_import_tablespace(), ha_innobase::doDeleteRecord(), ha_innobase::doInsertRecord(), ha_innobase::doOpen(), ha_innobase::doUpdateRecord(), ha_innobase::estimate_rows_upper_bound(), ha_innobase::general_fetch(), ha_innobase::get_auto_increment(), ha_innobase::get_foreign_key_create_info(), ha_innobase::get_foreign_key_list(), ha_innobase::index_read(), ha_innobase::info(), ha_innobase::innobase_get_autoinc(), ha_innobase::innobase_get_index(), ha_innobase::innobase_initialize_autoinc(), ha_innobase::innobase_lock_autoinc(), ha_innobase::innobase_peek_autoinc(), ha_innobase::innobase_reset_autoinc(), ha_innobase::innobase_set_max_autoinc(), ha_innobase::referenced_by_foreign_key(), ha_innobase::reset_auto_increment(), row_create_prebuilt(), row_get_prebuilt_update_vector(), row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_prebuilt_free(), row_search_for_mysql(), row_update_for_mysql(), row_update_prebuilt_trx(), ha_innobase::scan_time(), and ha_innobase::update_table_comment().
unsigned row_prebuilt_struct::templ_contains_blob |
TRUE if the template contains a column with DATA_BLOB == get_innobase_type_from_mysql_type(); not to be confused with InnoDB externally stored columns (VARCHAR can be off-page too)
Definition at line 633 of file row0mysql.h.
Referenced by build_template(), and row_search_for_mysql().
unsigned row_prebuilt_struct::template_type |
ROW_MYSQL_WHOLE_ROW, ROW_MYSQL_REC_FIELDS, ROW_MYSQL_DUMMY_TEMPLATE, or ROW_MYSQL_NO_TEMPLATE
Definition at line 619 of file row0mysql.h.
Referenced by build_template(), ha_innobase::check(), ha_innobase::doInsertRecord(), ha_innobase::doUpdateRecord(), and row_search_for_mysql().
trx_t* row_prebuilt_struct::trx |
current transaction handle
Definition at line 595 of file row0mysql.h.
Referenced by ha_innobase::can_switch_engines(), ha_innobase::change_active_index(), ha_innobase::check(), ha_innobase::delete_all_rows(), ha_innobase::discard_or_import_tablespace(), ha_innobase::doDeleteRecord(), ha_innobase::doInsertRecord(), ha_innobase::doUpdateRecord(), ha_innobase::estimate_rows_upper_bound(), ha_innobase::external_lock(), ha_innobase::general_fetch(), ha_innobase::get_auto_increment(), ha_innobase::get_foreign_key_create_info(), ha_innobase::get_foreign_key_list(), ha_innobase::index_read(), ha_innobase::info(), ha_innobase::innobase_initialize_autoinc(), ha_innobase::position(), ha_innobase::records_in_range(), ha_innobase::rnd_pos(), row_check_index_for_mysql(), row_get_prebuilt_update_vector(), row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_prebuild_sel_graph(), row_search_for_mysql(), row_unlock_for_mysql(), row_update_for_mysql(), row_update_prebuilt_trx(), ha_innobase::try_semi_consistent_read(), ha_innobase::unlock_row(), ha_innobase::update_session(), and ha_innobase::update_table_comment().
que_fork_t* row_prebuilt_struct::upd_graph |
Innobase SQL query graph used in updates or deletes
Definition at line 667 of file row0mysql.h.
Referenced by row_get_prebuilt_update_vector(), row_prebuilt_free(), row_update_for_mysql(), and row_update_prebuilt_trx().
upd_node_t* row_prebuilt_struct::upd_node |
Innobase SQL update node used to perform updates and deletes
Definition at line 663 of file row0mysql.h.
Referenced by ha_innobase::doDeleteRecord(), ha_innobase::doUpdateRecord(), row_get_prebuilt_update_vector(), and row_update_for_mysql().