mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 02:30:06 +01:00
parent
4fe03b705a
commit
50eab8cf01
2 changed files with 17 additions and 9 deletions
|
@ -29,16 +29,16 @@ trx_reset_new_rec_lock_info(
|
|||
/*========================*/
|
||||
trx_t* trx); /* in: transaction struct */
|
||||
/*****************************************************************
|
||||
Registers that we have set a new record lock on an index. This can only be
|
||||
called twice after calling trx_reset_new_rec_lock_info(), since we only have
|
||||
space to store 2 indexes! */
|
||||
Registers that we have set a new record lock on an index. We only have
|
||||
space to store 2 indexes! If this is called more than twice after
|
||||
trx_reset_new_rec_lock_info(), then this function does nothing. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
trx_register_new_rec_lock(
|
||||
/*======================*/
|
||||
trx_t* trx, /* in: transaction struct */
|
||||
dict_index_t* index); /* in: trx sets a new record lock on this
|
||||
index*/
|
||||
index */
|
||||
/*****************************************************************
|
||||
Checks if trx has set a new record lock on an index. */
|
||||
UNIV_INLINE
|
||||
|
|
|
@ -52,16 +52,16 @@ trx_reset_new_rec_lock_info(
|
|||
}
|
||||
|
||||
/*****************************************************************
|
||||
Registers that we have set a new record lock on an index. This can only be
|
||||
called twice after calling trx_reset_new_rec_lock_info(), since we only have
|
||||
space to store 2 indexes! */
|
||||
Registers that we have set a new record lock on an index. We only have
|
||||
space to store 2 indexes! If this is called more than twice after
|
||||
trx_reset_new_rec_lock_info(), then this function does nothing. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
trx_register_new_rec_lock(
|
||||
/*======================*/
|
||||
trx_t* trx, /* in: transaction struct */
|
||||
dict_index_t* index) /* in: trx sets a new record lock on this
|
||||
index*/
|
||||
index */
|
||||
{
|
||||
if (trx->new_rec_locks[0] == NULL) {
|
||||
trx->new_rec_locks[0] = index;
|
||||
|
@ -69,7 +69,15 @@ trx_register_new_rec_lock(
|
|||
return;
|
||||
}
|
||||
|
||||
ut_a(trx->new_rec_locks[1] == NULL);
|
||||
if (trx->new_rec_locks[0] == index) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (trx->new_rec_locks[1] != NULL) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
trx->new_rec_locks[1] = index;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue