diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-11-09 18:23:09 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-11-09 18:23:09 +0200 |
commit | 04ca9bcdec44483007a79bf594d335b4f0cc85ca (patch) | |
tree | 224bea8c92fcefb32797d4593a905e657a0ea560 /innobase/page | |
parent | 59838a577a88219958ac0e01f9cc7768c32c96d0 (diff) | |
download | mariadb-git-04ca9bcdec44483007a79bf594d335b4f0cc85ca.tar.gz |
Many files:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/include/btr0btr.h:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/include/btr0pcur.h:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/include/db0err.h:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/include/btr0pcur.ic:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/btr/btr0btr.c:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/page/page0page.c:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
innobase/row/row0sel.c:
Try to skip over corrupt records in SELECT if innodb_force_recovery > 0; print more page hex dumps in CHECK TABLE
Diffstat (limited to 'innobase/page')
-rw-r--r-- | innobase/page/page0page.c | 92 |
1 files changed, 58 insertions, 34 deletions
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c index 7d0d88c6afc..7d240bdd5b0 100644 --- a/innobase/page/page0page.c +++ b/innobase/page/page0page.c @@ -1299,12 +1299,16 @@ page_rec_validate( heap_no = rec_get_heap_no(rec); if (!(n_owned <= PAGE_DIR_SLOT_MAX_N_OWNED)) { - fprintf(stderr, "Dir slot n owned too big %lu\n", n_owned); + fprintf(stderr, + "InnoDB: Dir slot of rec %lu, n owned too big %lu\n", + (ulint)(rec - page), n_owned); return(FALSE); } if (!(heap_no < page_header_get_field(page, PAGE_N_HEAP))) { - fprintf(stderr, "Heap no too big %lu %lu\n", heap_no, + fprintf(stderr, + "InnoDB: Heap no of rec %lu too big %lu %lu\n", + (ulint)(rec - page), heap_no, page_header_get_field(page, PAGE_N_HEAP)); return(FALSE); } @@ -1340,7 +1344,7 @@ page_simple_validate( if (n_slots > UNIV_PAGE_SIZE / 4) { fprintf(stderr, - "Nonsensical number %lu of page dir slots\n", n_slots); + "InnoDB: Nonsensical number %lu of page dir slots\n", n_slots); goto func_exit; } @@ -1350,7 +1354,7 @@ page_simple_validate( if (rec_heap_top > page_dir_get_nth_slot(page, n_slots - 1)) { fprintf(stderr, - "Record heap and dir overlap on a page, heap top %lu, dir %lu\n", + "InnoDB: Record heap and dir overlap on a page, heap top %lu, dir %lu\n", (ulint)(page_header_get_ptr(page, PAGE_HEAP_TOP) - page), (ulint)(page_dir_get_nth_slot(page, n_slots - 1) - page)); @@ -1372,7 +1376,7 @@ page_simple_validate( if (rec > rec_heap_top) { fprintf(stderr, - "Record %lu is above rec heap top %lu\n", + "InnoDB: Record %lu is above rec heap top %lu\n", (ulint)(rec - page), (ulint)(rec_heap_top - page)); goto func_exit; @@ -1383,7 +1387,7 @@ page_simple_validate( if (rec_get_n_owned(rec) != own_count) { fprintf(stderr, - "Wrong owned count %lu, %lu, rec %lu\n", + "InnoDB: Wrong owned count %lu, %lu, rec %lu\n", rec_get_n_owned(rec), own_count, (ulint)(rec - page)); @@ -1392,7 +1396,7 @@ page_simple_validate( if (page_dir_slot_get_rec(slot) != rec) { fprintf(stderr, - "Dir slot does not point to right rec %lu\n", + "InnoDB: Dir slot does not point to right rec %lu\n", (ulint)(rec - page)); goto func_exit; @@ -1414,7 +1418,7 @@ page_simple_validate( if (rec_get_next_offs(rec) < FIL_PAGE_DATA || rec_get_next_offs(rec) >= UNIV_PAGE_SIZE) { fprintf(stderr, - "Next record offset nonsensical %lu for rec %lu\n", + "InnoDB: Next record offset nonsensical %lu for rec %lu\n", rec_get_next_offs(rec), (ulint)(rec - page)); @@ -1425,7 +1429,7 @@ page_simple_validate( if (count > UNIV_PAGE_SIZE) { fprintf(stderr, - "Page record list appears to be circular %lu\n", + "InnoDB: Page record list appears to be circular %lu\n", count); goto func_exit; } @@ -1435,19 +1439,19 @@ page_simple_validate( } if (rec_get_n_owned(rec) == 0) { - fprintf(stderr, "n owned is zero in a supremum rec\n"); + fprintf(stderr, "InnoDB: n owned is zero in a supremum rec\n"); goto func_exit; } if (slot_no != n_slots - 1) { - fprintf(stderr, "n slots wrong %lu, %lu\n", + fprintf(stderr, "InnoDB: n slots wrong %lu, %lu\n", slot_no, n_slots - 1); goto func_exit; } if (page_header_get_field(page, PAGE_N_RECS) + 2 != count + 1) { - fprintf(stderr, "n recs wrong %lu %lu\n", + fprintf(stderr, "InnoDB: n recs wrong %lu %lu\n", page_header_get_field(page, PAGE_N_RECS) + 2, count + 1); goto func_exit; @@ -1460,7 +1464,7 @@ page_simple_validate( if (rec < page + FIL_PAGE_DATA || rec >= page + UNIV_PAGE_SIZE) { fprintf(stderr, - "Free list record has a nonsensical offset %lu\n", + "InnoDB: Free list record has a nonsensical offset %lu\n", (ulint)(rec - page)); goto func_exit; @@ -1468,7 +1472,7 @@ page_simple_validate( if (rec > rec_heap_top) { fprintf(stderr, - "Free list record %lu is above rec heap top %lu\n", + "InnoDB: Free list record %lu is above rec heap top %lu\n", (ulint)(rec - page), (ulint)(rec_heap_top - page)); goto func_exit; @@ -1478,7 +1482,7 @@ page_simple_validate( if (count > UNIV_PAGE_SIZE) { fprintf(stderr, - "Page free list appears to be circular %lu\n", + "InnoDB: Page free list appears to be circular %lu\n", count); goto func_exit; } @@ -1488,7 +1492,7 @@ page_simple_validate( if (page_header_get_field(page, PAGE_N_HEAP) != count + 1) { - fprintf(stderr, "N heap is wrong %lu, %lu\n", + fprintf(stderr, "InnoDB: N heap is wrong %lu, %lu\n", page_header_get_field(page, PAGE_N_HEAP), count + 1); goto func_exit; @@ -1528,10 +1532,13 @@ page_validate( char err_buf[1000]; if (!page_simple_validate(page)) { + fprintf(stderr, +"InnoDB: Apparent corruption in page %lu in index %s in table %s\n", + buf_frame_get_page_no(page), index->name, + index->table_name); + buf_page_print(page); - fprintf(stderr, "Apparent corruption in a page in index %s\n", - index->name); return(FALSE); } @@ -1553,7 +1560,7 @@ page_validate( if (!(page_header_get_ptr(page, PAGE_HEAP_TOP) <= page_dir_get_nth_slot(page, n_slots - 1))) { fprintf(stderr, - "Record heap and dir overlap on a page in index %s, %lu, %lu\n", +"InnoDB: Record heap and dir overlap on a page in index %s, %lu, %lu\n", index->name, (ulint)page_header_get_ptr(page, PAGE_HEAP_TOP), (ulint)page_dir_get_nth_slot(page, n_slots - 1)); @@ -1581,10 +1588,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); +"InnoDB: Records in wrong order on page %lu index %s table %s\n", + buf_frame_get_page_no(page), + index->name, + index->table_name); + rec_sprintf(err_buf, 900, old_rec); - fprintf(stderr, "InnoDB: record %s\n", err_buf); + fprintf(stderr, + "InnoDB: previous record %s\n", err_buf); rec_sprintf(err_buf, 900, rec); fprintf(stderr, "InnoDB: record %s\n", err_buf); @@ -1606,7 +1617,7 @@ page_validate( /* No other record may overlap this */ fprintf(stderr, - "Record overlaps another in index %s \n", + "InnoDB: Record overlaps another in index %s \n", index->name); goto func_exit; @@ -1619,7 +1630,7 @@ page_validate( /* This is a record pointed to by a dir slot */ if (rec_get_n_owned(rec) != own_count) { fprintf(stderr, - "Wrong owned count %lu, %lu, in index %s\n", + "InnoDB: Wrong owned count %lu, %lu, in index %s\n", rec_get_n_owned(rec), own_count, index->name); @@ -1628,7 +1639,7 @@ page_validate( if (page_dir_slot_get_rec(slot) != rec) { fprintf(stderr, - "Dir slot does not point to right rec in %s\n", + "InnoDB: Dir slot does not point to right rec in %s\n", index->name); goto func_exit; @@ -1650,7 +1661,7 @@ page_validate( if (rec_get_next_offs(rec) < FIL_PAGE_DATA || rec_get_next_offs(rec) >= UNIV_PAGE_SIZE) { fprintf(stderr, - "Next record offset wrong %lu in index %s\n", + "InnoDB: Next record offset wrong %lu in index %s\n", rec_get_next_offs(rec), index->name); goto func_exit; @@ -1663,19 +1674,20 @@ page_validate( } if (rec_get_n_owned(rec) == 0) { - fprintf(stderr, "n owned is zero in index %s\n", index->name); + fprintf(stderr, + "InnoDB: n owned is zero in index %s\n", index->name); goto func_exit; } if (slot_no != n_slots - 1) { - fprintf(stderr, "n slots wrong %lu %lu in index %s\n", + fprintf(stderr, "InnoDB: n slots wrong %lu %lu in index %s\n", slot_no, n_slots - 1, index->name); goto func_exit; } if (page_header_get_field(page, PAGE_N_RECS) + 2 != count + 1) { - fprintf(stderr, "n recs wrong %lu %lu in index %s\n", + fprintf(stderr, "InnoDB: n recs wrong %lu %lu in index %s\n", page_header_get_field(page, PAGE_N_RECS) + 2, count + 1, index->name); @@ -1683,7 +1695,8 @@ page_validate( } if (data_size != page_get_data_size(page)) { - fprintf(stderr, "Summed data size %lu, returned by func %lu\n", + fprintf(stderr, + "InnoDB: Summed data size %lu, returned by func %lu\n", data_size, page_get_data_size(page)); goto func_exit; } @@ -1704,7 +1717,7 @@ page_validate( if (buf[offs + i] != 0) { fprintf(stderr, - "Record overlaps another in free list, index %s \n", + "InnoDB: Record overlaps another in free list, index %s \n", index->name); goto func_exit; @@ -1718,9 +1731,11 @@ page_validate( if (page_header_get_field(page, PAGE_N_HEAP) != count + 1) { - fprintf(stderr, "N heap is wrong %lu %lu in index %s\n", - page_header_get_field(page, PAGE_N_HEAP), count + 1, - index->name); + fprintf(stderr, + "InnoDB: N heap is wrong %lu %lu in index %s\n", + page_header_get_field(page, PAGE_N_HEAP), count + 1, + index->name); + goto func_exit; } ret = TRUE; @@ -1728,6 +1743,15 @@ page_validate( func_exit: mem_heap_free(heap); + if (ret == FALSE) { + fprintf(stderr, +"InnoDB: Apparent corruption in page %lu in index %s in table %s\n", + buf_frame_get_page_no(page), index->name, + index->table_name); + + buf_page_print(page); + } + return(ret); } |