mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
A more complete fix for bug #57345 btr_pcur_store_position abort for load
with concurrent lock/unlock tables Approved by Marko
This commit is contained in:
parent
7ee98d4fea
commit
820e1bc6f4
3 changed files with 31 additions and 2 deletions
|
|
@ -3259,6 +3259,7 @@ row_search_for_mysql(
|
|||
mem_heap_t* heap = NULL;
|
||||
ulint offsets_[REC_OFFS_NORMAL_SIZE];
|
||||
ulint* offsets = offsets_;
|
||||
ibool table_lock_waited = FALSE;
|
||||
|
||||
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
|
||||
|
||||
|
|
@ -3622,13 +3623,15 @@ shortcut_fails_too_big_rec:
|
|||
trx_assign_read_view(trx);
|
||||
prebuilt->sql_stat_start = FALSE;
|
||||
} else {
|
||||
wait_table_again:
|
||||
err = lock_table(0, index->table,
|
||||
prebuilt->select_lock_type == LOCK_S
|
||||
? LOCK_IS : LOCK_IX, thr);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
goto lock_wait_or_error;
|
||||
table_lock_waited = TRUE;
|
||||
goto lock_table_wait;
|
||||
}
|
||||
prebuilt->sql_stat_start = FALSE;
|
||||
}
|
||||
|
|
@ -4408,6 +4411,7 @@ lock_wait_or_error:
|
|||
|
||||
btr_pcur_store_position(pcur, &mtr);
|
||||
|
||||
lock_table_wait:
|
||||
mtr_commit(&mtr);
|
||||
mtr_has_extra_clust_latch = FALSE;
|
||||
|
||||
|
|
@ -4425,6 +4429,14 @@ lock_wait_or_error:
|
|||
thr->lock_state = QUE_THR_LOCK_NOLOCK;
|
||||
mtr_start(&mtr);
|
||||
|
||||
/* Table lock waited, go try to obtain table lock
|
||||
again */
|
||||
if (table_lock_waited) {
|
||||
table_lock_waited = FALSE;
|
||||
|
||||
goto wait_table_again;
|
||||
}
|
||||
|
||||
sel_restore_position_for_mysql(&same_user_rec,
|
||||
BTR_SEARCH_LEAF, pcur,
|
||||
moves_up, &mtr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue