1
/******************************************************
6
Created 3/26/1996 Heikki Tuuri
7
*******************************************************/
9
/*****************************************************************
10
Starts the transaction if it is not yet started. */
13
trx_start_if_not_started(
14
/*=====================*/
15
trx_t* trx) /* in: transaction */
17
ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY);
19
if (trx->conc_state == TRX_NOT_STARTED) {
21
trx_start(trx, ULINT_UNDEFINED);
25
/*****************************************************************
26
Starts the transaction if it is not yet started. Assumes we have reserved
30
trx_start_if_not_started_low(
31
/*=========================*/
32
trx_t* trx) /* in: transaction */
34
ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY);
36
if (trx->conc_state == TRX_NOT_STARTED) {
38
trx_start_low(trx, ULINT_UNDEFINED);
42
/*****************************************************************
43
Resets the new record lock info in a transaction struct. */
46
trx_reset_new_rec_lock_info(
47
/*========================*/
48
trx_t* trx) /* in: transaction struct */
50
trx->new_rec_locks[0] = NULL;
51
trx->new_rec_locks[1] = NULL;
54
/*****************************************************************
55
Registers that we have set a new record lock on an index. We only have space
56
to store 2 indexes! If this is called to store more than 2 indexes after
57
trx_reset_new_rec_lock_info(), then this function does nothing. */
60
trx_register_new_rec_lock(
61
/*======================*/
62
trx_t* trx, /* in: transaction struct */
63
dict_index_t* index) /* in: trx sets a new record lock on this
66
if (trx->new_rec_locks[0] == NULL) {
67
trx->new_rec_locks[0] = index;
72
if (trx->new_rec_locks[0] == index) {
77
if (trx->new_rec_locks[1] != NULL) {
82
trx->new_rec_locks[1] = index;
85
/*****************************************************************
86
Checks if trx has set a new record lock on an index. */
89
trx_new_rec_locks_contain(
90
/*======================*/
91
/* out: TRUE if trx has set a new record lock
93
trx_t* trx, /* in: transaction struct */
94
dict_index_t* index) /* in: index */
96
return(trx->new_rec_locks[0] == index
97
|| trx->new_rec_locks[1] == index);