diff options
author | Satya B <satya.bn@sun.com> | 2009-11-30 14:20:08 +0530 |
---|---|---|
committer | Satya B <satya.bn@sun.com> | 2009-11-30 14:20:08 +0530 |
commit | b503432f67ed52538c452e0af62f06063577274c (patch) | |
tree | 7189865c306fbfbf3982a85b55ab187843e2794c /storage | |
parent | 5fc73d56dbc30762c204938094d1a1021ef44998 (diff) | |
download | mariadb-git-b503432f67ed52538c452e0af62f06063577274c.tar.gz |
Applying InnoDB snapshot 5.1-ss6242, part 3. Fixes BUG#48469
1. BUG#4869 - when innodb tablespace is configured too small,
crash and corruption!
Detailed revision comments:
r6187 | jyang | 2009-11-18 05:27:30 +0200 (Wed, 18 Nov 2009) | 9 lines
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
r6200 | vasil | 2009-11-19 12:14:23 +0200 (Thu, 19 Nov 2009) | 4 lines
branches/5.1:
White space fixup - indent under the opening (
r6203 | jyang | 2009-11-19 15:12:22 +0200 (Thu, 19 Nov 2009) | 8 lines
branches/5.1: Use btr_free_root() instead of fseg_free() for
the fix of bug #48469, because fseg_free() is not defined
in the zip branch. And we could save one mini-trasaction started
by fseg_free().
Approved by Marko.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/btr/btr0btr.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c index 6e8b43aeb8d..5e8831b5d5e 100644 --- a/storage/innobase/btr/btr0btr.c +++ b/storage/innobase/btr/btr0btr.c @@ -709,8 +709,15 @@ 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. */ + btr_free_root(space, page_no, mtr); + + return(FIL_NULL); + } + /* The fseg create acquires a second latch on the page, therefore we must declare it: */ #ifdef UNIV_SYNC_DEBUG |