Commit 3a3d4469 authored by marko's avatar marko

branches/zip: row_ins_foreign_check_on_constraint(),

row_ins_check_foreign_constraint(): Pass the correct block to
the lock_ functions.
parent 8d0fdc13
...@@ -788,8 +788,9 @@ row_ins_foreign_check_on_constraint( ...@@ -788,8 +788,9 @@ row_ins_foreign_check_on_constraint(
dict_index_t* clust_index; dict_index_t* clust_index;
dtuple_t* ref; dtuple_t* ref;
mem_heap_t* upd_vec_heap = NULL; mem_heap_t* upd_vec_heap = NULL;
rec_t* rec; const rec_t* rec;
rec_t* clust_rec; const rec_t* clust_rec;
const buf_block_t* clust_block;
upd_t* update; upd_t* update;
ulint n_to_update; ulint n_to_update;
ulint err; ulint err;
...@@ -919,6 +920,7 @@ row_ins_foreign_check_on_constraint( ...@@ -919,6 +920,7 @@ row_ins_foreign_check_on_constraint(
clust_index = index; clust_index = index;
clust_rec = rec; clust_rec = rec;
clust_block = btr_pcur_get_block(pcur);
} else { } else {
/* We have to look for the record in the clustered index /* We have to look for the record in the clustered index
in the child table */ in the child table */
...@@ -934,6 +936,7 @@ row_ins_foreign_check_on_constraint( ...@@ -934,6 +936,7 @@ row_ins_foreign_check_on_constraint(
cascade->pcur, 0, mtr); cascade->pcur, 0, mtr);
clust_rec = btr_pcur_get_rec(cascade->pcur); clust_rec = btr_pcur_get_rec(cascade->pcur);
clust_block = btr_pcur_get_block(cascade->pcur);
if (!page_rec_is_user_rec(clust_rec) if (!page_rec_is_user_rec(clust_rec)
|| btr_pcur_get_low_match(cascade->pcur) || btr_pcur_get_low_match(cascade->pcur)
...@@ -969,9 +972,8 @@ row_ins_foreign_check_on_constraint( ...@@ -969,9 +972,8 @@ row_ins_foreign_check_on_constraint(
gap if the search criterion was not unique */ gap if the search criterion was not unique */
err = lock_clust_rec_read_check_and_lock_alt( err = lock_clust_rec_read_check_and_lock_alt(
0, btr_pcur_get_block(pcur), 0, clust_block, clust_rec, clust_index,
clust_rec, clust_index, LOCK_X, LOCK_REC_NOT_GAP, LOCK_X, LOCK_REC_NOT_GAP, thr);
thr);
} }
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
...@@ -1212,8 +1214,6 @@ row_ins_check_foreign_constraint( ...@@ -1212,8 +1214,6 @@ row_ins_check_foreign_constraint(
dict_table_t* check_table; dict_table_t* check_table;
dict_index_t* check_index; dict_index_t* check_index;
ulint n_fields_cmp; ulint n_fields_cmp;
buf_block_t* block;
rec_t* rec;
btr_pcur_t pcur; btr_pcur_t pcur;
ibool moved; ibool moved;
int cmp; int cmp;
...@@ -1342,12 +1342,12 @@ run_again: ...@@ -1342,12 +1342,12 @@ run_again:
btr_pcur_open(check_index, entry, PAGE_CUR_GE, btr_pcur_open(check_index, entry, PAGE_CUR_GE,
BTR_SEARCH_LEAF, &pcur, &mtr); BTR_SEARCH_LEAF, &pcur, &mtr);
block = btr_pcur_get_block(&pcur);
/* Scan index records and check if there is a matching record */ /* Scan index records and check if there is a matching record */
for (;;) { for (;;) {
rec = btr_pcur_get_rec(&pcur); const rec_t* rec = btr_pcur_get_rec(&pcur);
const buf_block_t* block = btr_pcur_get_block(&pcur);
if (page_rec_is_infimum(rec)) { if (page_rec_is_infimum(rec)) {
......
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