791
791
/* It is a non-ibuf tree: create a file segment for leaf
793
if (!fseg_create(space, page_no,
794
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
795
/* Not enough space for new segment, free root
796
segment before return. */
797
btr_free_root(space, zip_size, page_no, mtr);
793
fseg_create(space, page_no,
794
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr);
802
795
/* The fseg create acquires a second latch on the page,
803
796
therefore we must declare it: */
804
797
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
1018
1011
(!page_zip_compress(page_zip, page, index, NULL))) {
1020
1013
/* Restore the old page and exit. */
1022
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
1023
/* Check that the bytes that we skip are identical. */
1024
ut_a(!memcmp(page, temp_page, PAGE_HEADER));
1025
ut_a(!memcmp(PAGE_HEADER + PAGE_N_RECS + page,
1026
PAGE_HEADER + PAGE_N_RECS + temp_page,
1027
PAGE_DATA - (PAGE_HEADER + PAGE_N_RECS)));
1028
ut_a(!memcmp(UNIV_PAGE_SIZE - FIL_PAGE_DATA_END + page,
1029
UNIV_PAGE_SIZE - FIL_PAGE_DATA_END + temp_page,
1030
FIL_PAGE_DATA_END));
1031
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
1033
memcpy(PAGE_HEADER + page, PAGE_HEADER + temp_page,
1034
PAGE_N_RECS - PAGE_N_DIR_SLOTS);
1035
memcpy(PAGE_DATA + page, PAGE_DATA + temp_page,
1036
UNIV_PAGE_SIZE - PAGE_DATA - FIL_PAGE_DATA_END);
1038
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
1039
ut_a(!memcmp(page, temp_page, UNIV_PAGE_SIZE));
1040
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
1014
buf_frame_copy(page, temp_page);
1042
1016
goto func_exit;