5124 err = sel_set_rec_lock(pcur,
5125 rec, index, offsets,
5126 prebuilt->select_lock_type,
5127 lock_type, thr, &mtr);
5128
5129 switch (err) {
……
……
5142 case DB_LOCK_WAIT:
5143 /* Lock wait for R-tree should already
5144 be handled in sel_set_rtr_rec_lock() */
5145 ut_ad(!dict_index_is_spatial(index));
5146 /* Never unlock rows that were part of a conflict. */
5147 prebuilt->new_rec_locks = 0;
5148
5149 if (UNIV_LIKELY(prebuilt->row_read_type
5150 != ROW_READ_TRY_SEMI_CONSISTENT)
5151 || unique_search
5152 || index != clust_index) {
5153
5154 goto lock_wait_or_error;
5155 }
5156
5157 /* The following call returns ‘offsets’
5158 associated with ‘old_vers’ */
5159 row_sel_build_committed_vers_for_mysql(
5160 clust_index, prebuilt, rec,
5161 &offsets, &heap, &old_vers, &mtr);
5162
5163 /* Check whether it was a deadlock or not, if not
5164 a deadlock and the transaction had to wait then
5165 release the lock it is waiting on. */
5166
5167 err = lock_trx_handle_wait(trx);