Commit 3f806c3b authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

InnoDB: Make btr_search_drop_page_hash_index() work with the compact

record format without requiring the doubly linked list added by
Heikki in ChangeSet@1.1627.16.2
parent 83ac1992
......@@ -937,6 +937,8 @@ btr_search_drop_page_hash_index(
ulint n_recs;
ulint* folds;
ulint i;
mem_heap_t* heap;
ulint* offsets;
#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
......@@ -984,10 +986,10 @@ btr_search_drop_page_hash_index(
rec = page_rec_get_next(rec);
if (rec != sup) {
ut_a(n_fields <= rec_get_n_fields(rec));
ut_a(n_fields <= rec_get_n_fields(rec, block->index));
if (n_bytes > 0) {
ut_a(n_fields < rec_get_n_fields(rec));
ut_a(n_fields < rec_get_n_fields(rec, block->index));
}
}
......@@ -995,11 +997,15 @@ btr_search_drop_page_hash_index(
prev_fold = 0;
heap = mem_heap_create(100);
offsets = NULL;
while (rec != sup) {
/* FIXME: in a mixed tree, not all records may have enough
ordering fields: */
fold = rec_fold(rec, n_fields, n_bytes, tree_id);
offsets = rec_reget_offsets(rec, block->index,
offsets, n_fields + (n_bytes > 0), heap);
fold = rec_fold(rec, offsets, n_fields, n_bytes, tree_id);
if (fold == prev_fold && prev_fold != 0) {
......@@ -1016,6 +1022,8 @@ next_rec:
prev_fold = fold;
}
mem_heap_free(heap);
rw_lock_x_lock(&btr_search_latch);
for (i = 0; i < n_cached; i++) {
......
......@@ -2812,7 +2812,6 @@ ibuf_insert_to_index_page(
rec_t* rec;
page_t* bitmap_page;
ulint old_bits;
mem_heap_t* heap;
ut_ad(ibuf_inside());
ut_ad(dtuple_check_typed(entry));
......@@ -2824,12 +2823,9 @@ ibuf_insert_to_index_page(
goto dump;
}
heap = mem_heap_create(100);
rec = page_rec_get_next(page_get_infimum_rec(page));
if (rec_offs_n_fields(rec_get_offsets(rec, index, ULINT_UNDEFINED,
heap)) != dtuple_get_n_fields(entry)) {
mem_heap_free(heap);
if (rec_get_n_fields(rec, index) != dtuple_get_n_fields(entry)) {
fputs(
"InnoDB: Trying to insert a record from the insert buffer to an index page\n"
"InnoDB: but the number of fields does not match!\n", stderr);
......@@ -2847,7 +2843,6 @@ ibuf_insert_to_index_page(
return;
}
mem_heap_free(heap);
low_match = page_cur_search(page, index, entry,
PAGE_CUR_LE, &page_cur);
......
......@@ -1928,9 +1928,8 @@ row_ins_index_entry_low(
buf_frame_align(btr_cur_get_rec(&cursor))));
if (!page_rec_is_supremum(first_rec)) {
offsets = rec_get_offsets(first_rec, index,
ULINT_UNDEFINED, heap);
ut_a(rec_offs_n_fields(offsets) == dtuple_get_n_fields(entry));
ut_a(rec_get_n_fields(first_rec, index)
== dtuple_get_n_fields(entry));
}
n_unique = dict_index_get_n_unique(index);
......
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