#include "univ.i"
#include "trx0types.h"
#include "dict0types.h"
#include "lock0types.h"
#include "usr0types.h"
#include "que0types.h"
#include "mem0mem.h"
#include "read0types.h"
#include "trx0xa.h"
#include "ut0vec.h"
Go to the source code of this file.
Classes | |
struct | trx_sig_struct |
struct | trx_struct |
struct | commit_node_struct |
Namespaces | |
drizzled | |
TODO: Rename this file - func.h is stupid. | |
Macros | |
#define | trx0trx_h |
#define | TRX_WEIGHT(t) ((t)->undo_no + UT_LIST_GET_LEN((t)->trx_locks)) |
#define | TRX_QUE_STATE_STR_MAX_LEN 12 /* "ROLLING BACK" */ |
#define | TRX_MAGIC_N 91118598 |
#define | TRX_MAX_N_THREADS |
#define | TRX_NOT_STARTED 0 |
#define | TRX_ACTIVE 1 |
#define | TRX_COMMITTED_IN_MEMORY 2 |
#define | TRX_PREPARED 3 /* Support for 2PC/XA */ |
#define | TRX_QUE_RUNNING 0 /* transaction is running */ |
#define | TRX_QUE_LOCK_WAIT 1 /* transaction is waiting for a lock */ |
#define | TRX_QUE_ROLLING_BACK 2 /* transaction is rolling back */ |
#define | TRX_QUE_COMMITTING 3 /* transaction is committing */ |
#define | TRX_ISO_READ_UNCOMMITTED |
#define | TRX_ISO_READ_COMMITTED |
#define | TRX_ISO_REPEATABLE_READ |
#define | TRX_ISO_SERIALIZABLE |
#define | TRX_DUP_IGNORE 1 /* duplicate rows are to be updated */ |
#define | TRX_DUP_REPLACE 2 /* duplicate rows are to be replaced */ |
#define | TRX_SIG_NO_SIGNAL 0 |
#define | TRX_SIG_TOTAL_ROLLBACK 1 |
#define | TRX_SIG_ROLLBACK_TO_SAVEPT 2 |
#define | TRX_SIG_COMMIT 3 |
#define | TRX_SIG_ERROR_OCCURRED 4 |
#define | TRX_SIG_BREAK_EXECUTION 5 |
#define | TRX_SIG_SELF |
#define | TRX_SIG_OTHER_SESS |
Typedefs | |
typedef enum trx_dict_op | trx_dict_op_t |
Enumerations | |
enum | trx_dict_op { TRX_DICT_OP_NONE = 0, TRX_DICT_OP_TABLE = 1, TRX_DICT_OP_INDEX = 2 } |
enum | commit_node_state { COMMIT_NODE_SEND = 1, COMMIT_NODE_WAIT } |
Functions | |
UNIV_INTERN void | trx_search_latch_release_if_reserved (trx_t *trx) |
UNIV_INTERN void | trx_set_detailed_error (trx_t *trx, const char *msg) |
UNIV_INTERN void | trx_set_detailed_error_from_file (trx_t *trx, FILE *file) |
UNIV_INLINE ibool | trx_log_commit_id (const trx_t *trx) |
UNIV_INLINE const dict_index_t * | trx_get_error_info (const trx_t *trx) |
UNIV_INTERN trx_t * | trx_create (sess_t *sess) __attribute__((nonnull)) |
UNIV_INTERN trx_t * | trx_allocate_for_mysql (void) |
UNIV_INTERN trx_t * | trx_allocate_for_background (void) |
UNIV_INTERN void | trx_free (trx_t *trx) |
UNIV_INTERN void | trx_free_for_mysql (trx_t *trx) |
UNIV_INTERN void | trx_free_for_background (trx_t *trx) |
UNIV_INTERN void | trx_lists_init_at_db_start (void) |
UNIV_INTERN ibool | trx_start (trx_t *trx, ulint rseg_id) |
UNIV_INTERN ibool | trx_start_low (trx_t *trx, ulint rseg_id) |
UNIV_INLINE void | trx_start_if_not_started (trx_t *trx) |
UNIV_INLINE void | trx_start_if_not_started_low (trx_t *trx) |
UNIV_INTERN void | trx_commit_off_kernel (trx_t *trx) |
UNIV_INTERN void | trx_cleanup_at_db_startup (trx_t *trx) |
UNIV_INTERN ulint | trx_commit_for_mysql (trx_t *trx) |
UNIV_INTERN ulint | trx_prepare_for_mysql (trx_t *trx) |
UNIV_INTERN int | trx_recover_for_mysql (XID *xid_list, ulint len) |
UNIV_INTERN trx_t * | trx_get_trx_by_xid (const XID *xid) |
UNIV_INTERN ulint | trx_commit_complete_for_mysql (trx_t *trx) |
UNIV_INTERN void | trx_mark_sql_stat_end (trx_t *trx) |
UNIV_INTERN read_view_t * | trx_assign_read_view (trx_t *trx) |
UNIV_INTERN void | trx_end_lock_wait (trx_t *trx) |
UNIV_INTERN void | trx_sig_send (trx_t *trx, ulint type, ulint sender, que_thr_t *receiver_thr, trx_savept_t *savept, que_thr_t **next_thr) |
UNIV_INTERN void | trx_sig_reply (trx_sig_t *sig, que_thr_t **next_thr) |
UNIV_INTERN void | trx_sig_remove (trx_t *trx, trx_sig_t *sig) |
UNIV_INTERN void | trx_sig_start_handle (trx_t *trx, que_thr_t **next_thr) |
UNIV_INTERN void | trx_end_signal_handling (trx_t *trx) |
UNIV_INTERN commit_node_t * | commit_node_create (mem_heap_t *heap) |
UNIV_INTERN que_thr_t * | trx_commit_step (que_thr_t *thr) |
UNIV_INTERN void | trx_print (FILE *f, trx_t *trx, ulint max_query_len) |
UNIV_INLINE enum trx_dict_op | trx_get_dict_operation (const trx_t *trx) __attribute__((pure)) |
UNIV_INLINE void | trx_set_dict_operation (trx_t *trx, enum trx_dict_op op) |
UNIV_INTERN ibool | trx_is_interrupted (trx_t *trx) |
UNIV_INTERN ibool | trx_is_strict (trx_t *trx) |
UNIV_INTERN ibool | trx_weight_ge (const trx_t *a, const trx_t *b) |
UNIV_INLINE const char * | trx_get_que_state_str (const trx_t *trx) |
Variables | |
sess_t * | trx_dummy_sess |
ulint | trx_n_mysql_transactions |
#define TRX_ISO_READ_COMMITTED |
#define TRX_ISO_READ_UNCOMMITTED |
#define TRX_ISO_REPEATABLE_READ |
#define TRX_ISO_SERIALIZABLE |
#define TRX_MAX_N_THREADS |
#define TRX_SIG_OTHER_SESS |
#define TRX_SIG_SELF |
#define TRX_WEIGHT | ( | t | ) | ((t)->undo_no + UT_LIST_GET_LEN((t)->trx_locks)) |
Calculates the "weight" of a transaction. The weight of one transaction is estimated as the number of altered rows + the number of locked rows.
t | transaction |
Definition at line 422 of file trx0trx.h.
Referenced by trx_weight_ge().
typedef enum trx_dict_op trx_dict_op_t |
Type of data dictionary operation
enum commit_node_state |
enum trx_dict_op |
Type of data dictionary operation
UNIV_INTERN commit_node_t* commit_node_create | ( | mem_heap_t * | heap | ) |
Creates a commit command node struct.
Creates a commit command node struct.
heap | in: mem heap where created |
Definition at line 1530 of file trx0trx.cc.
References COMMIT_NODE_SEND, commit_node_struct::common, mem_heap_alloc(), commit_node_struct::state, and que_common_struct::type.
Referenced by ind_create_graph_create(), pars_commit_statement(), and tab_create_graph_create().
UNIV_INTERN trx_t* trx_allocate_for_background | ( | void | ) |
Creates a transaction object for background operations by the master thread.
Definition at line 226 of file trx0trx.cc.
References trx_create(), and trx_dummy_sess.
Referenced by row_merge_drop_temp_indexes(), and row_mysql_drop_temp_tables().
UNIV_INTERN trx_t* trx_allocate_for_mysql | ( | void | ) |
Creates a transaction object for MySQL.
Definition at line 199 of file trx0trx.cc.
References os_proc_get_number(), os_thread_get_curr_id(), trx_create(), trx_dummy_sess, trx_n_mysql_transactions, trx_sys, and UT_LIST_ADD_FIRST.
Referenced by dict_create_or_check_foreign_constraint_tables(), and innobase_trx_allocate().
UNIV_INTERN read_view_t* trx_assign_read_view | ( | trx_t * | trx | ) |
Assigns a read view for a consistent read query. All the consistent reads within the same transaction will get the same read view, which is created when this function is first called for a new started transaction.
Assigns a read view for a consistent read query. All the consistent reads within the same transaction will get the same read view, which is created when this function is first called for a new started transaction.
trx | in: active transaction |
Definition at line 1028 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::id, trx_struct::read_view, read_view_open_now(), and ut_ad.
Referenced by InnobaseEngine::doStartTransaction(), row_search_for_mysql(), and row_sel_step().
UNIV_INTERN void trx_cleanup_at_db_startup | ( | trx_t * | trx | ) |
Cleans up a transaction at database startup. The cleanup is needed if the transaction already got to the middle of a commit when the database crashed, and we cannot roll it back. in: transaction
Cleans up a transaction at database startup. The cleanup is needed if the transaction already got to the middle of a commit when the database crashed, and we cannot roll it back.
trx | in: transaction |
Definition at line 1004 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::insert_undo, trx_savept_struct::least_undo_no, trx_struct::rseg, trx_sys, trx_undo_insert_cleanup(), trx_struct::undo_no, and UT_LIST_REMOVE.
Referenced by trx_rollback_or_clean_recovered().
UNIV_INTERN ulint trx_commit_complete_for_mysql | ( | trx_t * | trx | ) |
If required, flushes the log to disk if we called trx_commit_for_mysql() with trx->flush_log_later == TRUE.
If required, flushes the log to disk if we called trx_commit_for_mysql() with trx->flush_log_later == TRUE.
trx | in: trx handle |
Definition at line 1627 of file trx0trx.cc.
References trx_struct::commit_lsn, log_write_up_to(), trx_struct::op_info, SRV_UNIX_NOSYNC, ut_a, and ut_error.
Referenced by InnobaseEngine::doCommit().
UNIV_INTERN ulint trx_commit_for_mysql | ( | trx_t * | trx | ) |
Does the transaction commit for MySQL.
Does the transaction commit for MySQL.
trx | in: trx handle |
Definition at line 1596 of file trx0trx.cc.
References trx_struct::op_info, trx_commit_off_kernel(), trx_start_if_not_started(), and ut_a.
Referenced by create_table_def(), dict_create_or_check_foreign_constraint_tables(), innobase_commit_low(), row_create_index_for_mysql(), row_create_table_for_mysql(), row_discard_tablespace_for_mysql(), row_drop_database_for_mysql(), row_drop_table_for_mysql(), row_import_tablespace_for_mysql(), row_merge_drop_temp_indexes(), row_mysql_drop_temp_tables(), row_rename_table_for_mysql(), row_table_add_foreign_constraints(), and row_truncate_table_for_mysql().
UNIV_INTERN void trx_commit_off_kernel | ( | trx_t * | trx | ) |
Commits a transaction. in: transaction
Commits a transaction.
trx | in: transaction |
Definition at line 846 of file trx0trx.cc.
References trx_struct::commit_lsn, trx_struct::conc_state, trx_struct::insert_undo, trx_struct::is_recovered, trx_savept_struct::least_undo_no, lock_release_off_kernel(), log_write_up_to(), mem_heap_empty(), trx_struct::read_view, read_view_close(), trx_struct::rseg, SRV_UNIX_NOSYNC, trx_struct::trx_locks, trx_sys, trx_undo_insert_cleanup(), trx_struct::undo_no, trx_struct::update_undo, ut_ad, ut_error, UT_LIST_GET_LEN, UT_LIST_REMOVE, and trx_struct::wait_thrs.
Referenced by trx_commit_for_mysql(), and trx_finish_rollback_off_kernel().
Performs an execution step for a commit type node in a query graph.
Performs an execution step for a commit type node in a query graph.
thr | in: query thread |
Definition at line 1548 of file trx0trx.cc.
References COMMIT_NODE_SEND, COMMIT_NODE_WAIT, que_thr_struct::prev_node, que_node_get_parent(), que_node_get_type(), que_thr_struct::run_node, que_thr_struct::state, commit_node_struct::state, thr_get_trx(), trx_sig_send(), and ut_ad.
Creates and initializes a transaction object.
sess | in: session |
Definition at line 90 of file trx0trx.cc.
References BTR_SEA_TIMEOUT, trx_struct::conc_state, trx_struct::detailed_error, trx_struct::dict_operation, trx_struct::dict_operation_lock_mode, trx_struct::duplicates, trx_struct::error_key_num, trx_struct::error_state, xid_t::formatID, trx_struct::graph, ib_vector_create(), trx_struct::id, trx_struct::insert_undo, trx_struct::is_purge, trx_struct::is_recovered, trx_savept_struct::least_undo_no, trx_struct::lock_heap, trx_struct::log_commit_id, mem_heap_create, mem_heap_create_in_buffer, trx_struct::mysql_thd, trx_struct::n_active_thrs, trx_struct::n_autoinc_rows, trx_struct::no, trx_struct::op_info, trx_struct::que_state, trx_struct::read_view, trx_struct::reply_signals, trx_struct::rseg, trx_struct::sess, trx_struct::signals, trx_struct::start_time, trx_struct::support_xa, trx_struct::table_id, TRX_DICT_OP_NONE, trx_struct::trx_locks, trx_struct::trx_savepoints, trx_struct::undo_mutex, trx_struct::undo_no, trx_struct::undo_no_arr, trx_struct::update_undo, ut_ad, UT_LIST_INIT, trx_struct::wait_lock, trx_struct::wait_thrs, and trx_struct::xid.
Referenced by sess_open(), trx_allocate_for_background(), trx_allocate_for_mysql(), and trx_lists_init_at_db_start().
UNIV_INTERN void trx_end_lock_wait | ( | trx_t * | trx | ) |
The transaction must be in the TRX_QUE_LOCK_WAIT state. Puts it to the TRX_QUE_RUNNING state and releases query threads which were waiting for a lock in the wait_thrs list. in: transaction
The transaction must be in the TRX_QUE_LOCK_WAIT state. Puts it to the TRX_QUE_RUNNING state and releases query threads which were waiting for a lock in the wait_thrs list.
trx | in: transaction |
Definition at line 1101 of file trx0trx.cc.
References trx_struct::que_state, que_thr_end_wait_no_next_thr(), ut_ad, UT_LIST_GET_FIRST, UT_LIST_REMOVE, and trx_struct::wait_thrs.
Referenced by lock_cancel_waiting_and_release().
UNIV_INTERN void trx_end_signal_handling | ( | trx_t * | trx | ) |
Ends signal handling. If the session is in the error state, and trx->graph_before_signal_handling != NULL, returns control to the error handling routine of the graph (currently only returns the control to the graph root which then sends an error message to the client). in: trx
Ends signal handling. If the session is in the error state, and trx->graph_before_signal_handling != NULL, then returns control to the error handling routine of the graph (currently just returns the control to the graph root which then will send an error message to the client).
trx | in: trx |
Definition at line 1346 of file trx0trx.cc.
References trx_struct::graph, que_fork_error_handle(), trx_struct::sess, sess_struct::state, and ut_ad.
Referenced by trx_sig_start_handle().
UNIV_INTERN void trx_free | ( | trx_t * | trx | ) |
Frees a transaction object. in, own: trx object
Frees a transaction object.
trx | in, own: trx object |
Definition at line 259 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::dict_operation_lock_mode, ib_vector_free(), ib_vector_is_empty(), trx_struct::insert_undo, trx_struct::lock_heap, mem_free, mem_heap_free, trx_struct::read_view, trx_struct::reply_signals, trx_struct::signals, srv_conc_force_exit_innodb(), trx_struct::trx_locks, trx_print(), trx_undo_arr_free(), trx_struct::undo_mutex, trx_struct::undo_no_arr, trx_struct::update_undo, ut_a, ut_ad, UT_LIST_GET_LEN, ut_print_buf(), ut_print_timestamp(), trx_struct::wait_lock, and trx_struct::wait_thrs.
Referenced by trx_free_for_background(), and trx_free_for_mysql().
UNIV_INTERN void trx_free_for_background | ( | trx_t * | trx | ) |
Frees a transaction object of a background operation of the master thread. in, own: trx object
Frees a transaction object of a background operation of the master thread.
trx | in, own: trx object |
Definition at line 363 of file trx0trx.cc.
References trx_free().
Referenced by row_merge_drop_temp_indexes(), row_mysql_drop_temp_tables(), and sess_close().
UNIV_INTERN void trx_free_for_mysql | ( | trx_t * | trx | ) |
Frees a transaction object for MySQL. in, own: trx object
Frees a transaction object for MySQL.
trx | in, own: trx object |
Definition at line 342 of file trx0trx.cc.
References trx_free(), trx_n_mysql_transactions, trx_sys, ut_a, and UT_LIST_REMOVE.
Referenced by InnobaseEngine::close_connection(), dict_create_or_check_foreign_constraint_tables(), InnobaseEngine::doCreateTable(), InnobaseEngine::doDropSchema(), InnobaseEngine::doDropTable(), and InnobaseEngine::doRenameTable().
UNIV_INLINE enum trx_dict_op trx_get_dict_operation | ( | const trx_t * | trx | ) |
Determine if a transaction is a dictionary operation.
trx | in: transaction |
Referenced by trx_rollback_or_clean_recovered(), and trx_undo_assign_undo().
UNIV_INLINE const dict_index_t* trx_get_error_info | ( | const trx_t * | trx | ) |
Retrieves the error_info field from a trx.
Referenced by ha_innobase::info().
UNIV_INLINE const char* trx_get_que_state_str | ( | const trx_t * | trx | ) |
Retrieves transaction's que state in a human readable string. The string should not be free()'d or modified.
This function is used to find one X/Open XA distributed transaction which is in the prepared state
This function is used to find one X/Open XA distributed transaction which is in the prepared state
xid | in: X/Open XA transaction identifier |
Definition at line 2056 of file trx0trx.cc.
References xid_t::bqual_length, trx_struct::conc_state, xid_t::data, xid_t::formatID, xid_t::gtrid_length, trx_sys, UT_LIST_GET_FIRST, UT_LIST_GET_NEXT, and trx_struct::xid.
Referenced by InnobaseEngine::doXaCommitXid(), and InnobaseEngine::doXaRollbackXid().
UNIV_INTERN ibool trx_is_interrupted | ( | trx_t * | trx | ) |
Determines if the currently running transaction has been interrupted.
Determines if the currently running transaction has been interrupted.
trx | in: transaction |
Definition at line 1882 of file ha_innodb.cc.
References trx_struct::mysql_thd.
Referenced by btr_validate_index(), row_check_index_for_mysql(), srv_lock_timeout_thread(), and srv_suspend_mysql_thread().
UNIV_INTERN ibool trx_is_strict | ( | trx_t * | trx | ) |
Determines if the currently running transaction is in strict mode.
Determines if the currently running transaction is in strict mode.
trx | in: transaction |
Definition at line 1894 of file ha_innodb.cc.
References trx_struct::mysql_thd.
Referenced by dict_create_index_step().
UNIV_INTERN void trx_lists_init_at_db_start | ( | void | ) |
Creates trx objects for transactions and initializes the trx list of trx_sys at database start. Rollback segment and undo log lists must already exist when this function is called, because the lists of transactions to be rolled back or cleaned up are built based on the undo log lists.
Definition at line 422 of file trx0trx.cc.
References trx_struct::conc_state, trx_undo_struct::dict_operation, trx_undo_struct::empty, trx_struct::id, trx_struct::insert_undo, trx_struct::is_recovered, trx_struct::no, trx_struct::rseg, trx_undo_struct::state, trx_undo_struct::table_id, trx_struct::table_id, trx_undo_struct::top_undo_no, trx_create(), TRX_DICT_OP_TABLE, trx_dummy_sess, trx_get_on_id(), trx_undo_struct::trx_id, TRX_ID_FMT, trx_set_dict_operation(), trx_sys, trx_struct::undo_no, trx_struct::update_undo, ut_ad, UT_LIST_GET_FIRST, UT_LIST_GET_NEXT, UT_LIST_INIT, trx_undo_struct::xid, and trx_struct::xid.
Referenced by trx_sys_init_at_db_start().
UNIV_INLINE ibool trx_log_commit_id | ( | const trx_t * | trx | ) |
Checks if the commit id should be logged to the sys header file
UNIV_INTERN void trx_mark_sql_stat_end | ( | trx_t * | trx | ) |
Marks the latest SQL statement ended. in: trx handle
Marks the latest SQL statement ended.
trx | in: trx handle |
Definition at line 1672 of file trx0trx.cc.
References trx_struct::conc_state, trx_savept_struct::least_undo_no, trx_struct::undo_no, and ut_a.
Referenced by InnobaseEngine::doCommit(), InnobaseEngine::doXaPrepare(), trx_rollback_last_sql_stat_for_mysql(), and trx_rollback_to_savepoint_for_mysql().
UNIV_INTERN ulint trx_prepare_for_mysql | ( | trx_t * | trx | ) |
Does the transaction prepare for MySQL.
Does the transaction prepare for MySQL.
trx | in: trx handle |
Definition at line 1955 of file trx0trx.cc.
References trx_struct::op_info, trx_start_if_not_started(), and ut_a.
Referenced by InnobaseEngine::doXaPrepare().
UNIV_INTERN void trx_print | ( | FILE * | f, |
trx_t * | trx, | ||
ulint | max_query_len | ||
) |
Prints info about a transaction to the given file. The caller must own the kernel mutex. in: max query length to print, or 0 to use the default max length
Prints info about a transaction to the given file. The caller must own the kernel mutex.
f | in: output stream |
trx | in: transaction |
max_query_len | in: max query length to print, or 0 to use the default max length |
Definition at line 1690 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::id, innobase_mysql_print_thd(), trx_struct::is_purge, trx_struct::is_recovered, trx_struct::lock_heap, lock_number_of_rows_locked(), mem_heap_get_size(), trx_struct::mysql_thd, trx_struct::op_info, os_thread_pf(), trx_struct::que_state, trx_struct::start_time, TRX_ID_FMT, trx_struct::trx_locks, trx_struct::undo_no, and UT_LIST_GET_LEN.
Referenced by btr_pcur_restore_position_func(), lock_print_info_all_transactions(), row_ins_check_foreign_constraint(), row_search_for_mysql(), srv_conc_enter_innodb(), and trx_free().
UNIV_INTERN int trx_recover_for_mysql | ( | XID * | xid_list, |
ulint | len | ||
) |
This function is used to find number of prepared transactions and their transaction objects for a recovery.
This function is used to find number of prepared transactions and their transaction objects for a recovery.
xid_list | in/out: prepared transactions |
len | in: number of slots in xid_list |
Definition at line 1986 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::id, TRX_ID_FMT, trx_sys, trx_struct::undo_no, ut_ad, UT_LIST_GET_FIRST, UT_LIST_GET_NEXT, ut_print_timestamp(), and trx_struct::xid.
Referenced by InnobaseEngine::doXaRecover().
UNIV_INTERN void trx_search_latch_release_if_reserved | ( | trx_t * | trx | ) |
Releases the search latch if trx has reserved it. in: transaction
Releases the search latch if trx has reserved it.
trx | in: transaction |
Definition at line 244 of file trx0trx.cc.
References btr_search_latch.
Referenced by InnobaseEngine::doCommit(), InnobaseEngine::doCreateTable(), InnobaseEngine::doDropSchema(), InnobaseEngine::doDropTable(), InnobaseEngine::doRenameTable(), ha_innobase::estimate_rows_upper_bound(), ha_innobase::get_foreign_key_create_info(), ha_innobase::get_foreign_key_list(), ha_innobase::info(), innobase_release_stat_resources(), ha_innobase::records_in_range(), srv_conc_enter_innodb(), and ha_innobase::update_table_comment().
UNIV_INTERN void trx_set_detailed_error | ( | trx_t * | trx, |
const char * | msg | ||
) |
Set detailed error message for the transaction. in: detailed error message
Set detailed error message for the transaction.
trx | in: transaction struct |
msg | in: detailed error message |
Definition at line 63 of file trx0trx.cc.
References trx_struct::detailed_error, and ut_strlcpy().
UNIV_INTERN void trx_set_detailed_error_from_file | ( | trx_t * | trx, |
FILE * | file | ||
) |
Set detailed error message for the transaction from a file. Note that the file is rewinded before reading from it. in: file to read message from
Set detailed error message for the transaction from a file. Note that the file is rewinded before reading from it.
trx | in: transaction struct |
file | in: file to read message from |
Definition at line 76 of file trx0trx.cc.
References trx_struct::detailed_error, and os_file_read_string().
UNIV_INLINE void trx_set_dict_operation | ( | trx_t * | trx, |
enum trx_dict_op | op | ||
) |
Flag a transaction a dictionary operation. in: operation, not TRX_DICT_OP_NONE
trx | in/out: transaction |
Referenced by row_create_index_for_mysql(), row_create_table_for_mysql(), row_drop_table_for_mysql(), row_table_add_foreign_constraints(), and trx_lists_init_at_db_start().
Removes the signal object from a trx signal queue. in, own: signal
Removes a signal object from the trx signal queue.
trx | in: trx handle |
sig | in, own: signal |
Definition at line 1507 of file trx0trx.cc.
References mem_free, trx_sig_struct::receiver, trx_struct::sig, trx_struct::signals, trx_sig_struct::type, ut_ad, and UT_LIST_REMOVE.
Referenced by trx_finish_rollback_off_kernel(), and trx_sig_start_handle().
Send the reply message when a signal in the queue of the trx has been handled. in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread
Send the reply message when a signal in the queue of the trx has been handled.
sig | in: signal |
next_thr | in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread |
Definition at line 1473 of file trx0trx.cc.
References que_thr_end_wait(), trx_sig_struct::receiver, trx_struct::reply_signals, trx_struct::sess, sess_struct::state, thr_get_trx(), ut_ad, and UT_LIST_REMOVE.
Referenced by trx_finish_rollback_off_kernel(), and trx_sig_start_handle().
UNIV_INTERN void trx_sig_send | ( | trx_t * | trx, |
ulint | type, | ||
ulint | sender, | ||
que_thr_t * | receiver_thr, | ||
trx_savept_t * | savept, | ||
que_thr_t ** | next_thr | ||
) |
Sends a signal to a trx object. in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread; if the parameter is NULL, it is ignored
Sends a signal to a trx object.
trx | in: trx handle |
type | in: signal type |
sender | in: TRX_SIG_SELF or TRX_SIG_OTHER_SESS |
receiver_thr | in: query thread which wants the reply, or NULL; if type is TRX_SIG_END_WAIT, this must be NULL |
savept | in: possible rollback savepoint, or NULL |
next_thr | in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread; if the parameter is NULL, it is ignored |
Definition at line 1259 of file trx0trx.cc.
References trx_sig_struct::receiver, trx_struct::reply_signals, trx_sig_struct::savept, trx_sig_struct::sender, trx_struct::sess, trx_struct::sig, trx_struct::signals, sess_struct::state, thr_get_trx(), trx_sig_start_handle(), trx_sig_struct::type, ut_ad, ut_error, UT_LIST_ADD_LAST, UT_LIST_GET_FIRST, and UT_LIST_GET_LEN.
Referenced by trx_commit_step(), and trx_rollback_step().
Starts handling of a trx signal. in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread
Starts handling of a trx signal.
trx | in: trx handle |
next_thr | in/out: next query thread to run; if the value which is passed in is a pointer to a NULL pointer, then the calling function can start running a new query thread; if the parameter is NULL, it is ignored |
Definition at line 1367 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::graph, trx_struct::n_active_thrs, trx_struct::que_state, trx_struct::sess, trx_struct::signals, sess_struct::state, trx_end_signal_handling(), trx_rollback(), trx_sig_remove(), trx_sig_reply(), trx_start_low(), trx_sig_struct::type, ut_ad, ut_error, UT_LIST_GET_FIRST, and UT_LIST_GET_LEN.
Referenced by trx_sig_send().
UNIV_INTERN ibool trx_start | ( | trx_t * | trx, |
ulint | rseg_id | ||
) |
Starts a new transaction.
Starts a new transaction.
trx | in: transaction |
rseg_id | in: rollback segment id; if ULINT_UNDEFINED is passed, the system chooses the rollback segment automatically in a round-robin fashion |
Definition at line 676 of file trx0trx.cc.
References trx_struct::mysql_thd, trx_struct::support_xa, thd_supports_xa(), and trx_start_low().
UNIV_INLINE void trx_start_if_not_started | ( | trx_t * | trx | ) |
Starts the transaction if it is not yet started. in: transaction
Referenced by InnobaseEngine::doStartTransaction(), row_create_index_for_mysql(), row_create_table_for_mysql(), row_discard_tablespace_for_mysql(), row_drop_database_for_mysql(), row_drop_table_for_mysql(), row_import_tablespace_for_mysql(), row_ins_step(), row_insert_for_mysql(), row_lock_table_autoinc_for_mysql(), row_lock_table_for_mysql(), row_merge_build_indexes(), row_merge_drop_index(), row_rename_table_for_mysql(), row_search_for_mysql(), row_sel_step(), row_table_add_foreign_constraints(), row_truncate_table_for_mysql(), row_upd_step(), row_update_for_mysql(), trx_commit_for_mysql(), trx_general_rollback_for_mysql(), trx_prepare_for_mysql(), and trx_savepoint_for_mysql().
UNIV_INLINE void trx_start_if_not_started_low | ( | trx_t * | trx | ) |
Starts the transaction if it is not yet started. Assumes we have reserved the kernel mutex! in: transaction
Referenced by row_search_check_if_query_cache_permitted().
UNIV_INTERN ibool trx_start_low | ( | trx_t * | trx, |
ulint | rseg_id | ||
) |
Starts a new transaction.
Starts a new transaction.
trx | in: transaction |
rseg_id | in: rollback segment id; if ULINT_UNDEFINED is passed, the system chooses the rollback segment automatically in a round-robin fashion |
Definition at line 628 of file trx0trx.cc.
References trx_struct::conc_state, trx_struct::id, trx_struct::is_purge, trx_struct::no, trx_struct::rseg, trx_struct::start_time, trx_sys, trx_sys_get_new_trx_id(), ut_a, ut_ad, and UT_LIST_ADD_FIRST.
Referenced by trx_purge_sys_create(), trx_sig_start_handle(), and trx_start().
Compares the "weight" (or size) of two transactions. Transactions that have edited non-transactional tables are considered heavier than ones that have not.
Compares the "weight" (or size) of two transactions. Transactions that have edited non-transactional tables are considered heavier than ones that have not.
a | in: the first transaction to be compared |
b | in: the second transaction to be compared |
Definition at line 1804 of file trx0trx.cc.
References trx_struct::mysql_thd, thd_has_edited_nontrans_tables(), trx_struct::trx_locks, TRX_WEIGHT, trx_struct::undo_no, and UT_LIST_GET_LEN.
sess_t* trx_dummy_sess |
Dummy session used currently in MySQL interface
Definition at line 48 of file trx0trx.cc.
Referenced by trx_allocate_for_background(), trx_allocate_for_mysql(), trx_lists_init_at_db_start(), trx_sys_close(), and trx_sys_init_at_db_start().
ulint trx_n_mysql_transactions |
Number of transactions currently allocated for MySQL: protected by the kernel mutex
Definition at line 52 of file trx0trx.cc.
Referenced by logs_empty_and_mark_files_at_shutdown(), trx_allocate_for_mysql(), and trx_free_for_mysql().