Commit a7de2795 authored by unknown's avatar unknown
Browse files

Fixed a bug where next-key locking doesn't allow the insert which does

not produce phantom (bug #9354).

parent 5630f073
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3686,6 +3686,20 @@ row_search_for_mysql(
 			}
		}

		/* If a constant search tuple is found directly from 
		the cluster index we lock only a record. 
		For example: WHERE a >= 100, where a is primary key */

		if(index == clust_index &&
				match_mode == ROW_SEL_OPEN_CURSOR &&
				mode == PAGE_CUR_GE &&
				dtuple_get_n_fields_cmp(search_tuple)
				== dict_index_get_n_unique(index) &&
				!cmp_dtuple_rec(search_tuple, rec, offsets)) {

			lock_type = LOCK_REC_NOT_GAP;
		}

		err = sel_set_rec_lock(rec, index, offsets,
					prebuilt->select_lock_type,
					lock_type, thr);