96
96
return(trx->new_rec_locks[0] == index
97
97
|| trx->new_rec_locks[1] == index);
100
/********************************************************************
101
Retrieves the error_info field from a trx. */
106
/* out: the error info */
107
const trx_t* trx) /* in: trx object */
109
return(trx->error_info);
112
/***********************************************************************
113
Retrieves transacion's id, represented as unsigned long long. */
118
/* out: transaction's id */
119
const trx_t* trx) /* in: transaction */
121
return((ullint)ut_conv_dulint_to_longlong(trx->id));
124
/***********************************************************************
125
Retrieves transaction's que state in a human readable string. The string
126
should not be free()'d or modified. */
129
trx_get_que_state_str(
130
/*==================*/
131
/* out: string in the data segment */
132
const trx_t* trx) /* in: transaction */
134
/* be sure to adjust TRX_QUE_STATE_STR_MAX_LEN if you change this */
135
switch (trx->que_state) {
136
case TRX_QUE_RUNNING:
138
case TRX_QUE_LOCK_WAIT:
140
case TRX_QUE_ROLLING_BACK:
141
return("ROLLING BACK");
142
case TRX_QUE_COMMITTING:
143
return("COMMITTING");
149
/**************************************************************************
150
Determine if a transaction is a dictionary operation. */
153
trx_get_dict_operation(
154
/*===================*/
155
/* out: dictionary operation mode */
156
const trx_t* trx) /* in: transaction */
158
enum trx_dict_op op = (enum trx_dict_op) trx->dict_operation;
162
case TRX_DICT_OP_NONE:
163
case TRX_DICT_OP_TABLE:
164
case TRX_DICT_OP_INDEX:
168
#endif /* UNIV_DEBUG */
169
return((enum trx_dict_op) UNIV_EXPECT(op, TRX_DICT_OP_NONE));
171
/**************************************************************************
172
Flag a transaction a dictionary operation. */
175
trx_set_dict_operation(
176
/*===================*/
177
trx_t* trx, /* in/out: transaction */
178
enum trx_dict_op op) /* in: operation, not
182
enum trx_dict_op old_op = trx_get_dict_operation(trx);
185
case TRX_DICT_OP_NONE:
188
case TRX_DICT_OP_TABLE:
190
case TRX_DICT_OP_NONE:
191
case TRX_DICT_OP_INDEX:
192
case TRX_DICT_OP_TABLE:
197
case TRX_DICT_OP_INDEX:
198
ut_ad(old_op == TRX_DICT_OP_NONE);
202
#endif /* UNIV_DEBUG */
204
trx->dict_operation = op;