Commit 68247c5f authored by marko's avatar marko

branches/zip: page_validate(): Always report the space id and the

name of the index.

In Hot Backup, do not invoke comparison functions, as MySQL collations
will be unavailable.
parent e9760189
2009-03-20 The InnoDB Team
* page/page0page.c:
In page_validate(), always report the space id, page number and
the name of the index when corruption is noticed.
2009-03-20 The InnoDB Team 2009-03-20 The InnoDB Team
* include/log0log.h, include/log0log.ic, log/log0log.c: * include/log0log.h, include/log0log.ic, log/log0log.c:
......
...@@ -2310,10 +2310,11 @@ page_validate( ...@@ -2310,10 +2310,11 @@ page_validate(
if (UNIV_UNLIKELY(!(page_header_get_ptr(page, PAGE_HEAP_TOP) if (UNIV_UNLIKELY(!(page_header_get_ptr(page, PAGE_HEAP_TOP)
<= page_dir_get_nth_slot(page, n_slots - 1)))) { <= page_dir_get_nth_slot(page, n_slots - 1)))) {
fputs("InnoDB: Record heap and dir overlap on a page ", fprintf(stderr,
stderr); "InnoDB: Record heap and dir overlap"
dict_index_name_print(stderr, NULL, index); " on space %lu page %lu index %s, %p, %p\n",
fprintf(stderr, ", %p, %p\n", (ulong) page_get_space_id(page),
(ulong) page_get_page_no(page), index->name,
page_header_get_ptr(page, PAGE_HEAP_TOP), page_header_get_ptr(page, PAGE_HEAP_TOP),
page_dir_get_nth_slot(page, n_slots - 1)); page_dir_get_nth_slot(page, n_slots - 1));
...@@ -2345,6 +2346,7 @@ page_validate( ...@@ -2345,6 +2346,7 @@ page_validate(
goto func_exit; goto func_exit;
} }
#ifndef UNIV_HOTBACKUP
/* Check that the records are in the ascending order */ /* Check that the records are in the ascending order */
if (UNIV_LIKELY(count >= PAGE_HEAP_NO_USER_LOW) if (UNIV_LIKELY(count >= PAGE_HEAP_NO_USER_LOW)
&& !page_rec_is_supremum(rec)) { && !page_rec_is_supremum(rec)) {
...@@ -2353,9 +2355,10 @@ page_validate( ...@@ -2353,9 +2355,10 @@ page_validate(
offsets, old_offsets, index))) { offsets, old_offsets, index))) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Records in wrong order" "InnoDB: Records in wrong order"
" on page %lu ", " on space %lu page %lu index %s\n",
(ulong) page_get_page_no(page)); (ulong) page_get_space_id(page),
dict_index_name_print(stderr, NULL, index); (ulong) page_get_page_no(page),
index->name);
fputs("\nInnoDB: previous record ", stderr); fputs("\nInnoDB: previous record ", stderr);
rec_print_new(stderr, old_rec, old_offsets); rec_print_new(stderr, old_rec, old_offsets);
fputs("\nInnoDB: record ", stderr); fputs("\nInnoDB: record ", stderr);
...@@ -2365,6 +2368,7 @@ page_validate( ...@@ -2365,6 +2368,7 @@ page_validate(
goto func_exit; goto func_exit;
} }
} }
#endif /* !UNIV_HOTBACKUP */
if (page_rec_is_user_rec(rec)) { if (page_rec_is_user_rec(rec)) {
...@@ -2510,10 +2514,12 @@ page_validate( ...@@ -2510,10 +2514,12 @@ page_validate(
if (UNIV_UNLIKELY(ret == FALSE)) { if (UNIV_UNLIKELY(ret == FALSE)) {
func_exit2: func_exit2:
fprintf(stderr, "InnoDB: Apparent corruption in page %lu in ", fprintf(stderr,
(ulong) page_get_page_no(page)); "InnoDB: Apparent corruption"
dict_index_name_print(stderr, NULL, index); " in space %lu page %lu index %s\n",
putc('\n', stderr); (ulong) page_get_space_id(page),
(ulong) page_get_page_no(page),
index->name);
buf_page_print(page, 0); buf_page_print(page, 0);
} }
......
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