diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index eb88ac31ba9..f8218e08297 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -3305,12 +3305,12 @@ rec_loop: err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_ORDINARY, thr); + if (err != DB_SUCCESS) { + + goto lock_wait_or_error; + } } - if (err != DB_SUCCESS) { - - goto lock_wait_or_error; - } } /* A page supremum record cannot be in the result set: skip it now that we have placed a possible lock on it */ @@ -3413,12 +3413,12 @@ rec_loop: err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_GAP, thr); + if (err != DB_SUCCESS) { + + goto lock_wait_or_error; + } } - if (err != DB_SUCCESS) { - - goto lock_wait_or_error; - } } btr_pcur_store_position(pcur, &mtr); @@ -3446,12 +3446,12 @@ rec_loop: err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_GAP, thr); + if (err != DB_SUCCESS) { + + goto lock_wait_or_error; + } } - if (err != DB_SUCCESS) { - - goto lock_wait_or_error; - } } btr_pcur_store_position(pcur, &mtr);