MySQL 8.0.39
Source Code Documentation
|
Interface between Innobase row operations and MySQL. More...
#include "ha_prototypes.h"
#include <stddef.h>
#include <sys/types.h>
#include <algorithm>
#include "btr0pcur.h"
#include "data0data.h"
#include "data0type.h"
#include "db0err.h"
#include "dict0types.h"
#include "fts0fts.h"
#include "gis0type.h"
#include "lob0undo.h"
#include "lock0types.h"
#include "mem0mem.h"
#include "my_compiler.h"
#include "my_inttypes.h"
#include "que0types.h"
#include "rem0types.h"
#include "row0types.h"
#include "sess0sess.h"
#include "sql_cmd.h"
#include "trx0types.h"
#include "univ.i"
#include "ut0bool_scope_guard.h"
Go to the source code of this file.
Classes | |
struct | mysql_row_templ_t |
struct | row_prebuilt_t |
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; these are used to save CPU time. More... | |
class | row_prebuilt_t::row_is_reading_range_guard_t |
struct | SysIndexCallback |
Callback for row_mysql_sys_index_iterate() More... | |
Namespaces | |
namespace | dd |
The version of the current data dictionary table definitions. | |
Functions | |
void | row_mysql_prebuilt_free_blob_heap (row_prebuilt_t *prebuilt) |
Frees the blob heap in prebuilt when no longer needed. More... | |
byte * | row_mysql_store_true_var_len (byte *dest, ulint len, ulint lenlen) |
Stores a >= 5.0.3 format true VARCHAR length to dest, in the MySQL row format. More... | |
const byte * | row_mysql_read_true_varchar (ulint *len, const byte *field, ulint lenlen) |
Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and returns a pointer to the data. More... | |
void | row_mysql_store_blob_ref (byte *dest, ulint col_len, const void *data, ulint len) |
Stores a reference to a BLOB in the MySQL format. More... | |
const byte * | row_mysql_read_blob_ref (ulint *len, const byte *ref, ulint col_len) |
Reads a reference to a BLOB in the MySQL format. More... | |
void | row_mysql_store_geometry (byte *dest, ulint dest_len, const byte *src, ulint src_len) |
Converts InnoDB geometry data format to MySQL data format. More... | |
void | row_mysql_pad_col (ulint mbminlen, byte *pad, ulint len) |
Pad a column with spaces. More... | |
byte * | row_mysql_store_col_in_innobase_format (dfield_t *dfield, byte *buf, bool row_format_col, const byte *mysql_data, ulint col_len, ulint comp) |
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format. More... | |
bool | row_mysql_handle_errors (dberr_t *new_err, trx_t *trx, que_thr_t *thr, trx_savept_t *savept) |
Handles user errors and lock waits detected by the database engine. More... | |
row_prebuilt_t * | row_create_prebuilt (dict_table_t *table, ulint mysql_row_len) |
Create a prebuilt struct for a MySQL table handle. More... | |
void | row_prebuilt_free (row_prebuilt_t *prebuilt, bool dict_locked) |
Free a prebuilt struct for a MySQL table handle. More... | |
void | row_update_prebuilt_trx (row_prebuilt_t *prebuilt, trx_t *trx) |
Updates the transaction pointers in query graphs stored in the prebuilt struct. More... | |
dberr_t | row_lock_table_autoinc_for_mysql (row_prebuilt_t *prebuilt) |
Sets an AUTO_INC type lock on the table mentioned in prebuilt. More... | |
dberr_t | row_lock_table (row_prebuilt_t *prebuilt) |
Sets a table lock on the table mentioned in prebuilt. More... | |
dberr_t | row_insert_for_mysql (const byte *mysql_rec, row_prebuilt_t *prebuilt) |
Does an insert for MySQL. More... | |
void | row_prebuild_sel_graph (row_prebuilt_t *prebuilt) |
Builds a dummy query graph used in selects. More... | |
upd_t * | row_get_prebuilt_update_vector (row_prebuilt_t *prebuilt) |
Gets pointer to a prebuilt update vector used in updates. More... | |
bool | row_table_got_default_clust_index (const dict_table_t *table) |
Checks if a table is such that we automatically created a clustered index on it (on row id). More... | |
dberr_t | row_update_for_mysql (const byte *mysql_rec, row_prebuilt_t *prebuilt) |
Does an update or delete of a row for MySQL. More... | |
void | row_delete_all_rows (dict_table_t *table) |
Delete all rows for the given table by freeing/truncating indexes. More... | |
bool | row_is_mysql_tmp_table_name (const char *name) |
Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL. More... | |
upd_node_t * | row_create_update_node_for_mysql (dict_table_t *table, mem_heap_t *heap) |
Creates an query graph node of 'update' type to be used in the MySQL interface. More... | |
dberr_t | row_update_cascade_for_mysql (que_thr_t *thr, upd_node_t *node, dict_table_t *table) |
Does a cascaded delete or set null in a foreign key operation. More... | |
void | row_mysql_lock_data_dictionary (trx_t *trx, ut::Location location) |
Locks the data dictionary exclusively for performing a table create or other data dictionary modification operation. More... | |
void | row_mysql_unlock_data_dictionary (trx_t *trx) |
Unlocks the data dictionary exclusive lock. More... | |
void | row_mysql_freeze_data_dictionary (trx_t *trx, ut::Location location) |
Locks the data dictionary in shared mode from modifications, for performing foreign key check, rollback, or other operation invisible to MySQL. More... | |
void | row_mysql_unfreeze_data_dictionary (trx_t *trx) |
Unlocks the data dictionary shared lock. More... | |
dberr_t | row_create_table_for_mysql (dict_table_t *&table, const char *compression, const HA_CREATE_INFO *create_info, trx_t *trx, mem_heap_t *heap) |
Creates a table for MySQL. More... | |
dberr_t | row_create_index_for_mysql (dict_index_t *index, trx_t *trx, const ulint *field_lengths, dict_table_t *handler) |
Does an index creation operation for MySQL. More... | |
dberr_t | row_table_load_foreign_constraints (trx_t *trx, const char *name, const dd::Table *dd_table) |
Loads foreign key constraints for the table being created. More... | |
ulint | row_drop_tables_for_mysql_in_background (void) |
The master thread in srv0srv.cc calls this regularly to drop tables which we must drop in background after queries to them have ended. More... | |
dberr_t | row_mysql_lock_table (trx_t *trx, dict_table_t *table, enum lock_mode mode, const char *op_info) |
Sets an exclusive lock on a table. More... | |
dberr_t | row_drop_tablespace (space_id_t space_id, const char *filepath) |
Drop a tablespace as part of dropping or renaming a table. More... | |
dberr_t | row_drop_table_for_mysql (const char *name, trx_t *trx, bool nonatomic, dict_table_t *handler=nullptr) |
Drop a table for MySQL. More... | |
dberr_t | row_drop_table_for_mysql (const char *name, trx_t *trx) |
Drop a table for MySQL. More... | |
dberr_t | row_discard_tablespace_for_mysql (const char *name, trx_t *trx) |
Discards the tablespace of a table which stored in an .ibd file. More... | |
dberr_t | row_drop_database_for_mysql (const char *name, trx_t *trx, ulint *found) |
Drop a database for MySQL. More... | |
dberr_t | row_rename_table_for_mysql (const char *old_name, const char *new_name, const dd::Table *dd_table, trx_t *trx, bool replay) |
Renames a table for MySQL. More... | |
dberr_t | row_mysql_parallel_select_count_star (trx_t *trx, std::vector< dict_index_t * > &indexes, size_t max_threads, ulint *n_rows) |
Read the total number of records in a consistent view. More... | |
dberr_t | row_scan_index_for_mysql (row_prebuilt_t *prebuilt, dict_index_t *index, size_t n_threads, bool check_keys, ulint *n_rows) |
Scans an index for either COUNT(*) or CHECK TABLE. More... | |
void | row_mysql_init (void) |
Initialize this module. More... | |
void | row_mysql_close (void) |
Close this module. More... | |
dfield_t * | innobase_get_field_from_update_vector (dict_foreign_t *foreign, upd_t *update, uint32_t col_no) |
Get the updated parent field value from the update vector for the given col_no. More... | |
dfield_t * | innobase_get_computed_value (const dtuple_t *row, const dict_v_col_t *col, const dict_index_t *index, mem_heap_t **local_heap, mem_heap_t *heap, const dict_field_t *ifield, THD *thd, TABLE *mysql_table, const dict_table_t *old_table, upd_t *parent_update, dict_foreign_t *foreign) |
Get the computed value by supplying the base column values. More... | |
void | innobase_get_multi_value (const TABLE *mysql_table, ulint f_idx, dfield_t *dfield, multi_value_data *value, uint old_val, ulint comp, mem_heap_t *heap) |
Parse out multi-values from a MySQL record. More... | |
void | innobase_init_vc_templ (dict_table_t *table) |
Get the computed value by supplying the base column values. More... | |
void | innobase_rename_vc_templ (dict_table_t *table) |
Change dbname and table name in table->vc_templ. More... | |
void | row_wait_for_background_drop_list_empty () |
Wait for the background drop list to become empty. More... | |
Variables | |
bool | row_rollback_on_timeout |
Provide optional 4.x backwards compatibility for 5.0 and above. More... | |
constexpr uint32_t | MYSQL_FETCH_CACHE_SIZE = 8 |
constexpr uint32_t | MYSQL_FETCH_CACHE_THRESHOLD = 4 |
constexpr uint32_t | ROW_PREBUILT_ALLOCATED = 78540783 |
constexpr uint32_t | ROW_PREBUILT_FREED = 26423527 |
constexpr uint32_t | ROW_PREBUILT_FETCH_MAGIC_N = 465765687 |
constexpr uint32_t | ROW_MYSQL_WHOLE_ROW = 0 |
constexpr uint32_t | ROW_MYSQL_REC_FIELDS = 1 |
constexpr uint32_t | ROW_MYSQL_NO_TEMPLATE = 2 |
constexpr uint32_t | ROW_MYSQL_DUMMY_TEMPLATE = 3 |
dummy template used in row_scan_and_check_index More... | |
constexpr uint32_t | ROW_RETRIEVE_PRIMARY_KEY = 1 |
constexpr uint32_t | ROW_RETRIEVE_ALL_COLS = 2 |
constexpr uint32_t | ROW_READ_WITH_LOCKS = 0 |
constexpr uint32_t | ROW_READ_TRY_SEMI_CONSISTENT = 1 |
constexpr uint32_t | ROW_READ_DID_SEMI_CONSISTENT = 2 |
Interface between Innobase row operations and MySQL.
Contains also create table and other data dictionary operations.
Created 9/17/2000 Heikki Tuuri
dfield_t * innobase_get_computed_value | ( | const dtuple_t * | row, |
const dict_v_col_t * | col, | ||
const dict_index_t * | index, | ||
mem_heap_t ** | local_heap, | ||
mem_heap_t * | heap, | ||
const dict_field_t * | ifield, | ||
THD * | thd, | ||
TABLE * | mysql_table, | ||
const dict_table_t * | old_table, | ||
upd_t * | parent_update, | ||
dict_foreign_t * | foreign | ||
) |
Get the computed value by supplying the base column values.
[in,out] | row | the data row |
[in] | col | virtual column |
[in] | index | index on the virtual column |
[in,out] | local_heap | heap memory for processing large data etc. |
[in,out] | heap | memory heap that copies the actual index row |
[in] | ifield | index field |
[in] | thd | MySQL thread handle |
[in,out] | mysql_table | mysql table object |
[in] | old_table | during ALTER TABLE, this is the old table or NULL. |
[in] | parent_update | update vector for the parent row |
[in] | foreign | foreign key information |
dfield_t * innobase_get_field_from_update_vector | ( | dict_foreign_t * | foreign, |
upd_t * | update, | ||
uint32_t | col_no | ||
) |
Get the updated parent field value from the update vector for the given col_no.
[in] | foreign | foreign key information |
[in] | update | updated parent vector. |
[in] | col_no | base column position of the child table to check |
void innobase_get_multi_value | ( | const TABLE * | mysql_table, |
ulint | f_idx, | ||
dfield_t * | dfield, | ||
multi_value_data * | value, | ||
uint | old_val, | ||
ulint | comp, | ||
mem_heap_t * | heap | ||
) |
Parse out multi-values from a MySQL record.
[in] | mysql_table | MySQL table structure |
[in] | f_idx | field index of the multi-value column |
[in,out] | dfield | field structure to store parsed multi-value |
[in,out] | value | nullptr or the multi-value structure to store the parsed values |
[in] | old_val | old value if exists |
[in] | comp | true if InnoDB table uses compact row format |
[in,out] | heap | memory heap |
void innobase_init_vc_templ | ( | dict_table_t * | table | ) |
Get the computed value by supplying the base column values.
[in,out] | table | the table whose virtual column template to be built |
void innobase_rename_vc_templ | ( | dict_table_t * | table | ) |
Change dbname and table name in table->vc_templ.
[in,out] | table | the table whose virtual column template dbname and tbname to be renamed. |
dberr_t row_create_index_for_mysql | ( | dict_index_t * | index, |
trx_t * | trx, | ||
const ulint * | field_lengths, | ||
dict_table_t * | handler | ||
) |
Does an index creation operation for MySQL.
TODO: currently failure to create an index results in dropping the whole table! This is no problem currently as all indexes must be created at the same time as the table.
index | in, own: index definition (will be freed) |
trx | in: transaction handle |
field_lengths | in: if not NULL, must contain dict_index_get_n_fields(index) actual field lengths for the index columns, which are then checked for not being too large. |
handler | in/out: table handler. |
row_prebuilt_t * row_create_prebuilt | ( | dict_table_t * | table, |
ulint | mysql_row_len | ||
) |
Create a prebuilt struct for a MySQL table handle.
table | in: Innobase table handle |
mysql_row_len | in: length in bytes of a row in the MySQL format |
dberr_t row_create_table_for_mysql | ( | dict_table_t *& | table, |
const char * | compression, | ||
const HA_CREATE_INFO * | create_info, | ||
trx_t * | trx, | ||
mem_heap_t * | heap | ||
) |
Creates a table for MySQL.
On success the in-memory table could be kept in non-LRU list while on failure the 'table' object will be freed.
[in,out] | table | table definition(will be freed, or on DB_SUCCESS added to the data dictionary cache) |
[in] | compression | compression algorithm to use, can be nullptr |
[in] | create_info | HA_CREATE_INFO object |
[in,out] | trx | transaction |
[in] | heap | temp memory heap or nullptr |
upd_node_t * row_create_update_node_for_mysql | ( | dict_table_t * | table, |
mem_heap_t * | heap | ||
) |
Creates an query graph node of 'update' type to be used in the MySQL interface.
table | in: table to update |
heap | in: mem heap from which allocated |
void row_delete_all_rows | ( | dict_table_t * | table | ) |
Delete all rows for the given table by freeing/truncating indexes.
[in,out] | table | table handler |
Discards the tablespace of a table which stored in an .ibd file.
Discarding means that this function deletes the .ibd file and assigns a new table id for the table. Also the flag table->ibd_file_missing is set true.
Discarding means that this function renames the .ibd file and assigns a new table id for the table. Also the flag table->ibd_file_missing is set to true.
name | in: table name |
trx | in: transaction handle |
Drop a database for MySQL.
[in] | name | database name which ends at '/' |
[in] | trx | transaction handle |
[out] | found | number of dropped tables |
Drop a table for MySQL.
If the data dictionary was not already locked by the transaction, the transaction will be committed. Otherwise, the data dictionary will remain locked.
[in] | name | table name |
[in,out] | trx | data dictionary transaction |
dberr_t row_drop_table_for_mysql | ( | const char * | name, |
trx_t * | trx, | ||
bool | nonatomic, | ||
dict_table_t * | handler | ||
) |
Drop a table for MySQL.
If the data dictionary was not already locked by the transaction, the transaction will be committed. Otherwise, the data dictionary will remain locked.
[in] | name | Table name |
[in] | trx | Transaction handle |
[in] | nonatomic | Whether it is permitted to release and reacquire dict_operation_lock |
[in,out] | handler | Table handler or NULL |
ulint row_drop_tables_for_mysql_in_background | ( | void | ) |
The master thread in srv0srv.cc calls this regularly to drop tables which we must drop in background after queries to them have ended.
Such lazy dropping of tables is needed in ALTER TABLE on Unix.
The master thread in srv0srv.cc calls this regularly to drop tables which we must drop in background after queries to them have ended.
Such lazy dropping of tables is needed in ALTER TABLE on Unix.
dberr_t row_drop_tablespace | ( | space_id_t | space_id, |
const char * | filepath | ||
) |
Drop a tablespace as part of dropping or renaming a table.
This deletes the fil_space_t if found and the file on disk.
[in] | space_id | Tablespace ID |
[in] | filepath | File path of tablespace to delete |
upd_t * row_get_prebuilt_update_vector | ( | row_prebuilt_t * | prebuilt | ) |
Gets pointer to a prebuilt update vector used in updates.
If the update graph has not yet been built in the prebuilt struct, then this function first builds it.
If the update graph has not yet been built in the prebuilt struct, then this function first builds it.
prebuilt | in: prebuilt struct in MySQL handle |
dberr_t row_insert_for_mysql | ( | const byte * | mysql_rec, |
row_prebuilt_t * | prebuilt | ||
) |
Does an insert for MySQL.
[in] | mysql_rec | row in the MySQL format |
[in,out] | prebuilt | prebuilt struct in MySQL handle |
bool row_is_mysql_tmp_table_name | ( | const char * | name | ) |
Checks if a table name contains the string "/#sql" which denotes temporary tables in MySQL.
dberr_t row_lock_table | ( | row_prebuilt_t * | prebuilt | ) |
Sets a table lock on the table mentioned in prebuilt.
[in,out] | prebuilt | table handle |
dberr_t row_lock_table_autoinc_for_mysql | ( | row_prebuilt_t * | prebuilt | ) |
Sets an AUTO_INC type lock on the table mentioned in prebuilt.
The AUTO_INC lock gives exclusive access to the auto-inc counter of the table. The lock is reserved only for the duration of an SQL statement. It is not compatible with another AUTO_INC or exclusive lock on the table.
The AUTO_INC lock gives exclusive access to the auto-inc counter of the table. The lock is reserved only for the duration of an SQL statement. It is not compatible with another AUTO_INC or exclusive lock on the table.
prebuilt | in: prebuilt struct in the MySQL table handle |
void row_mysql_close | ( | void | ) |
Close this module.
void row_mysql_freeze_data_dictionary | ( | trx_t * | trx, |
ut::Location | location | ||
) |
Locks the data dictionary in shared mode from modifications, for performing foreign key check, rollback, or other operation invisible to MySQL.
[in,out] | trx | Transaction |
[in] | location | Location |
bool row_mysql_handle_errors | ( | dberr_t * | new_err, |
trx_t * | trx, | ||
que_thr_t * | thr, | ||
trx_savept_t * | savept | ||
) |
Handles user errors and lock waits detected by the database engine.
new_err | out: possible new error encountered in lock wait, or if no new error, the value of trx->error_state at the entry of this function |
trx | in: transaction |
thr | in: query thread, or NULL |
savept | in: savepoint, or NULL |
void row_mysql_init | ( | void | ) |
Initialize this module.
void row_mysql_lock_data_dictionary | ( | trx_t * | trx, |
ut::Location | location | ||
) |
Locks the data dictionary exclusively for performing a table create or other data dictionary modification operation.
[in,out] | trx | Transaction |
[in] | location | Location |
dberr_t row_mysql_lock_table | ( | trx_t * | trx, |
dict_table_t * | table, | ||
enum lock_mode | mode, | ||
const char * | op_info | ||
) |
Sets an exclusive lock on a table.
trx | in/out: transaction |
table | in: table to lock |
mode | in: LOCK_X or LOCK_S |
op_info | in: string for trx->op_info |
Pad a column with spaces.
[in] | mbminlen | Minimum size of a character, in bytes |
[out] | pad | Padded buffer |
[in] | len | Number of bytes to pad |
dberr_t row_mysql_parallel_select_count_star | ( | trx_t * | trx, |
std::vector< dict_index_t * > & | indexes, | ||
size_t | max_threads, | ||
ulint * | n_rows | ||
) |
Read the total number of records in a consistent view.
[in,out] | trx | Covering transaction. |
[in] | indexes | Indexes to scan. |
[in] | max_threads | Maximum number of threads to use. |
[out] | n_rows | Number of rows seen. |
void row_mysql_prebuilt_free_blob_heap | ( | row_prebuilt_t * | prebuilt | ) |
Frees the blob heap in prebuilt when no longer needed.
in: prebuilt struct of a ha_innobase:: table handle
Reads a reference to a BLOB in the MySQL format.
[out] | len | BLOB length. |
[in] | ref | BLOB reference in the MySQL format. |
[in] | col_len | BLOB reference length (not BLOB length). |
Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and returns a pointer to the data.
len | out: variable-length field length |
field | in: field in the MySQL format |
lenlen | in: storage length of len: either 1 or 2 bytes |
Stores a reference to a BLOB in the MySQL format.
[in] | dest | Where to store |
[in,out] | col_len | Dest buffer size: determines into how many bytes the blob length is stored, the space for the length may vary from 1 to 4 bytes |
[in] | data | Blob data; if the value to store is sql null this should be null pointer |
[in] | len | Blob length; if the value to store is sql null this should be 0; remember also to set the null bit in the mysql record header! |
byte * row_mysql_store_col_in_innobase_format | ( | dfield_t * | dfield, |
byte * | buf, | ||
bool | row_format_col, | ||
const byte * | mysql_data, | ||
ulint | col_len, | ||
ulint | comp | ||
) |
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format.
The counterpart of this function is row_sel_field_store_in_mysql_format() in row0sel.cc.
The counterpart of this function is row_sel_field_store_in_mysql_format() in row0sel.cc.
dfield | in/out: dfield where dtype information must be already set when this function is called! |
buf | in/out: buffer for a converted integer value; this must be at least col_len long then! NOTE that dfield may also get a pointer to 'buf', therefore do not discard this as long as dfield is used! |
row_format_col | true if the mysql_data is from a MySQL row, false if from a MySQL key value; in MySQL, a true VARCHAR storage format differs in a row and in a key value: in a key value the length is always stored in 2 bytes! |
mysql_data | in: MySQL column value, not SQL NULL; NOTE that dfield may also get a pointer to mysql_data, therefore do not discard this as long as dfield is used! |
col_len | in: MySQL column length; NOTE that this is the storage length of the column in the MySQL format row, not necessarily the length of the actual payload data; if the column is a true VARCHAR then this is irrelevant |
comp | in: nonzero=compact format |
Converts InnoDB geometry data format to MySQL data format.
in: geometry length; if the value to store is SQL NULL this should be 0; remember also to set the NULL bit in the MySQL record header!
Converts InnoDB geometry data format to MySQL data format.
Show the meaning of geometry data.
dest | in/out: where to store |
dest_len | in: dest buffer size: determines into how many bytes the GEOMETRY length is stored, the space for the length may vary from 1 to 4 bytes |
src | in: GEOMETRY data; if the value to store is SQL NULL this should be NULL pointer |
src_len | in: GEOMETRY length; if the value to store is SQL NULL this should be 0; remember also to set the NULL bit in the MySQL record header! |
Stores a >= 5.0.3 format true VARCHAR length to dest, in the MySQL row format.
dest | in: where to store |
len | in: length, must fit in two bytes |
lenlen | in: storage length of len: either 1 or 2 bytes |
void row_mysql_unfreeze_data_dictionary | ( | trx_t * | trx | ) |
Unlocks the data dictionary shared lock.
in/out: transaction
trx | in/out: transaction |
void row_mysql_unlock_data_dictionary | ( | trx_t * | trx | ) |
Unlocks the data dictionary exclusive lock.
in/out: transaction
trx | in/out: transaction |
void row_prebuild_sel_graph | ( | row_prebuilt_t * | prebuilt | ) |
Builds a dummy query graph used in selects.
in: prebuilt struct in MySQL handle
void row_prebuilt_free | ( | row_prebuilt_t * | prebuilt, |
bool | dict_locked | ||
) |
Free a prebuilt struct for a MySQL table handle.
[in,out] | prebuilt | Prebuilt struct |
[in] | dict_locked | True=data dictionary locked |
dberr_t row_rename_table_for_mysql | ( | const char * | old_name, |
const char * | new_name, | ||
const dd::Table * | dd_table, | ||
trx_t * | trx, | ||
bool | replay | ||
) |
Renames a table for MySQL.
[in] | old_name | old table name |
[in] | new_name | new table name |
[in] | dd_table | dd::Table for new table |
[in,out] | trx | transaction |
[in] | replay | whether in replay stage |
dberr_t row_scan_index_for_mysql | ( | row_prebuilt_t * | prebuilt, |
dict_index_t * | index, | ||
size_t | n_threads, | ||
bool | check_keys, | ||
ulint * | n_rows | ||
) |
Scans an index for either COUNT(*) or CHECK TABLE.
If CHECK TABLE; Checks that the index contains entries in an ascending order, unique constraint is not broken, and calculates the number of index entries in the read view of the current transaction.
[in,out] | prebuilt | Prebuilt struct in MySQL handle. |
[in,out] | index | Index to scan. |
[in] | n_threads | Number of threads to use for the scan |
[in] | check_keys | True if called form check table. |
[out] | n_rows | Number of entries seen in the consistent read. |
bool row_table_got_default_clust_index | ( | const dict_table_t * | table | ) |
Checks if a table is such that we automatically created a clustered index on it (on row id).
table | in: table |
dberr_t row_table_load_foreign_constraints | ( | trx_t * | trx, |
const char * | name, | ||
const dd::Table * | dd_table | ||
) |
Loads foreign key constraints for the table being created.
This function should be called after the indexes for a table have been created. Each foreign key constraint must be accompanied with indexes in both participating tables. The indexes are allowed to contain more fields than mentioned in the constraint.
[in] | trx | transaction |
[in] | name | table full name in normalized form |
[in] | dd_table | MySQL dd::Table for the table |
dberr_t row_update_cascade_for_mysql | ( | que_thr_t * | thr, |
upd_node_t * | node, | ||
dict_table_t * | table | ||
) |
Does a cascaded delete or set null in a foreign key operation.
thr | in: query thread |
node | in: update node used in the cascade or set null operation |
table | in: table where we do the operation |
dberr_t row_update_for_mysql | ( | const byte * | mysql_rec, |
row_prebuilt_t * | prebuilt | ||
) |
Does an update or delete of a row for MySQL.
[in] | mysql_rec | row in the MySQL format |
[in,out] | prebuilt | prebuilt struct in MySQL handle |
void row_update_prebuilt_trx | ( | row_prebuilt_t * | prebuilt, |
trx_t * | trx | ||
) |
Updates the transaction pointers in query graphs stored in the prebuilt struct.
[in,out] | prebuilt | Prebuilt struct in MySQL handle. |
[in,out] | trx | Transaction handle. |
void row_wait_for_background_drop_list_empty | ( | ) |
Wait for the background drop list to become empty.
|
constexpr |
|
constexpr |
|
constexpr |
dummy template used in row_scan_and_check_index
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
extern |
Provide optional 4.x backwards compatibility for 5.0 and above.