mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
Merge jlindstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/jan/mysql-4.1
This commit is contained in:
commit
c0c93929a8
1 changed files with 6 additions and 19 deletions
|
@ -1105,7 +1105,6 @@ row_ins_check_foreign_constraint(
|
|||
dict_table_t* check_table;
|
||||
dict_index_t* check_index;
|
||||
ulint n_fields_cmp;
|
||||
ibool unique_search;
|
||||
rec_t* rec;
|
||||
btr_pcur_t pcur;
|
||||
ibool moved;
|
||||
|
@ -1223,14 +1222,6 @@ run_again:
|
|||
|
||||
dtuple_set_n_fields_cmp(entry, foreign->n_fields);
|
||||
|
||||
if (dict_index_get_n_unique(check_index) <= foreign->n_fields) {
|
||||
/* We can just set a LOCK_REC_NOT_GAP type lock */
|
||||
|
||||
unique_search = TRUE;
|
||||
} else {
|
||||
unique_search = FALSE;
|
||||
}
|
||||
|
||||
btr_pcur_open(check_index, entry, PAGE_CUR_GE,
|
||||
BTR_SEARCH_LEAF, &pcur, &mtr);
|
||||
|
||||
|
@ -1268,17 +1259,13 @@ run_again:
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
/* Found a matching record */
|
||||
/* Found a matching record. Lock only
|
||||
a record because we can allow inserts
|
||||
into gaps */
|
||||
|
||||
if (unique_search) {
|
||||
err = row_ins_set_shared_rec_lock(
|
||||
LOCK_REC_NOT_GAP,
|
||||
rec, check_index, thr);
|
||||
} else {
|
||||
err = row_ins_set_shared_rec_lock(
|
||||
LOCK_ORDINARY,
|
||||
rec, check_index, thr);
|
||||
}
|
||||
err = row_ins_set_shared_rec_lock(
|
||||
LOCK_REC_NOT_GAP,
|
||||
rec, check_index, thr);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue