Commit 9bb5b253 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-31120 Duplicate entry allowed into a UNIQUE column

row_ins_sec_index_entry_low(): Correct a condition that was
inadvertently inverted
in commit 89ec4b53 (MDEV-29603).

We are not supposed to buffer INSERT operations into unique indexes,
because duplicate key values would not be checked for. It is only
allowed when using unique_checks=0, and in that case the user is
supposed to guarantee that there are no duplicates.
parent 6e484c3b
...@@ -3005,8 +3005,8 @@ row_ins_sec_index_entry_low( ...@@ -3005,8 +3005,8 @@ row_ins_sec_index_entry_low(
search_mode = btr_latch_mode( search_mode = btr_latch_mode(
search_mode search_mode
| (thr_get_trx(thr)->check_unique_secondary | (thr_get_trx(thr)->check_unique_secondary
? BTR_INSERT | BTR_IGNORE_SEC_UNIQUE ? BTR_INSERT
: BTR_INSERT)); : BTR_INSERT | BTR_IGNORE_SEC_UNIQUE));
} }
err = cursor.search_leaf(entry, PAGE_CUR_LE, search_mode, err = cursor.search_leaf(entry, PAGE_CUR_LE, search_mode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment