summaryrefslogtreecommitdiff
path: root/innobase/btr/btr0btr.c
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-11-17 13:48:39 +0200
committerunknown <heikki@donna.mysql.fi>2001-11-17 13:48:39 +0200
commit77c3dd15bf1d5f4cc90a5863341a06b31fba74f9 (patch)
tree787da1602ab19957328ec16ef6c00f2594a8fc67 /innobase/btr/btr0btr.c
parentfb9d56cdede7e8737fc2058878a8aed6897c8d75 (diff)
downloadmariadb-git-77c3dd15bf1d5f4cc90a5863341a06b31fba74f9.tar.gz
btr0cur.c, btr0btr.c, dict0dict.h, dict0dict.c:
Fix a bug in insert buffer B-tree upper levels; probably caused the crash by B.Fitzpatrick buf0flu.c: Fix a bug in previous change A small optimization for LRU flushes to avoid losing hot pages from the buffer pool innobase/buf/buf0flu.c: Fix a bug in previous change innobase/dict/dict0dict.c: Fix a bug in insert buffer B-tree upper levels; probably caused the crash by B.Fitzpatrick innobase/include/dict0dict.h: Fix a bug in insert buffer B-tree upper levels; probably caused the crash by B.Fitzpatrick innobase/btr/btr0btr.c: Fix a bug in insert buffer B-tree upper levels; probably caused the crash by B.Fitzpatrick innobase/btr/btr0cur.c: Fix a bug in insert buffer B-tree upper levels; probably caused the crash by B.Fitzpatrick
Diffstat (limited to 'innobase/btr/btr0btr.c')
-rw-r--r--innobase/btr/btr0btr.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index 33a3ac70c90..a96830c24ff 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -21,7 +21,7 @@ Created 6/2/1994 Heikki Tuuri
#include "lock0lock.h"
#include "ibuf0ibuf.h"
-/**
+/*
Node pointers
-------------
Leaf pages of a B-tree contain the index records stored in the
@@ -550,14 +550,15 @@ btr_page_get_father_for_rec(
ut_ad(mtr_memo_contains(mtr, dict_tree_get_lock(tree),
MTR_MEMO_X_LOCK));
- ut_ad(user_rec != page_get_supremum_rec(page));
- ut_ad(user_rec != page_get_infimum_rec(page));
+ ut_a(user_rec != page_get_supremum_rec(page));
+ ut_a(user_rec != page_get_infimum_rec(page));
ut_ad(dict_tree_get_page(tree) != buf_frame_get_page_no(page));
heap = mem_heap_create(100);
- tuple = dict_tree_build_node_ptr(tree, user_rec, 0, heap);
+ tuple = dict_tree_build_node_ptr(tree, user_rec, 0, heap,
+ btr_page_get_level(page, mtr));
/* In the following, we choose just any index from the tree as the
first parameter for btr_cur_search_to_nth_level. */
@@ -569,7 +570,7 @@ btr_page_get_father_for_rec(
node_ptr = btr_cur_get_rec(&cursor);
- ut_ad(btr_node_ptr_get_child_page_no(node_ptr) ==
+ ut_a(btr_node_ptr_get_child_page_no(node_ptr) ==
buf_frame_get_page_no(page));
mem_heap_free(heap);
@@ -949,8 +950,8 @@ btr_root_raise_and_insert(
/* Build the node pointer (= node key and page address) for the
child */
- node_ptr = dict_tree_build_node_ptr(tree, rec, new_page_no, heap);
-
+ node_ptr = dict_tree_build_node_ptr(tree, rec, new_page_no, heap,
+ level);
/* Reorganize the root to get free space */
btr_page_reorganize(root, mtr);
@@ -1365,7 +1366,7 @@ btr_attach_half_pages(
half */
node_ptr_upper = dict_tree_build_node_ptr(tree, split_rec,
- upper_page_no, heap);
+ upper_page_no, heap, level);
/* Insert it next to the pointer to the lower half. Note that this
may generate recursion leading to a split on the higher level. */
@@ -2230,7 +2231,7 @@ btr_check_node_ptr(
node_ptr_tuple = dict_tree_build_node_ptr(
tree,
page_rec_get_next(page_get_infimum_rec(page)),
- 0, heap);
+ 0, heap, btr_page_get_level(page, mtr));
ut_a(cmp_dtuple_rec(node_ptr_tuple, node_ptr) == 0);
@@ -2485,10 +2486,11 @@ loop:
heap = mem_heap_create(256);
node_ptr_tuple = dict_tree_build_node_ptr(
- tree,
+ tree,
page_rec_get_next(
page_get_infimum_rec(page)),
- 0, heap);
+ 0, heap,
+ btr_page_get_level(page, &mtr));
if (cmp_dtuple_rec(node_ptr_tuple, node_ptr) != 0) {