summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-12-08 15:20:58 +0200
committerunknown <marko@hundin.mysql.fi>2004-12-08 15:20:58 +0200
commitf9bd116c297f80613ed0e51750e20e5fcb623f75 (patch)
tree5272431593f811f100e49cab43250218383bbd06 /innobase
parent746799fb23aaef1705e9ee66de6a2cb77a8af2c8 (diff)
downloadmariadb-git-f9bd116c297f80613ed0e51750e20e5fcb623f75.tar.gz
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 innobase/btr/btr0sea.c: btr_search_drop_page_hash_index(): support the compact record format innobase/ibuf/ibuf0ibuf.c: ibuf_insert_to_index_page(): Remove unnecessary computation of field offsets. innobase/row/row0ins.c: row_ins_index_entry_low(): Remove unnecessary computation of field offsets.
Diffstat (limited to 'innobase')
-rw-r--r--innobase/btr/btr0sea.c16
-rw-r--r--innobase/ibuf/ibuf0ibuf.c7
-rw-r--r--innobase/row/row0ins.c5
3 files changed, 15 insertions, 13 deletions
diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
index f2f5d09fa0e..c18fa9a923d 100644
--- a/innobase/btr/btr0sea.c
+++ b/innobase/btr/btr0sea.c
@@ -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++) {
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index c7ca03f9901..959c66159c5 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -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);
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index 1c55005dcfa..a87a08fa3fe 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -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);