MySQL 8.0.39
Source Code Documentation
|
InnoDB Native API. More...
Go to the source code of this file.
Classes | |
struct | ib_col_meta_t |
InnoDB column meta data. More... | |
Macros | |
#define | ONLY_FOR_MEMCACHED_SDI(x) |
#define | FOR_EACH_API_METHOD_NAME_STEM(transform) |
Typedefs | |
typedef uint32_t | page_no_t |
Page number. More... | |
typedef uint32_t | space_id_t |
Tablespace identifier. More... | |
typedef struct ib_sdi_key | ib_sdi_key_t |
typedef struct ib_sdi_vector | ib_sdi_vector_t |
typedef enum dberr_t | ib_err_t |
All InnoDB error codes are represented by ib_err_t. More... | |
typedef unsigned char | ib_byte_t |
Representation of a byte within InnoDB. More... | |
typedef unsigned long int | ib_ulint_t |
Representation of an unsigned long int within InnoDB. More... | |
typedef void * | ib_opaque_t |
typedef ib_opaque_t | ib_charset_t |
typedef uint64_t | ib_id_u64_t |
typedef void(* | ib_cb_t) (void) |
Generical InnoDB callback prototype. More... | |
typedef FILE * | ib_msg_stream_t |
The first argument to the InnoDB message logging function. More... | |
typedef int(* | ib_msg_log_t) (ib_msg_stream_t, const char *,...) |
All log messages are written to this function.It should have the same behavior as fprintf(3). More... | |
typedef struct ib_tuple_t * | ib_tpl_t |
InnoDB tuple handle. More... | |
typedef struct trx_t * | ib_trx_t |
InnoDB transaction handle, all database operations need to be covered by transactions. More... | |
typedef struct ib_cursor_t * | ib_crsr_t |
InnoDB cursor handle. More... | |
typedef int(* | ib_client_cmp_t) (const ib_col_meta_t *col_meta, const ib_byte_t *p1, uint64_t p1_len, const ib_byte_t *p2, uint64_t p2_len) |
This function is used to compare two data fields for which the data type is such that we must use the client code to compare them. More... | |
Functions | |
ib_err_t | ib_trx_start (ib_trx_t ib_trx, ib_trx_level_t ib_trx_level, bool read_write, bool auto_commit, void *thd) |
Start a transaction that's been rolled back. More... | |
ib_trx_t | ib_trx_begin (ib_trx_level_t ib_trx_level, bool read_write, bool auto_commit, void *thd) |
Begin a transaction. More... | |
uint32_t | ib_trx_read_only (ib_trx_t ib_trx) |
Check if the transaction is read_only. More... | |
ib_err_t | ib_trx_release (ib_trx_t ib_trx) |
Release the resources of the transaction. More... | |
ib_err_t | ib_trx_commit (ib_trx_t ib_trx) |
Commit a transaction. More... | |
ib_err_t | ib_trx_rollback (ib_trx_t ib_trx) |
Rollback a transaction. More... | |
ib_err_t | ib_cursor_open_index_using_name (ib_crsr_t ib_open_crsr, const char *index_name, ib_crsr_t *ib_crsr, int *idx_type, ib_id_u64_t *idx_id) |
Open an InnoDB secondary index cursor and return a cursor handle to it. More... | |
ib_err_t | ib_cursor_open_table (const char *name, ib_trx_t ib_trx, ib_crsr_t *ib_crsr) |
Open an InnoDB table by name and return a cursor handle to it. More... | |
ib_err_t | ib_cursor_reset (ib_crsr_t ib_crsr) |
Reset the cursor. More... | |
ib_err_t | ib_cursor_close (ib_crsr_t ib_crsr) |
Close an InnoDB table and free the cursor. More... | |
ib_err_t | ib_cursor_new_trx (ib_crsr_t ib_crsr, ib_trx_t ib_trx) |
update the cursor with new transactions and also reset the cursor More... | |
ib_err_t | ib_cursor_commit_trx (ib_crsr_t ib_crsr, ib_trx_t ib_trx) |
Commit the transaction in a cursor. More... | |
ib_err_t | ib_cursor_insert_row (ib_crsr_t ib_crsr, const ib_tpl_t ib_tpl) |
Insert a row to a table. More... | |
ib_err_t | ib_cursor_update_row (ib_crsr_t ib_crsr, const ib_tpl_t ib_old_tpl, const ib_tpl_t ib_new_tpl) |
Update a row in a table. More... | |
ib_err_t | ib_cursor_delete_row (ib_crsr_t ib_crsr) |
Delete a row in a table. More... | |
ib_err_t | ib_cursor_read_row (ib_crsr_t ib_crsr, ib_tpl_t ib_tpl, ib_tpl_t cmp_tpl, int mode, void **row_buf, uint64_t *row_len, uint64_t *used_len) |
Read current row. More... | |
ib_err_t | ib_cursor_first (ib_crsr_t ib_crsr) |
Move cursor to the first record in the table. More... | |
ib_err_t | ib_cursor_next (ib_crsr_t ib_crsr) |
Move cursor to the next record in the table. More... | |
ib_err_t | ib_cursor_moveto (ib_crsr_t ib_crsr, ib_tpl_t ib_tpl, ib_srch_mode_t ib_srch_mode, uint64_t direction) |
Search for key. More... | |
void | ib_cursor_set_match_mode (ib_crsr_t ib_crsr, ib_match_mode_t match_mode) |
Set the match mode for ib_cursor_move(). More... | |
ib_err_t | ib_col_set_value (ib_tpl_t ib_tpl, ib_ulint_t col_no, const void *src, uint64_t len, bool need_cpy) |
Set a column of the tuple. More... | |
uint64_t | ib_col_get_len (ib_tpl_t ib_tpl, ib_ulint_t i) |
Get the size of the data available in the column the tuple. More... | |
uint64_t | ib_col_copy_value (ib_tpl_t ib_tpl, ib_ulint_t i, void *dst, uint32_t len) |
Copy a column value from the tuple. More... | |
ib_err_t | ib_tuple_read_i8 (ib_tpl_t ib_tpl, ib_ulint_t i, int8_t *ival) |
Read a signed int 8 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_u8 (ib_tpl_t ib_tpl, ib_ulint_t i, uint8_t *ival) |
Read an unsigned int 8 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_i16 (ib_tpl_t ib_tpl, ib_ulint_t i, int16_t *ival) |
Read a signed int 16 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_u16 (ib_tpl_t ib_tpl, ib_ulint_t i, uint16_t *ival) |
Read an unsigned int 16 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_i32 (ib_tpl_t ib_tpl, ib_ulint_t i, int32_t *ival) |
Read a signed int 32 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_u32 (ib_tpl_t ib_tpl, ib_ulint_t i, uint32_t *ival) |
Read an unsigned int 32 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_i64 (ib_tpl_t ib_tpl, ib_ulint_t i, int64_t *ival) |
Read a signed int 64 bit column from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_read_u64 (ib_tpl_t ib_tpl, ib_ulint_t i, uint64_t *ival) |
Read an unsigned int 64 bit column from an InnoDB tuple. More... | |
const void * | ib_col_get_value (ib_tpl_t ib_tpl, ib_ulint_t i) |
Get a column value pointer from the tuple. More... | |
uint64_t | ib_col_get_meta (ib_tpl_t ib_tpl, ib_ulint_t i, ib_col_meta_t *ib_col_meta) |
Get a column type, length and attributes from the tuple. More... | |
ib_tpl_t | ib_tuple_clear (ib_tpl_t ib_tpl) |
"Clear" or reset an InnoDB tuple. More... | |
ib_err_t | ib_tuple_get_cluster_key (ib_crsr_t ib_crsr, ib_tpl_t *ib_dst_tpl, const ib_tpl_t ib_src_tpl) |
Create a new cluster key search tuple and copy the contents of the secondary index key tuple columns that refer to the cluster index record to the cluster key. More... | |
ib_tpl_t | ib_sec_search_tuple_create (ib_crsr_t ib_crsr) |
Create an InnoDB tuple used for index/table search. More... | |
ib_tpl_t | ib_sec_read_tuple_create (ib_crsr_t ib_crsr) |
Create an InnoDB tuple used for index/table search. More... | |
ib_tpl_t | ib_clust_search_tuple_create (ib_crsr_t ib_crsr) |
Create an InnoDB tuple used for table key operations. More... | |
ib_tpl_t | ib_clust_read_tuple_create (ib_crsr_t ib_crsr) |
Create an InnoDB tuple for table row operations. More... | |
uint64_t | ib_tuple_get_n_user_cols (const ib_tpl_t ib_tpl) |
Return the number of user columns in the tuple definition. More... | |
uint64_t | ib_tuple_get_n_cols (const ib_tpl_t ib_tpl) |
Return the number of columns in the tuple definition. More... | |
void | ib_tuple_delete (ib_tpl_t ib_tpl) |
Destroy an InnoDB tuple. More... | |
ib_err_t | ib_table_get_id (const char *table_name, ib_id_u64_t *table_id) |
Get a table id. More... | |
bool | ib_cursor_is_positioned (const ib_crsr_t ib_crsr) |
Check if cursor is positioned. More... | |
bool | ib_schema_lock_is_exclusive (const ib_trx_t ib_trx) |
Checks if the data dictionary is latched in exclusive mode by a user transaction. More... | |
ib_err_t | ib_cursor_lock (ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode) |
Lock an InnoDB cursor/table. More... | |
ib_err_t | ib_cursor_set_lock_mode (ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode) |
Set the Lock mode of the cursor. More... | |
void | ib_cursor_set_cluster_access (ib_crsr_t ib_crsr) |
Set need to access clustered index record flag. More... | |
void | ib_cursor_stmt_begin (ib_crsr_t ib_crsr) |
Inform the cursor that it's the start of an SQL statement. More... | |
ib_err_t | ib_tuple_write_double (ib_tpl_t ib_tpl, int col_no, double val) |
Write a double value to a column. More... | |
ib_err_t | ib_tuple_read_double (ib_tpl_t ib_tpl, uint64_t col_no, double *dval) |
Read a double column value from an InnoDB tuple. More... | |
ib_err_t | ib_tuple_write_float (ib_tpl_t ib_tpl, int col_no, float val) |
Write a float value to a column. More... | |
ib_err_t | ib_tuple_read_float (ib_tpl_t ib_tpl, uint64_t col_no, float *fval) |
Read a float value from an InnoDB tuple. More... | |
const char * | ib_col_get_name (ib_crsr_t ib_crsr, ib_ulint_t i) |
Get a column type, length and attributes from the tuple. More... | |
const char * | ib_get_idx_field_name (ib_crsr_t ib_crsr, ib_ulint_t i) |
Get an index field name from the cursor. More... | |
int | ib_cfg_get_cfg () |
Get generic configure status. More... | |
ib_trx_level_t | ib_cfg_trx_level () |
Return isolation configuration set by "innodb_api_trx_level". More... | |
uint64_t | ib_cfg_bk_commit_interval () |
Return configure value for background commit interval (in seconds) More... | |
uint64_t | ib_trx_get_start_time (ib_trx_t ib_trx) |
Get a trx start time. More... | |
const char * | ib_ut_strerr (ib_err_t num) |
Wrapper of ut_strerr() which converts an InnoDB error number to a human readable text message. More... | |
ib_err_t | ib_sdi_get_keys (uint32_t tablespace_id, ib_sdi_vector_t *ib_sdi_vector, ib_trx_t trx) |
Get the SDI keys in a tablespace into vector. More... | |
ib_err_t | ib_sdi_get (uint32_t tablespace_id, const ib_sdi_key_t *ib_sdi_key, void *comp_sdi, uint32_t *comp_sdi_len, uint32_t *uncomp_sdi_len, ib_trx_t trx) |
Retrieve SDI from tablespace. More... | |
ib_err_t | ib_sdi_set (uint32_t tablespace_id, const ib_sdi_key_t *sdi_key, uint32_t uncomp_len, uint32_t comp_len, const void *sdi, ib_trx_t trx) |
Insert/Update SDI in tablespace. More... | |
ib_err_t | ib_sdi_delete (uint32_t tablespace_id, const ib_sdi_key_t *sdi_key, ib_trx_t trx) |
Delete SDI from tablespace. More... | |
ib_err_t | ib_sdi_create (space_id_t tablespace_id) |
Create SDI in a tablespace. More... | |
ib_err_t | ib_sdi_drop (space_id_t tablespace_id) |
Drop SDI Index from tablespace. More... | |
ib_err_t | ib_sdi_flush (space_id_t space_id) |
Flush SDI in a tablespace. More... | |
bool | ib_is_virtual_table (ib_crsr_t crsr) |
Check the table whether it contains virtual columns. More... | |
Variables | |
constexpr uint32_t | IB_CFG_BINLOG_ENABLED = 0x1 |
constexpr uint32_t | IB_CFG_MDL_ENABLED = 0x2 |
constexpr uint32_t | IB_CFG_DISABLE_ROWLOCK = 0x4 |
static const size_t | REC_BUF_SLOT_SIZE = 16384 |
Used by ib_read_tuple to determine number of bytes to allocate for new slot if needed. More... | |
constexpr uint32_t | IB_SQL_NULL = 0xFFFFFFFF |
Represents SQL_NULL length. More... | |
InnoDB Native API.
2008-08-01 Created by Sunny Bains. 3/20/2011 Jimmy Yang extracted from Embedded InnoDB
#define FOR_EACH_API_METHOD_NAME_STEM | ( | transform | ) |
#define ONLY_FOR_MEMCACHED_SDI | ( | x | ) |
typedef unsigned char ib_byte_t |
Representation of a byte within InnoDB.
typedef void(* ib_cb_t) (void) |
Generical InnoDB callback prototype.
typedef ib_opaque_t ib_charset_t |
typedef int(* ib_client_cmp_t) (const ib_col_meta_t *col_meta, const ib_byte_t *p1, uint64_t p1_len, const ib_byte_t *p2, uint64_t p2_len) |
This function is used to compare two data fields for which the data type is such that we must use the client code to compare them.
col_meta | column meta data |
p1 | key |
p1_len | key length |
p2 | second key |
p2_len | second key length |
typedef struct ib_cursor_t* ib_crsr_t |
InnoDB cursor handle.
typedef uint64_t ib_id_u64_t |
typedef int(* ib_msg_log_t) (ib_msg_stream_t, const char *,...) |
All log messages are written to this function.It should have the same behavior as fprintf(3).
typedef FILE* ib_msg_stream_t |
The first argument to the InnoDB message logging function.
By default it's set to stderr. You should treat ib_msg_stream_t as a void*, since it will probably change in the future.
typedef void* ib_opaque_t |
typedef struct ib_sdi_key ib_sdi_key_t |
typedef struct ib_sdi_vector ib_sdi_vector_t |
typedef struct ib_tuple_t* ib_tpl_t |
InnoDB tuple handle.
This handle can refer to either a cluster index tuple or a secondary index tuple. There are two types of tuples for each type of index, making a total of four types of tuple handles. There is a tuple for reading the entire row contents and another for searching on the index key.
InnoDB transaction handle, all database operations need to be covered by transactions.
This handle represents a transaction. The handle can be created with ib_trx_begin(), you commit your changes with ib_trx_commit() and undo your changes using ib_trx_rollback(). If the InnoDB deadlock monitor rolls back the transaction then you need to free the transaction using the function ib_trx_release(). You can query the state of an InnoDB transaction by calling ib_trx_state().
typedef unsigned long int ib_ulint_t |
Representation of an unsigned long int within InnoDB.
typedef uint32_t page_no_t |
Page number.
typedef uint32_t space_id_t |
Tablespace identifier.
enum ib_cfg_type_t |
Possible types for a configuration variable.
enum ib_col_attr_t |
InnoDB column attributes.
enum ib_col_type_t |
column types that are supported.
enum ib_index_type_t |
enum ib_lck_mode_t |
InnoDB lock modes.
enum ib_match_mode_t |
Various match modes used by ib_cursor_moveto()
enum ib_srch_mode_t |
InnoDB cursor search modes for ib_cursor_moveto().
Note: Values must match those found in page0cur.h
enum ib_tbl_fmt_t |
InnoDB table format types.
enum ib_trx_level_t |
Transaction isolation levels.
uint64_t ib_cfg_bk_commit_interval | ( | ) |
Return configure value for background commit interval (in seconds)
int ib_cfg_get_cfg | ( | ) |
Get generic configure status.
ib_trx_level_t ib_cfg_trx_level | ( | ) |
Return isolation configuration set by "innodb_api_trx_level".
Create an InnoDB tuple for table row operations.
[in] | ib_crsr | Cursor instance |
ib_crsr | in: Cursor instance |
Create an InnoDB tuple used for table key operations.
[in] | ib_crsr | Cursor instance |
ib_crsr | in: Cursor instance |
uint64_t ib_col_copy_value | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
void * | dst, | ||
uint32_t | len | ||
) |
Copy a column value from the tuple.
[in] | ib_tpl | tuple instance |
[in] | i | in column index in tuple |
[out] | dst | copied data value |
[in] | len | max data value len to copy |
uint64_t ib_col_get_len | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i | ||
) |
Get the size of the data available in the column the tuple.
[in] | ib_tpl | tuple instance |
[in] | i | column index in tuple |
uint64_t ib_col_get_meta | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
ib_col_meta_t * | ib_col_meta | ||
) |
Get a column type, length and attributes from the tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ib_col_meta | column meta data |
const char * ib_col_get_name | ( | ib_crsr_t | ib_crsr, |
ib_ulint_t | i | ||
) |
Get a column type, length and attributes from the tuple.
[in] | ib_crsr | InnoDB cursor instance |
[in] | i | column index in tuple |
const void * ib_col_get_value | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i | ||
) |
Get a column value pointer from the tuple.
[in] | ib_tpl | tuple instance |
[in] | i | column index in tuple |
ib_err_t ib_col_set_value | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | col_no, | ||
const void * | src, | ||
uint64_t | len, | ||
bool | need_cpy | ||
) |
Set a column of the tuple.
Make a copy using the tuple's heap.
[in] | ib_tpl | tuple instance |
[in] | col_no | column index in tuple |
[in] | src | data value |
[in] | len | data value len |
[in] | need_cpy | if need memcpy |
Close an InnoDB table and free the cursor.
ib_crsr | in,own: InnoDB cursor |
Commit the transaction in a cursor.
ib_crsr | in/out: InnoDB cursor |
ib_trx | in: transaction |
Delete a row in a table.
ib_crsr | in: InnoDB cursor instance |
Move cursor to the first record in the table.
ib_crsr | in: InnoDB cursor instance |
Insert a row to a table.
ib_crsr | in/out: InnoDB cursor instance |
ib_tpl | in: tuple to insert |
bool ib_cursor_is_positioned | ( | const ib_crsr_t | ib_crsr | ) |
Check if cursor is positioned.
[in] | ib_crsr | InnoDB cursor instance |
ib_err_t ib_cursor_lock | ( | ib_crsr_t | ib_crsr, |
ib_lck_mode_t | ib_lck_mode | ||
) |
Lock an InnoDB cursor/table.
[in,out] | ib_crsr | InnoDB cursor |
[in] | ib_lck_mode | InnoDB lock mode |
Lock an InnoDB cursor/table.
ib_crsr | in/out: InnoDB cursor |
ib_lck_mode | in: InnoDB lock mode |
ib_err_t ib_cursor_moveto | ( | ib_crsr_t | ib_crsr, |
ib_tpl_t | ib_tpl, | ||
ib_srch_mode_t | ib_srch_mode, | ||
uint64_t | direction | ||
) |
Search for key.
ib_crsr | in: InnoDB cursor instance |
ib_tpl | in: Key to search for |
ib_srch_mode | in: search mode |
direction | in: search direction |
update the cursor with new transactions and also reset the cursor
ib_crsr | in/out: InnoDB cursor |
ib_trx | in: transaction |
Move cursor to the next record in the table.
Move cursor to the next record in the table.
ib_crsr | in: InnoDB cursor instance |
ib_err_t ib_cursor_open_index_using_name | ( | ib_crsr_t | ib_open_crsr, |
const char * | index_name, | ||
ib_crsr_t * | ib_crsr, | ||
int * | idx_type, | ||
ib_id_u64_t * | idx_id | ||
) |
Open an InnoDB secondary index cursor and return a cursor handle to it.
ib_open_crsr | in: open/active cursor |
index_name | in: secondary index name |
ib_crsr | out,own: InnoDB index cursor |
idx_type | out: index is cluster index |
idx_id | out: index id |
Open an InnoDB table by name and return a cursor handle to it.
Open an InnoDB table by name and return a cursor handle to it.
name | in: table name |
ib_trx | in: Current transaction handle can be NULL |
ib_crsr | out,own: InnoDB cursor |
ib_err_t ib_cursor_read_row | ( | ib_crsr_t | ib_crsr, |
ib_tpl_t | ib_tpl, | ||
ib_tpl_t | cmp_tpl, | ||
int | mode, | ||
void ** | row_buf, | ||
uint64_t * | slot, | ||
uint64_t * | used_len | ||
) |
Read current row.
ib_crsr | in: InnoDB cursor instance |
ib_tpl | out: read cols into this tuple |
cmp_tpl | in: tuple to compare and stop reading |
mode | in: mode determine when to stop read |
row_buf | in/out: row buffer |
slot | in/out: slot being used |
used_len | in/out: buffer len used |
Reset the cursor.
ib_crsr | in/out: InnoDB cursor |
void ib_cursor_set_cluster_access | ( | ib_crsr_t | ib_crsr | ) |
Set need to access clustered index record flag.
[in,out] | ib_crsr | InnoDB cursor |
Set need to access clustered index record flag.
ib_crsr | in/out: InnoDB cursor |
ib_err_t ib_cursor_set_lock_mode | ( | ib_crsr_t | ib_crsr, |
ib_lck_mode_t | ib_lck_mode | ||
) |
Set the Lock mode of the cursor.
[in,out] | ib_crsr | InnoDB cursor |
[in] | ib_lck_mode | InnoDB lock mode |
ib_crsr | in/out: InnoDB cursor |
ib_lck_mode | in: InnoDB lock mode |
void ib_cursor_set_match_mode | ( | ib_crsr_t | ib_crsr, |
ib_match_mode_t | match_mode | ||
) |
Set the match mode for ib_cursor_move().
[in] | ib_crsr | Cursor instance |
[in] | match_mode | ib_cursor_moveto match mode |
Set the match mode for ib_cursor_move().
ib_crsr | in: Cursor instance |
match_mode | in: ib_cursor_moveto match mode |
void ib_cursor_stmt_begin | ( | ib_crsr_t | ib_crsr | ) |
Inform the cursor that it's the start of an SQL statement.
[in,out] | ib_crsr | InnoDB cursor |
ib_crsr | in: cursor |
ib_err_t ib_cursor_update_row | ( | ib_crsr_t | ib_crsr, |
const ib_tpl_t | ib_old_tpl, | ||
const ib_tpl_t | ib_new_tpl | ||
) |
Update a row in a table.
ib_crsr | in: InnoDB cursor instance |
ib_old_tpl | in: Old tuple in table |
ib_new_tpl | in: New tuple to update |
const char * ib_get_idx_field_name | ( | ib_crsr_t | ib_crsr, |
ib_ulint_t | i | ||
) |
Get an index field name from the cursor.
[in] | ib_crsr | InnoDB cursor instance |
[in] | i | column index in tuple |
bool ib_is_virtual_table | ( | ib_crsr_t | crsr | ) |
Check the table whether it contains virtual columns.
[in] | crsr | InnoDB Cursor |
bool ib_schema_lock_is_exclusive | ( | const ib_trx_t | ib_trx | ) |
Checks if the data dictionary is latched in exclusive mode by a user transaction.
[in] | ib_trx | transaction |
Checks if the data dictionary is latched in exclusive mode by a user transaction.
ib_trx | in: transaction |
ib_err_t ib_sdi_create | ( | space_id_t | tablespace_id | ) |
Create SDI in a tablespace.
[in] | tablespace_id | InnoDB tablespace id |
ib_err_t ib_sdi_delete | ( | uint32_t | tablespace_id, |
const ib_sdi_key_t * | sdi_key, | ||
ib_trx_t | trx | ||
) |
Delete SDI from tablespace.
[in] | tablespace_id | tablespace id |
[in] | sdi_key | SDI key to uniquely identify the tablespace object |
[in,out] | trx | innodb transaction |
ib_err_t ib_sdi_drop | ( | space_id_t | tablespace_id | ) |
Drop SDI Index from tablespace.
This should be used only when SDI is corrupted.
[in] | tablespace_id | InnoDB tablespace id |
ib_err_t ib_sdi_flush | ( | space_id_t | space_id | ) |
Flush SDI in a tablespace.
The pages of a SDI Index modified by the transaction will be flushed to disk.
[in] | space_id | tablespace id |
ib_err_t ib_sdi_get | ( | uint32_t | tablespace_id, |
const ib_sdi_key_t * | ib_sdi_key, | ||
void * | comp_sdi, | ||
uint32_t * | comp_sdi_len, | ||
uint32_t * | uncomp_sdi_len, | ||
ib_trx_t | trx | ||
) |
Retrieve SDI from tablespace.
[in] | tablespace_id | tablespace id |
[in] | ib_sdi_key | SDI key |
[in,out] | comp_sdi | in: buffer to hold the SDI BLOB out: compressed SDI retrieved from tablespace |
[in,out] | comp_sdi_len | in: Size of memory allocated out: compressed length of SDI |
[out] | uncomp_sdi_len | out: uncompressed length of SDI |
[in,out] | trx | innodb transaction |
ib_err_t ib_sdi_get_keys | ( | uint32_t | tablespace_id, |
ib_sdi_vector_t * | ib_sdi_vector, | ||
ib_trx_t | trx | ||
) |
Get the SDI keys in a tablespace into vector.
[in] | tablespace_id | tablespace id |
[in,out] | ib_sdi_vector | vector to hold objects with tablespace types and ids |
[in,out] | trx | data dictionary transaction |
ib_err_t ib_sdi_set | ( | uint32_t | tablespace_id, |
const ib_sdi_key_t * | sdi_key, | ||
uint32_t | uncomp_len, | ||
uint32_t | comp_len, | ||
const void * | sdi, | ||
ib_trx_t | trx | ||
) |
Insert/Update SDI in tablespace.
[in] | tablespace_id | tablespace id |
[in] | sdi_key | SDI key to uniquely identify the tablespace object |
[in] | uncomp_len | uncompressed length of SDI |
[in] | comp_len | compressed length of SDI |
[in] | sdi | compressed SDI to be stored in tablespace |
[in,out] | trx | innodb transaction |
Create an InnoDB tuple used for index/table search.
[in] | ib_crsr | Cursor instance |
ib_crsr | in: Cursor instance |
Create an InnoDB tuple used for index/table search.
[in] | ib_crsr | Cursor instance |
ib_crsr | in: Cursor instance |
ib_err_t ib_table_get_id | ( | const char * | table_name, |
ib_id_u64_t * | table_id | ||
) |
Get a table id.
[in] | table_name | table_to_find |
[out] | table_id | table id if found |
This function will acquire the dictionary mutex.
table_name | in: table to find |
table_id | out: table id if found |
ib_trx_t ib_trx_begin | ( | ib_trx_level_t | ib_trx_level, |
bool | read_write, | ||
bool | auto_commit, | ||
void * | thd | ||
) |
Begin a transaction.
This will allocate a new transaction handle and put the transaction in the active state.
[in] | ib_trx_level | trx isolation level |
[in] | read_write | true if read write transaction |
[in] | auto_commit | auto commit after each single DML |
[in,out] | thd | MySQL THD |
This will allocate a new transaction handle. put the transaction in the active state.
ib_trx_level | in: trx isolation level |
read_write | in: true if read write transaction |
auto_commit | in: auto commit after each single DML |
thd | in,out: MySQL THD |
Commit a transaction.
This function will release the schema latches too. It will also free the transaction handle.
This function will also release the schema latches too.
ib_trx | in: trx handle |
uint64_t ib_trx_get_start_time | ( | ib_trx_t | ib_trx | ) |
Get a trx start time.
ib_trx | in: transaction |
uint32_t ib_trx_read_only | ( | ib_trx_t | ib_trx | ) |
Check if the transaction is read_only.
in: trx handle
Check if the transaction is read_only.
ib_trx | in: trx handle |
Release the resources of the transaction.
If the transaction was selected as a victim by InnoDB and rolled back then use this function to free the transaction handle.
ib_trx | in: trx handle |
Rollback a transaction.
This function will release the schema latches too. It will also free the transaction handle.
This function will also release the schema latches too.
ib_trx | in: trx handle |
ib_err_t ib_trx_start | ( | ib_trx_t | ib_trx, |
ib_trx_level_t | ib_trx_level, | ||
bool | read_write, | ||
bool | auto_commit, | ||
void * | thd | ||
) |
Start a transaction that's been rolled back.
This special function exists for the case when InnoDB's deadlock detector has rolledack a transaction. While the transaction has been rolled back the handle is still valid and can be reused by calling this function. If you don't want to reuse the transaction handle then you can free the handle by calling ib_trx_release().
Start a transaction that's been rolled back.
ib_trx | in: transaction to restart |
ib_trx_level | in: trx isolation level |
read_write | in: true if read write transaction |
auto_commit | in: auto commit after each single DML |
thd | in: THD |
"Clear" or reset an InnoDB tuple.
We free the heap and recreate the tuple.
We free the heap and recreate the tuple.
ib_tpl | in,own: tuple (will be freed) |
void ib_tuple_delete | ( | ib_tpl_t | ib_tpl | ) |
Destroy an InnoDB tuple.
[in] | ib_tpl | Tuple for current table |
ib_tpl | in,own: Tuple instance to delete |
ib_err_t ib_tuple_get_cluster_key | ( | ib_crsr_t | ib_crsr, |
ib_tpl_t * | ib_dst_tpl, | ||
const ib_tpl_t | ib_src_tpl | ||
) |
Create a new cluster key search tuple and copy the contents of the secondary index key tuple columns that refer to the cluster index record to the cluster key.
It does a deep copy of the column data.
[in] | ib_crsr | secondary index cursor |
[out] | ib_dst_tpl | destination tuple |
[in] | ib_src_tpl | source tuple |
It does a deep copy of the column data.
ib_crsr | in: secondary index cursor |
ib_dst_tpl | out,own: destination tuple |
ib_src_tpl | in: source tuple |
uint64_t ib_tuple_get_n_cols | ( | const ib_tpl_t | ib_tpl | ) |
Return the number of columns in the tuple definition.
[in] | ib_tpl | Tuple for current table |
ib_tpl | in: Tuple for table/index |
uint64_t ib_tuple_get_n_user_cols | ( | const ib_tpl_t | ib_tpl | ) |
Return the number of user columns in the tuple definition.
[in] | ib_tpl | Tuple for current table |
ib_tpl | in: Tuple for current table |
Read a double column value from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | col_no | column number |
[out] | dval | double value |
ib_tpl | in: InnoDB tuple |
col_no | in: column number |
dval | out: double value |
Read a float value from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | col_no | column number |
[out] | fval | float value |
ib_err_t ib_tuple_read_i16 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
int16_t * | ival | ||
) |
Read a signed int 16 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_i32 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
int32_t * | ival | ||
) |
Read a signed int 32 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_i64 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
int64_t * | ival | ||
) |
Read a signed int 64 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_i8 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
int8_t * | ival | ||
) |
Read a signed int 8 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_u16 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
uint16_t * | ival | ||
) |
Read an unsigned int 16 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_u32 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
uint32_t * | ival | ||
) |
Read an unsigned int 32 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_u64 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
uint64_t * | ival | ||
) |
Read an unsigned int 64 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuple |
[in] | i | column number |
[out] | ival | integer value |
ib_err_t ib_tuple_read_u8 | ( | ib_tpl_t | ib_tpl, |
ib_ulint_t | i, | ||
uint8_t * | ival | ||
) |
Read an unsigned int 8 bit column from an InnoDB tuple.
[in] | ib_tpl | InnoDB tuplr |
[in] | i | column number |
[out] | ival | integer value |
Write a double value to a column.
[in] | ib_tpl | InnoDB tuple |
[in] | col_no | column number |
[in] | val | value to write |
ib_tpl | in/out: tuple to write to |
col_no | in: column number |
val | in: value to write |
Write a float value to a column.
[in,out] | ib_tpl | tuple to write to |
[in] | col_no | column number |
[in] | val | value to write |
const char * ib_ut_strerr | ( | ib_err_t | num | ) |
Wrapper of ut_strerr() which converts an InnoDB error number to a human readable text message.
num | in: error number |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
Represents SQL_NULL length.
|
static |
Used by ib_read_tuple to determine number of bytes to allocate for new slot if needed.