summaryrefslogtreecommitdiff
path: root/innobase/page
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-10-30 17:38:44 +0200
committerunknown <monty@donna.mysql.fi>2001-10-30 17:38:44 +0200
commit7b24c57c56b150132f0c4b541ef23a20f8f74ace (patch)
tree097886eb981160413975cb915243d4ae60718154 /innobase/page
parentfed395c75224ee11c1cd53fc24285e8575c6bec8 (diff)
downloadmariadb-git-7b24c57c56b150132f0c4b541ef23a20f8f74ace.tar.gz
Merge
include/my_base.h: Try again merge InnoDB-3.23.44 include/mysqld_error.h: Try again merge InnoDB-3.23.44 sql/handler.cc: Try again merge InnoDB-3.23.44 sql/mysqld.cc: Try again merge InnoDB-3.23.44 sql/ha_innobase.cc: Try again merge InnoDB-3.23.44 sql/ha_innobase.h: Try again merge InnoDB-3.23.44 sql/share/czech/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/danish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/dutch/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/english/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/estonian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/french/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/german/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/greek/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/hungarian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/italian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/japanese/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/korean/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/norwegian-ny/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/norwegian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/polish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/portuguese/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/romanian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/russian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/slovak/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/spanish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/swedish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/ukrainian/errmsg.txt: Try again merge InnoDB-3.23.44 innobase/btr/btr0btr.c: Try again merge InnoDB-3.23.44 innobase/buf/buf0flu.c: Try again merge InnoDB-3.23.44 innobase/buf/buf0lru.c: Try again merge InnoDB-3.23.44 innobase/dict/dict0boot.c: Try again merge InnoDB-3.23.44 innobase/dict/dict0crea.c: Try again merge InnoDB-3.23.44 innobase/dict/dict0dict.c: Try again merge InnoDB-3.23.44 innobase/ibuf/ibuf0ibuf.c: Try again merge InnoDB-3.23.44 innobase/include/dict0boot.h: Try again merge InnoDB-3.23.44 innobase/include/dict0boot.ic: Try again merge InnoDB-3.23.44 innobase/include/dict0dict.h: Try again merge InnoDB-3.23.44 innobase/include/os0file.h: Try again merge InnoDB-3.23.44 innobase/include/os0sync.h: Try again merge InnoDB-3.23.44 innobase/include/page0page.ic: Try again merge InnoDB-3.23.44 innobase/include/read0read.h: Try again merge InnoDB-3.23.44 innobase/include/row0mysql.h: Try again merge InnoDB-3.23.44 innobase/include/srv0srv.h: Try again merge InnoDB-3.23.44 innobase/include/srv0start.h: Try again merge InnoDB-3.23.44 innobase/include/trx0purge.h: Try again merge InnoDB-3.23.44 innobase/include/trx0rec.h: Try again merge InnoDB-3.23.44 innobase/include/trx0trx.h: Try again merge InnoDB-3.23.44 innobase/lock/lock0lock.c: Try again merge InnoDB-3.23.44 innobase/log/log0log.c: Try again merge InnoDB-3.23.44 innobase/log/log0recv.c: Try again merge InnoDB-3.23.44 innobase/os/os0file.c: Try again merge InnoDB-3.23.44 innobase/page/page0page.c: Try again merge InnoDB-3.23.44 innobase/read/read0read.c: Try again merge InnoDB-3.23.44 innobase/rem/rem0cmp.c: Try again merge InnoDB-3.23.44 innobase/rem/rem0rec.c: Try again merge InnoDB-3.23.44 innobase/row/row0ins.c: Try again merge InnoDB-3.23.44 innobase/row/row0mysql.c: Try again merge InnoDB-3.23.44 innobase/row/row0purge.c: Try again merge InnoDB-3.23.44 innobase/row/row0row.c: Try again merge InnoDB-3.23.44 innobase/row/row0sel.c: Try again merge InnoDB-3.23.44 innobase/row/row0umod.c: Try again merge InnoDB-3.23.44 innobase/row/row0upd.c: Try again merge InnoDB-3.23.44 innobase/row/row0vers.c: Try again merge InnoDB-3.23.44 innobase/srv/srv0start.c: Try again merge InnoDB-3.23.44 innobase/sync/sync0arr.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0purge.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0rec.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0roll.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0sys.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0trx.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0undo.c: Try again merge InnoDB-3.23.44 innobase/srv/srv0srv.c: Commit change made by heikki BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase/page')
-rw-r--r--innobase/page/page0page.c53
1 files changed, 49 insertions, 4 deletions
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index 427064bc89c..a75a7279fb5 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -63,6 +63,45 @@ Assuming a page size of 8 kB, a typical index page of a secondary
index contains 300 index entries, and the size of the page directory
is 50 x 4 bytes = 200 bytes. */
+/******************************************************************
+Used to check the consistency of a directory slot. */
+static
+ibool
+page_dir_slot_check(
+/*================*/
+ /* out: TRUE if succeed */
+ page_dir_slot_t* slot) /* in: slot */
+{
+ page_t* page;
+ ulint n_slots;
+ ulint n_owned;
+
+ ut_a(slot);
+
+ page = buf_frame_align(slot);
+
+ n_slots = page_header_get_field(page, PAGE_N_DIR_SLOTS);
+
+ ut_a(slot <= page_dir_get_nth_slot(page, 0));
+ ut_a(slot >= page_dir_get_nth_slot(page, n_slots - 1));
+
+ ut_a(page_rec_check(page + mach_read_from_2(slot)));
+
+ n_owned = rec_get_n_owned(page + mach_read_from_2(slot));
+
+ if (slot == page_dir_get_nth_slot(page, 0)) {
+ ut_a(n_owned == 1);
+ } else if (slot == page_dir_get_nth_slot(page, n_slots - 1)) {
+ ut_a(n_owned >= 1);
+ ut_a(n_owned <= PAGE_DIR_SLOT_MAX_N_OWNED);
+ } else {
+ ut_a(n_owned >= PAGE_DIR_SLOT_MIN_N_OWNED);
+ ut_a(n_owned <= PAGE_DIR_SLOT_MAX_N_OWNED);
+ }
+
+ return(TRUE);
+}
+
/*****************************************************************
Sets the max trx id field value. */
@@ -1228,7 +1267,6 @@ page_validate(
mem_heap_t* heap;
page_cur_t cur;
byte* buf;
- ulint i;
ulint count;
ulint own_count;
ulint slot_no;
@@ -1238,6 +1276,8 @@ page_validate(
ulint offs;
ulint n_slots;
ibool ret = FALSE;
+ ulint i;
+ char err_buf[1000];
heap = mem_heap_create(UNIV_PAGE_SIZE);
@@ -1285,9 +1325,14 @@ page_validate(
if ((count >= 2) && (!page_cur_is_after_last(&cur))) {
if (!(1 == cmp_rec_rec(rec, old_rec, index))) {
fprintf(stderr,
- "Records in wrong order in index %s\n",
- index->name);
-
+ "Records in wrong order in index %s\n",
+ index->name);
+ rec_sprintf(err_buf, 900, old_rec);
+ fprintf(stderr, "InnoDB: record %s\n", err_buf);
+
+ rec_sprintf(err_buf, 900, rec);
+ fprintf(stderr, "InnoDB: record %s\n", err_buf);
+
goto func_exit;
}
}