Commit 409112e4 authored by jyang's avatar jyang

branches/5.1: Fix bug #48469 "when innodb tablespace is

configured too small, crash and corruption!". Function
btr_create() did not check the return status of fseg_create(),
and continue the index creation even there is no sufficient
space.

rb://205 Approved by Marko
parent 56526769
......@@ -709,8 +709,16 @@ btr_create(
} else {
/* It is a non-ibuf tree: create a file segment for leaf
pages */
fseg_create(space, page_no, PAGE_HEADER + PAGE_BTR_SEG_LEAF,
mtr);
if (!fseg_create(space, page_no,
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
/* Not enough space for new segment, free root
segment before return. */
fseg_free(space, page_no,
PAGE_HEADER + PAGE_BTR_SEG_TOP);
return(FIL_NULL);
}
/* The fseg create acquires a second latch on the page,
therefore we must declare it: */
#ifdef UNIV_SYNC_DEBUG
......
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