28 #include "page0page.ic"
35 #ifndef UNIV_HOTBACKUP
94 register uint16 rec_offs_bytes;
95 register const page_dir_slot_t* slot;
96 register const page_dir_slot_t* first_slot;
97 register const rec_t* r = rec;
102 first_slot = page_dir_get_nth_slot(page, 0);
108 ut_ad(r >= page + PAGE_NEW_SUPREMUM);
109 ut_ad(r < page + (UNIV_PAGE_SIZE - PAGE_DIR));
114 ut_ad(r >= page + PAGE_OLD_SUPREMUM);
115 ut_ad(r < page + (UNIV_PAGE_SIZE - PAGE_DIR));
121 while (UNIV_LIKELY(*(uint16*) slot != rec_offs_bytes)) {
123 if (UNIV_UNLIKELY(slot == first_slot)) {
125 "InnoDB: Probable data corruption on"
127 "InnoDB: Original record ",
131 fputs(
"(compact record)", stderr);
137 "InnoDB: on that page.\n"
138 "InnoDB: Cannot find the dir slot for record ",
141 fputs(
"(compact record)", stderr);
147 "InnoDB: on that page!\n", stderr);
154 slot += PAGE_DIR_SLOT_SIZE;
157 return(((ulint) (first_slot - slot)) / PAGE_DIR_SLOT_SIZE);
167 const page_dir_slot_t* slot)
179 ut_a(slot <= page_dir_get_nth_slot(page, 0));
180 ut_a(slot >= page_dir_get_nth_slot(page, n_slots - 1));
190 if (slot == page_dir_get_nth_slot(page, 0)) {
192 }
else if (slot == page_dir_get_nth_slot(page, n_slots - 1)) {
194 ut_a(n_owned <= PAGE_DIR_SLOT_MAX_N_OWNED);
196 ut_a(n_owned >= PAGE_DIR_SLOT_MIN_N_OWNED);
197 ut_a(n_owned <= PAGE_DIR_SLOT_MAX_N_OWNED);
214 page_t* page = buf_block_get_frame(block);
215 #ifndef UNIV_HOTBACKUP
216 const ibool is_hashed = block->
is_hashed;
222 ut_ad(!mtr || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
229 if (UNIV_LIKELY_NULL(page_zip)) {
232 page + (PAGE_HEADER + PAGE_MAX_TRX_ID),
234 #ifndef UNIV_HOTBACKUP
243 #ifndef UNIV_HOTBACKUP
269 ut_ad(page && heap_no);
273 if (avl_space >= need) {
288 #ifndef UNIV_HOTBACKUP
293 page_create_write_log(
305 # define page_create_write_log(frame,mtr,comp) ((void) 0)
321 ut_ad(ptr && end_ptr);
343 page_dir_slot_t* slot;
355 #if PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE > PAGE_DATA
356 # error "PAGE_BTR_IBUF_FREE_LIST + FLST_BASE_NODE_SIZE > PAGE_DATA"
358 #if PAGE_BTR_IBUF_FREE_LIST_NODE + FLST_NODE_SIZE > PAGE_DATA
359 # error "PAGE_BTR_IBUF_FREE_LIST_NODE + FLST_NODE_SIZE > PAGE_DATA"
363 if (UNIV_LIKELY(comp)) {
372 page = buf_block_get_frame(block);
383 field = dtuple_get_nth_field(tuple, 0);
387 DATA_VARCHAR, DATA_ENGLISH | DATA_NOT_NULL, 8);
391 heap_top = page + PAGE_DATA;
395 if (UNIV_LIKELY(comp)) {
396 ut_a(infimum_rec == page + PAGE_NEW_INFIMUM);
401 ut_a(infimum_rec == page + PAGE_OLD_INFIMUM);
407 offsets = rec_get_offsets(infimum_rec, index, NULL,
408 ULINT_UNDEFINED, &heap);
410 heap_top = rec_get_end(infimum_rec, offsets);
416 field = dtuple_get_nth_field(tuple, 0);
420 DATA_VARCHAR, DATA_ENGLISH | DATA_NOT_NULL, comp ? 8 : 9);
424 if (UNIV_LIKELY(comp)) {
425 ut_a(supremum_rec == page + PAGE_NEW_SUPREMUM);
430 ut_a(supremum_rec == page + PAGE_OLD_SUPREMUM);
436 offsets = rec_get_offsets(supremum_rec, index, offsets,
437 ULINT_UNDEFINED, &heap);
438 heap_top = rec_get_end(supremum_rec, offsets);
440 ut_ad(heap_top == page
441 + (comp ? PAGE_NEW_SUPREMUM_END : PAGE_OLD_SUPREMUM_END));
450 ? 0x8000 | PAGE_HEAP_NO_USER_LOW
451 : PAGE_HEAP_NO_USER_LOW);
459 memset(heap_top, 0, UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START
466 slot = page_dir_get_nth_slot(page, 0);
469 slot = page_dir_get_nth_slot(page, 1);
474 if (UNIV_LIKELY(comp)) {
497 page_create_write_log(buf_block_get_frame(block), mtr, comp);
498 return(page_create_low(block, comp));
522 page = page_create_low(block, TRUE);
547 page_t* new_page = buf_block_get_frame(new_block);
551 ulint offsets_[REC_OFFS_NORMAL_SIZE];
552 ulint* offsets = offsets_;
553 rec_offs_init(offsets_);
566 (
page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));
568 cur2 = page_get_infimum_rec(buf_block_get_frame(new_block));
573 rec_t* cur1_rec = page_cur_get_rec(&cur1);
575 offsets = rec_get_offsets(cur1_rec, index, offsets,
576 ULINT_UNDEFINED, &heap);
578 cur1_rec, offsets, mtr);
579 if (UNIV_UNLIKELY(!ins_rec)) {
588 "InnoDB: rec offset %lu, cur1 offset %lu,"
589 " cur2 offset %lu\n",
600 if (UNIV_LIKELY_NULL(heap)) {
605 #ifndef UNIV_HOTBACKUP
622 page_t* new_page = buf_block_get_frame(new_block);
626 page_get_infimum_rec(new_page));
629 #ifdef UNIV_ZIP_DEBUG
638 ut_a(page_zip_validate_low(page_zip, page, TRUE));
641 ut_ad(buf_block_get_frame(block) == page);
647 if (UNIV_LIKELY_NULL(new_page_zip)) {
667 if (UNIV_LIKELY_NULL(new_page_zip)) {
686 btr_blob_dbg_remove(new_page, index,
687 "copy_end_reorg_fail");
694 btr_blob_dbg_add(new_page, index,
695 "copy_end_reorg_fail");
700 ret = new_page + PAGE_NEW_INFIMUM;
734 page_t* new_page = buf_block_get_frame(new_block);
742 ulint offsets_[REC_OFFS_NORMAL_SIZE];
743 ulint* offsets = offsets_;
744 rec_offs_init(offsets_);
754 if (UNIV_LIKELY_NULL(new_page_zip)) {
765 while (page_cur_get_rec(&cur1) != rec) {
766 rec_t* cur1_rec = page_cur_get_rec(&cur1);
767 offsets = rec_get_offsets(cur1_rec, index, offsets,
768 ULINT_UNDEFINED, &heap);
770 cur1_rec, offsets, mtr);
776 if (UNIV_LIKELY_NULL(heap)) {
790 if (UNIV_LIKELY_NULL(new_page_zip)) {
808 btr_blob_dbg_remove(new_page, index,
809 "copy_start_reorg_fail");
816 btr_blob_dbg_add(new_page, index,
817 "copy_start_reorg_fail");
822 ret = new_page + PAGE_NEW_INFIMUM;
844 page_delete_rec_list_write_log(
866 # define page_delete_rec_list_write_log(rec,index,type,mtr) ((void) 0)
896 if (end_ptr < ptr + 2) {
909 page = buf_block_get_frame(block);
916 ULINT_UNDEFINED, ULINT_UNDEFINED,
942 page_dir_slot_t*slot;
950 ulint offsets_[REC_OFFS_NORMAL_SIZE];
951 ulint* offsets = offsets_;
952 rec_offs_init(offsets_);
954 ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE);
956 #ifdef UNIV_ZIP_DEBUG
957 ut_a(!page_zip || page_zip_validate(page_zip, page));
979 page_delete_rec_list_write_log(rec, index,
page_is_comp(page)
983 if (UNIV_LIKELY_NULL(page_zip)) {
995 offsets = rec_get_offsets(rec, index, offsets,
996 ULINT_UNDEFINED, &heap);
998 #ifdef UNIV_ZIP_DEBUG
999 ut_a(page_zip_validate(page_zip, page));
1004 if (UNIV_LIKELY_NULL(heap)) {
1018 if ((size == ULINT_UNDEFINED) || (n_recs == ULINT_UNDEFINED)) {
1026 offsets = rec_get_offsets(rec2, index, offsets,
1027 ULINT_UNDEFINED, &heap);
1031 ut_ad(size + s < UNIV_PAGE_SIZE);
1038 if (UNIV_LIKELY_NULL(heap)) {
1043 ut_ad(size < UNIV_PAGE_SIZE);
1063 slot = page_dir_get_nth_slot(page, slot_index);
1078 slot = page_dir_get_nth_slot(page, slot_index);
1089 btr_blob_dbg_op(page, rec, index,
"delete_end",
1090 btr_blob_dbg_remove_rec);
1118 ulint offsets_[REC_OFFS_NORMAL_SIZE];
1119 ulint* offsets = offsets_;
1123 rec_offs_init(offsets_);
1127 #ifdef UNIV_ZIP_DEBUG
1130 page_t* page = buf_block_get_frame(block);
1137 ut_a(!page_zip || page_zip_validate_low(page_zip, page, TRUE));
1152 page_delete_rec_list_write_log(rec, index, type, mtr);
1161 while (page_cur_get_rec(&cur1) != rec) {
1162 offsets = rec_get_offsets(page_cur_get_rec(&cur1), index,
1163 offsets, ULINT_UNDEFINED, &heap);
1167 if (UNIV_LIKELY_NULL(heap)) {
1176 #ifndef UNIV_HOTBACKUP
1192 page_t* new_page = buf_block_get_frame(new_block);
1193 ulint old_data_size;
1194 ulint new_data_size;
1200 #ifdef UNIV_ZIP_DEBUG
1206 ut_a(!new_page_zip == !page_zip);
1208 || page_zip_validate(new_page_zip, new_page));
1210 || page_zip_validate(page_zip,
page_align(split_rec)));
1215 split_rec, index, mtr))) {
1222 ut_ad(new_data_size >= old_data_size);
1225 new_n_recs - old_n_recs,
1226 new_data_size - old_data_size, mtr);
1246 split_rec, index, mtr))) {
1270 data = rec_get_nth_field_old(rec, i, &len);
1284 page_dir_delete_slot(
1290 page_dir_slot_t* slot;
1303 slot = page_dir_get_nth_slot(page, slot_no);
1309 slot = page_dir_get_nth_slot(page, slot_no + 1);
1314 for (i = slot_no + 1; i < n_slots; i++) {
1315 rec_t* rec = (rec_t*)
1340 page_dir_slot_t* slot;
1345 ut_ad(start < n_slots - 1);
1351 slot = page_dir_get_nth_slot(page, n_slots);
1352 memmove(slot, slot + PAGE_DIR_SLOT_SIZE,
1353 (n_slots - 1 - start) * PAGE_DIR_SLOT_SIZE);
1368 page_dir_slot_t* new_slot;
1369 page_dir_slot_t* prev_slot;
1370 page_dir_slot_t* slot;
1378 slot = page_dir_get_nth_slot(page, slot_no);
1381 ut_ad(n_owned == PAGE_DIR_SLOT_MAX_N_OWNED + 1);
1386 prev_slot = page_dir_get_nth_slot(page, slot_no - 1);
1389 for (i = 0; i < n_owned / 2; i++) {
1393 ut_ad(n_owned / 2 >= PAGE_DIR_SLOT_MIN_N_OWNED);
1398 page_dir_add_slot(page, page_zip, slot_no - 1);
1403 new_slot = page_dir_get_nth_slot(page, slot_no);
1404 slot = page_dir_get_nth_slot(page, slot_no + 1);
1429 page_dir_slot_t* slot;
1430 page_dir_slot_t* up_slot;
1440 slot = page_dir_get_nth_slot(page, slot_no);
1450 up_slot = page_dir_get_nth_slot(page, slot_no + 1);
1455 ut_ad(n_owned == PAGE_DIR_SLOT_MIN_N_OWNED - 1);
1459 ut_ad(2 * PAGE_DIR_SLOT_MIN_N_OWNED - 1 <= PAGE_DIR_SLOT_MAX_N_OWNED);
1461 if (up_n_owned > PAGE_DIR_SLOT_MIN_N_OWNED) {
1484 page_dir_delete_slot(page, page_zip, slot_no);
1488 #ifndef UNIV_HOTBACKUP
1499 page_dir_slot_t* slot;
1513 slot = page_dir_get_nth_slot(page, i);
1516 if (count + n_owned > middle) {
1524 slot = page_dir_get_nth_slot(page, i - 1);
1530 for (i = 0; i < middle - count; i++) {
1548 const page_dir_slot_t* slot;
1549 const rec_t* slot_rec;
1564 for (i = 0; ; i++) {
1565 slot = page_dir_get_nth_slot(page, i);
1570 if (rec == slot_rec) {
1582 for (i = 0; ; i++) {
1583 slot = page_dir_get_nth_slot(page, i);
1588 if (rec == slot_rec) {
1602 #ifndef UNIV_HOTBACKUP
1611 const ulint* offsets)
1617 " n_owned: %lu; heap_no: %lu; next rec: %lu\n",
1623 " n_owned: %lu; heap_no: %lu; next rec: %lu\n",
1645 page_dir_slot_t* slot;
1649 fprintf(stderr,
"--------------------------------\n"
1652 "Directory stack top at offs: %lu; number of slots: %lu\n",
1653 page, (ulong)
page_offset(page_dir_get_nth_slot(page, n - 1)),
1655 for (i = 0; i < n; i++) {
1656 slot = page_dir_get_nth_slot(page, i);
1657 if ((i == pr_n) && (i < n - pr_n)) {
1658 fputs(
" ... \n", stderr);
1660 if ((i < pr_n) || (i >= n - pr_n)) {
1662 "Contents of slot: %lu: n_owned: %lu,"
1670 fprintf(stderr,
"Total of %lu records\n"
1671 "--------------------------------\n",
1691 ulint offsets_[REC_OFFS_NORMAL_SIZE];
1692 ulint* offsets = offsets_;
1693 rec_offs_init(offsets_);
1698 "--------------------------------\n"
1699 "PAGE RECORD LIST\n"
1700 "Page address %p\n", page);
1707 offsets = rec_get_offsets(cur.
rec, index, offsets,
1708 ULINT_UNDEFINED, &heap);
1711 if (count == pr_n) {
1721 if (n_recs > 2 * pr_n) {
1722 fputs(
" ... \n", stderr);
1728 if (count + pr_n >= n_recs) {
1729 offsets = rec_get_offsets(cur.
rec, index, offsets,
1730 ULINT_UNDEFINED, &heap);
1737 "Total of %lu records \n"
1738 "--------------------------------\n",
1739 (ulong) (count + 1));
1741 if (UNIV_LIKELY_NULL(heap)) {
1755 "--------------------------------\n"
1756 "PAGE HEADER INFO\n"
1757 "Page address %p, n records %lu (%s)\n"
1758 "n dir slots %lu, heap top %lu\n"
1759 "Page n heap %lu, free %lu, garbage %lu\n"
1760 "Page last insert %lu, direction %lu, n direction %lu\n",
1762 page_is_comp(page) ?
"compact format" :
"original format",
1805 const ulint* offsets)
1825 if (UNIV_UNLIKELY(!(n_owned <= PAGE_DIR_SLOT_MAX_N_OWNED))) {
1827 "InnoDB: Dir slot of rec %lu, n owned too big %lu\n",
1834 "InnoDB: Heap no of rec %lu too big %lu %lu\n",
1843 #ifndef UNIV_HOTBACKUP
1856 ulint supremum_offs;
1866 "InnoDB: Page directory corruption:"
1867 " infimum not pointed to\n");
1874 "InnoDB: Page directory corruption:"
1875 " supremum not pointed to\n");
1892 const page_dir_slot_t* slot;
1896 const byte* rec_heap_top;
1908 if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) {
1910 "InnoDB: Nonsensical number %lu of page dir slots\n",
1918 if (UNIV_UNLIKELY(rec_heap_top
1919 > page_dir_get_nth_slot(page, n_slots - 1))) {
1922 "InnoDB: Record heap and dir overlap on a page,"
1923 " heap top %lu, dir %lu\n",
1926 page_offset(page_dir_get_nth_slot(page, n_slots - 1)));
1937 slot = page_dir_get_nth_slot(page, slot_no);
1939 rec = page_get_infimum_rec(page);
1942 if (UNIV_UNLIKELY(rec > rec_heap_top)) {
1944 "InnoDB: Record %lu is above"
1945 " rec heap top %lu\n",
1946 (ulong)(rec - page),
1947 (ulong)(rec_heap_top - page));
1958 "InnoDB: Wrong owned count %lu, %lu,"
1962 (ulong)(rec - page));
1970 "InnoDB: Dir slot does not point"
1971 " to right rec %lu\n",
1972 (ulong)(rec - page));
1981 slot = page_dir_get_nth_slot(page, slot_no);
1994 "InnoDB: Next record offset"
1995 " nonsensical %lu for rec %lu\n",
1997 (ulong) (rec - page));
2004 if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
2006 "InnoDB: Page record list appears"
2007 " to be circular %lu\n",
2017 fprintf(stderr,
"InnoDB: n owned is zero in a supremum rec\n");
2022 if (UNIV_UNLIKELY(slot_no != n_slots - 1)) {
2023 fprintf(stderr,
"InnoDB: n slots wrong %lu, %lu\n",
2024 (ulong) slot_no, (ulong) (n_slots - 1));
2029 + PAGE_HEAP_NO_USER_LOW
2031 fprintf(stderr,
"InnoDB: n recs wrong %lu %lu\n",
2033 + PAGE_HEAP_NO_USER_LOW,
2034 (ulong) (count + 1));
2042 while (rec != NULL) {
2044 || rec >= page + UNIV_PAGE_SIZE)) {
2046 "InnoDB: Free list record has"
2047 " a nonsensical offset %lu\n",
2048 (ulong) (rec - page));
2053 if (UNIV_UNLIKELY(rec > rec_heap_top)) {
2055 "InnoDB: Free list record %lu"
2056 " is above rec heap top %lu\n",
2057 (ulong) (rec - page),
2058 (ulong) (rec_heap_top - page));
2065 if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
2067 "InnoDB: Page free list appears"
2068 " to be circular %lu\n",
2078 fprintf(stderr,
"InnoDB: N heap is wrong %lu, %lu\n",
2080 (ulong) (count + 1));
2102 const page_dir_slot_t* slot;
2106 const byte* rec_heap_top;
2118 if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) {
2120 "InnoDB: Nonsensical number %lu"
2121 " of page dir slots\n", (ulong) n_slots);
2128 if (UNIV_UNLIKELY(rec_heap_top
2129 > page_dir_get_nth_slot(page, n_slots - 1))) {
2132 "InnoDB: Record heap and dir overlap on a page,"
2133 " heap top %lu, dir %lu\n",
2136 page_offset(page_dir_get_nth_slot(page, n_slots - 1)));
2147 slot = page_dir_get_nth_slot(page, slot_no);
2149 rec = page_get_infimum_rec(page);
2152 if (UNIV_UNLIKELY(rec > rec_heap_top)) {
2154 "InnoDB: Record %lu is above rec"
2168 "InnoDB: Wrong owned count %lu, %lu,"
2180 "InnoDB: Dir slot does not point"
2181 " to right rec %lu\n",
2191 slot = page_dir_get_nth_slot(page, slot_no);
2204 "InnoDB: Next record offset nonsensical %lu"
2214 if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
2216 "InnoDB: Page record list appears"
2217 " to be circular %lu\n",
2227 fprintf(stderr,
"InnoDB: n owned is zero"
2228 " in a supremum rec\n");
2233 if (UNIV_UNLIKELY(slot_no != n_slots - 1)) {
2234 fprintf(stderr,
"InnoDB: n slots wrong %lu, %lu\n",
2235 (ulong) slot_no, (ulong) (n_slots - 1));
2240 + PAGE_HEAP_NO_USER_LOW
2242 fprintf(stderr,
"InnoDB: n recs wrong %lu %lu\n",
2244 + PAGE_HEAP_NO_USER_LOW,
2245 (ulong) (count + 1));
2253 while (rec != NULL) {
2255 || rec >= page + UNIV_PAGE_SIZE)) {
2257 "InnoDB: Free list record has"
2258 " a nonsensical offset %lu\n",
2264 if (UNIV_UNLIKELY(rec > rec_heap_top)) {
2266 "InnoDB: Free list record %lu"
2267 " is above rec heap top %lu\n",
2276 if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
2278 "InnoDB: Page free list appears"
2279 " to be circular %lu\n",
2289 fprintf(stderr,
"InnoDB: N heap is wrong %lu, %lu\n",
2291 (ulong) (count + 1));
2313 const page_dir_slot_t* slot;
2318 ulint rec_own_count;
2322 const rec_t* old_rec = NULL;
2327 ulint* offsets = NULL;
2328 ulint* old_offsets = NULL;
2329 void* buf_ptr= NULL;
2333 fputs(
"InnoDB: 'compact format' flag mismatch\n", stderr);
2352 buf =
static_cast<byte *
>(buf_ptr);
2360 <= page_dir_get_nth_slot(page, n_slots - 1)))) {
2363 "InnoDB: Record heap and dir overlap"
2364 " on space %lu page %lu index %s, %p, %p\n",
2368 page_dir_get_nth_slot(page, n_slots - 1));
2379 slot = page_dir_get_nth_slot(page, slot_no);
2381 rec = page_get_infimum_rec(page);
2384 offsets = rec_get_offsets(rec, index, offsets,
2385 ULINT_UNDEFINED, &heap);
2390 fputs(
"InnoDB: node_ptr flag mismatch\n", stderr);
2398 #ifndef UNIV_HOTBACKUP
2400 if (UNIV_LIKELY(count >= PAGE_HEAP_NO_USER_LOW)
2404 offsets, old_offsets, index))) {
2406 "InnoDB: Records in wrong order"
2407 " on space %lu page %lu index %s\n",
2411 fputs(
"\nInnoDB: previous record ", stderr);
2413 fputs(
"\nInnoDB: record ", stderr);
2429 if (UNIV_UNLIKELY(offs + i >= UNIV_PAGE_SIZE)) {
2430 fputs(
"InnoDB: record offset out of bounds\n", stderr);
2435 if (UNIV_UNLIKELY(buf[offs + i])) {
2438 fputs(
"InnoDB: Record overlaps another\n",
2452 if (UNIV_UNLIKELY(rec_own_count)) {
2454 if (UNIV_UNLIKELY(rec_own_count != own_count)) {
2456 "InnoDB: Wrong owned count %lu, %lu\n",
2457 (ulong) rec_own_count,
2463 fputs(
"InnoDB: Dir slot does not"
2464 " point to right rec\n",
2469 page_dir_slot_check(slot);
2474 slot = page_dir_get_nth_slot(page, slot_no);
2489 ulint* tmp_offs = old_offsets;
2490 old_offsets = offsets;
2502 fputs(
"InnoDB: n owned is zero\n", stderr);
2506 if (UNIV_UNLIKELY(slot_no != n_slots - 1)) {
2507 fprintf(stderr,
"InnoDB: n slots wrong %lu %lu\n",
2508 (ulong) slot_no, (ulong) (n_slots - 1));
2513 + PAGE_HEAP_NO_USER_LOW
2515 fprintf(stderr,
"InnoDB: n recs wrong %lu %lu\n",
2517 + PAGE_HEAP_NO_USER_LOW,
2518 (ulong) (count + 1));
2524 "InnoDB: Summed data size %lu, returned by func %lu\n",
2532 while (rec != NULL) {
2533 offsets = rec_get_offsets(rec, index, offsets,
2534 ULINT_UNDEFINED, &heap);
2543 if (UNIV_UNLIKELY(offs + i >= UNIV_PAGE_SIZE)) {
2544 fputs(
"InnoDB: record offset out of bounds\n", stderr);
2550 if (UNIV_UNLIKELY(buf[offs + i])) {
2551 fputs(
"InnoDB: Record overlaps another"
2552 " in free list\n", stderr);
2563 fprintf(stderr,
"InnoDB: N heap is wrong %lu %lu\n",
2574 if (UNIV_UNLIKELY(ret == FALSE)) {
2577 "InnoDB: Apparent corruption"
2578 " in space %lu page %lu index %s\n",
2588 #ifndef UNIV_HOTBACKUP
2602 rec = page + PAGE_NEW_INFIMUM;
2607 if (rec_heap_no == heap_no) {
2610 }
else if (rec_heap_no == PAGE_HEAP_NO_SUPREMUM) {
2618 rec = page + PAGE_OLD_INFIMUM;
2623 if (rec_heap_no == heap_no) {
2626 }
else if (rec_heap_no == PAGE_HEAP_NO_SUPREMUM) {
UNIV_INLINE uint16 mach_encode_2(ulint n) __attribute__((const ))
UNIV_INTERN void page_set_max_trx_id(buf_block_t *block, page_zip_des_t *page_zip, trx_id_t trx_id, mtr_t *mtr)
UNIV_INTERN ibool UNIV_INTERN ibool page_zip_decompress(page_zip_des_t *page_zip, page_t *page, ibool all) __attribute__((nonnull(1
UNIV_INLINE ulint page_is_comp(const page_t *page)
UNIV_INTERN void lock_move_rec_list_end(const buf_block_t *new_block, const buf_block_t *block, const rec_t *rec)
UNIV_INTERN void btr_search_move_or_delete_hash_entries(buf_block_t *new_block, buf_block_t *block, dict_index_t *index)
UNIV_INTERN ibool page_simple_validate_old(const page_t *page)
UNIV_INTERN ibool page_zip_reorganize(buf_block_t *block, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE ulint page_get_space_id(const page_t *page)
UNIV_INLINE ulint dict_index_is_sec_or_ibuf(const dict_index_t *index) __attribute__((pure))
UNIV_INLINE int cmp_rec_rec(const rec_t *rec1, const rec_t *rec2, const ulint *offsets1, const ulint *offsets2, dict_index_t *index)
UNIV_INLINE page_t * page_align(const void *ptr) __attribute__((const ))
UNIV_INLINE void page_rec_set_next(rec_t *rec, rec_t *next)
UNIV_INTERN ibool page_zip_compress(page_zip_des_t *page_zip, const page_t *page, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INLINE ulint page_get_page_no(const page_t *page)
UNIV_INLINE ulint mtr_set_log_mode(mtr_t *mtr, ulint mode)
UNIV_INTERN void page_dir_balance_slot(page_t *page, page_zip_des_t *page_zip, ulint slot_no) __attribute__((nonnull(1)))
UNIV_INLINE void page_header_set_field(page_t *page, page_zip_des_t *page_zip, ulint field, ulint val)
#define MLOG_COMP_PAGE_CREATE
UNIV_INLINE dtuple_t * dtuple_create(mem_heap_t *heap, ulint n_fields)
UNIV_INLINE ulint page_get_n_recs(const page_t *page)
UNIV_INTERN void buf_page_print(const byte *read_buf, ulint zip_size)
UNIV_INTERN rec_t * page_copy_rec_list_start(buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE void page_dir_set_n_heap(page_t *page, page_zip_des_t *page_zip, ulint n_heap)
UNIV_INTERN void page_cur_delete_rec(page_cur_t *cursor, dict_index_t *index, const ulint *offsets, mtr_t *mtr)
UNIV_INLINE ulint rec_get_next_offs(const rec_t *rec, ulint comp)
UNIV_INLINE ulint page_get_data_size(const page_t *page)
UNIV_INTERN void page_delete_rec_list_end(rec_t *rec, buf_block_t *block, dict_index_t *index, ulint n_recs, ulint size, mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE void mlog_close(mtr_t *mtr, byte *ptr)
UNIV_INLINE trx_id_t page_get_max_trx_id(const page_t *page)
UNIV_INTERN ibool page_simple_validate_new(const page_t *page)
UNIV_INTERN byte * page_mem_alloc_heap(page_t *page, page_zip_des_t *page_zip, ulint need, ulint *heap_no)
UNIV_INLINE ibool dict_table_is_comp(const dict_table_t *table)
UNIV_INLINE ulint page_dir_get_n_heap(const page_t *page)
UNIV_INLINE void buf_block_modify_clock_inc(buf_block_t *block)
UNIV_INLINE void mach_write_to_8(byte *b, ib_uint64_t n)
UNIV_INTERN void rec_print_new(FILE *file, const rec_t *rec, const ulint *offsets)
UNIV_INLINE ulint rec_offs_extra_size(const ulint *offsets)
UNIV_INLINE void rec_set_next_offs_old(rec_t *rec, ulint next)
UNIV_INLINE void page_zip_write_header(page_zip_des_t *page_zip, const byte *str, ulint length, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INTERN void mlog_write_ulint(byte *ptr, ulint val, byte type, mtr_t *mtr)
UNIV_INLINE ibool page_cur_is_before_first(const page_cur_t *cur)
UNIV_INLINE const rec_t * page_dir_slot_get_rec(const page_dir_slot_t *slot)
UNIV_INLINE rec_t * page_rec_get_next(rec_t *rec)
UNIV_INLINE void page_cur_set_before_first(const buf_block_t *block, page_cur_t *cur)
#define MLOG_LIST_END_DELETE
UNIV_INTERN void page_rec_print(const rec_t *rec, const ulint *offsets)
UNIV_INTERN byte * mlog_open_and_write_index(mtr_t *mtr, const byte *rec, dict_index_t *index, byte type, ulint size)
#define mem_heap_free(heap)
UNIV_INTERN rec_t * rec_convert_dtuple_to_rec(byte *buf, const dict_index_t *index, const dtuple_t *dtuple, ulint n_ext)
UNIV_INTERN void page_dir_print(page_t *page, ulint pr_n)
UNIV_INTERN ibool page_rec_validate(const rec_t *rec, const ulint *offsets)
UNIV_INLINE ulint page_header_get_field(const page_t *page, ulint field)
UNIV_INLINE void rec_set_heap_no_old(rec_t *rec, ulint heap_no)
UNIV_INLINE void page_dir_set_n_slots(page_t *page, page_zip_des_t *page_zip, ulint n_slots)
#define MLOG_COMP_LIST_START_DELETE
UNIV_INLINE void page_dir_slot_set_rec(page_dir_slot_t *slot, rec_t *rec)
UNIV_INLINE void rec_set_heap_no_new(rec_t *rec, ulint heap_no)
UNIV_INLINE rec_t * page_rec_get_prev(rec_t *rec)
UNIV_INTERN void page_print(buf_block_t *block, dict_index_t *index, ulint dn, ulint rn)
UNIV_INTERN ulint page_dir_find_owner_slot(const rec_t *rec)
UNIV_INTERN byte * page_parse_delete_rec_list(byte type, byte *ptr, byte *end_ptr, buf_block_t *block, dict_index_t *index, mtr_t *mtr)
UNIV_INTERN ibool page_move_rec_list_end(buf_block_t *new_block, buf_block_t *block, rec_t *split_rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INLINE void page_update_max_trx_id(buf_block_t *block, page_zip_des_t *page_zip, trx_id_t trx_id, mtr_t *mtr)
UNIV_INLINE void dfield_set_data(dfield_t *field, const void *data, ulint len)
#define MLOG_LIST_START_DELETE
UNIV_INTERN page_t * page_create_zip(buf_block_t *block, dict_index_t *index, ulint level, mtr_t *mtr)
UNIV_INLINE ulint rec_get_n_owned_new(const rec_t *rec)
UNIV_INLINE ulint page_rec_is_comp(const rec_t *rec)
UNIV_INLINE ulint rec_offs_comp(const ulint *offsets)
UNIV_INTERN rec_t * page_get_middle_rec(page_t *page)
UNIV_INTERN void mlog_write_ull(byte *ptr, ib_uint64_t val, mtr_t *mtr)
UNIV_INLINE ulint page_get_max_insert_size(const page_t *page, ulint n_recs)
UNIV_INLINE ibool page_is_leaf(const page_t *page) __attribute__((nonnull
UNIV_INTERN rec_t * page_cur_insert_rec_low(rec_t *current_rec, dict_index_t *index, const rec_t *rec, ulint *offsets, mtr_t *mtr)
UNIV_INTERN void fil_page_set_type(byte *page, ulint type)
UNIV_INLINE ibool page_cur_is_after_last(const page_cur_t *cur)
UNIV_INTERN void page_header_print(const page_t *page)
UNIV_INTERN rec_t * page_copy_rec_list_end(buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull))
UNIV_INTERN void page_delete_rec_list_start(rec_t *rec, buf_block_t *block, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull))
UNIV_INTERN ibool page_validate(const page_t *page, dict_index_t *index)
UNIV_INLINE ulint page_offset(const void *ptr) __attribute__((const ))
#define buf_block_get_page_zip(block)
UNIV_INLINE void page_header_set_ptr(page_t *page, page_zip_des_t *page_zip, ulint field, const byte *ptr)
UNIV_INLINE void dtuple_set_info_bits(dtuple_t *tuple, ulint info_bits)
dict_index_t * dict_ind_compact
UNIV_INTERN void lock_move_rec_list_start(const buf_block_t *new_block, const buf_block_t *block, const rec_t *rec, const rec_t *old_end)
UNIV_INLINE void page_cur_move_to_next(page_cur_t *cur)
UNIV_INTERN void page_check_dir(const page_t *page)
#define mem_heap_create(N)
UNIV_INLINE ibool page_rec_is_supremum(const rec_t *rec) __attribute__((const ))
UNIV_INLINE void page_dir_slot_set_n_owned(page_dir_slot_t *slot, page_zip_des_t *page_zip, ulint n)
UNIV_INLINE void * mem_heap_zalloc(mem_heap_t *heap, ulint n)
UNIV_INTERN page_t * page_create(buf_block_t *block, mtr_t *mtr, ulint comp)
UNIV_INLINE void rec_set_n_owned_new(rec_t *rec, page_zip_des_t *page_zip, ulint n_owned)
UNIV_INTERN void page_copy_rec_list_end_to_created_page(page_t *new_page, rec_t *rec, dict_index_t *index, mtr_t *mtr)
UNIV_INTERN void page_print_list(buf_block_t *block, dict_index_t *index, ulint pr_n)
UNIV_INTERN void mlog_write_initial_log_record(const byte *ptr, byte type, mtr_t *mtr)
UNIV_INLINE const rec_t * rec_get_next_ptr_const(const rec_t *rec, ulint comp)
UNIV_INTERN byte * page_parse_create(byte *ptr, byte *end_ptr, ulint comp, buf_block_t *block, mtr_t *mtr)
UNIV_INLINE ulint rec_get_heap_no_old(const rec_t *rec)
UNIV_INLINE ibool rec_get_node_ptr_flag(const rec_t *rec)
UNIV_INLINE ulint mach_decode_2(uint16 n) __attribute__((const ))
UNIV_INLINE const rec_t * page_rec_get_next_const(const rec_t *rec)
UNIV_INTERN ibool rec_validate(const rec_t *rec, const ulint *offsets)
UNIV_INLINE rec_t * rec_get_next_ptr(rec_t *rec, ulint comp)
UNIV_INLINE ibool page_rec_is_user_rec(const rec_t *rec) __attribute__((const ))
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INLINE void dtype_set(dtype_t *type, ulint mtype, ulint prtype, ulint len)
UNIV_INLINE void mach_write_to_2(byte *b, ulint n)
UNIV_INLINE void rec_set_next_offs_new(rec_t *rec, ulint next)
UNIV_INTERN void page_copy_rec_list_end_no_locks(buf_block_t *new_block, buf_block_t *block, rec_t *rec, dict_index_t *index, mtr_t *mtr)
UNIV_INLINE ibool page_rec_check(const rec_t *rec)
UNIV_INTERN void rec_print_old(FILE *file, const rec_t *rec)
const rec_t * page_find_rec_with_heap_no(const page_t *page, ulint heap_no)
#define page_header_get_ptr(page, field)
UNIV_INLINE ulint page_dir_slot_get_n_owned(const page_dir_slot_t *slot)
UNIV_INLINE ibool page_rec_is_supremum_low(ulint offset) __attribute__((const ))
UNIV_INLINE ulint rec_get_heap_no_new(const rec_t *rec)
UNIV_INLINE ibool page_rec_is_infimum(const rec_t *rec) __attribute__((const ))
UNIV_INLINE ulint rec_offs_size(const ulint *offsets)
UNIV_INLINE ulint mach_read_from_2(const byte *b) __attribute__((nonnull
UNIV_INTERN ibool UNIV_INTERN ibool UNIV_INTERN void page_dir_split_slot(page_t *page, page_zip_des_t *page_zip, ulint slot_no) __attribute__((nonnull(1)))
UNIV_INTERN ibool UNIV_INTERN ibool page_move_rec_list_start(buf_block_t *new_block, buf_block_t *block, rec_t *split_rec, dict_index_t *index, mtr_t *mtr) __attribute__((nonnull(1
UNIV_INTERN ulint page_rec_get_n_recs_before(const rec_t *rec)
UNIV_INLINE ulint page_dir_get_n_slots(const page_t *page)
#define MLOG_COMP_LIST_END_DELETE
UNIV_INLINE void rec_set_n_owned_old(rec_t *rec, ulint n_owned)
UNIV_INLINE void page_cur_position(const rec_t *rec, const buf_block_t *block, page_cur_t *cur)
UNIV_INTERN void page_rec_write_index_page_no(rec_t *rec, ulint i, ulint page_no, mtr_t *mtr)
UNIV_INLINE ulint rec_get_n_owned_old(const rec_t *rec)
dict_index_t * dict_ind_redundant
UNIV_INLINE ibool page_rec_is_infimum_low(ulint offset) __attribute__((const ))