summaryrefslogtreecommitdiff
path: root/storage/innobase/btr
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-06-08 12:45:08 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-06-08 12:45:08 +0300
commit2d8fdfbde5d5d32df64bacfaa7574ecf83b0bc03 (patch)
treecea7cfc27b7f5c3c9d116a82330fef01350b08f4 /storage/innobase/btr
parentc4cbc7a8807250d2d5b5938b218fd9c423a0b30a (diff)
parentfbeb9489cd7d6ad859a49ae5ab8f876f3d988470 (diff)
downloadmariadb-git-2d8fdfbde5d5d32df64bacfaa7574ecf83b0bc03.tar.gz
Merge 10.1 into 10.2
Replace have_innodb_zip.inc with innodb_page_size_small.inc.
Diffstat (limited to 'storage/innobase/btr')
-rw-r--r--storage/innobase/btr/btr0btr.cc37
1 files changed, 15 insertions, 22 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 3d778c49012..d0fcd68c677 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -1133,9 +1133,7 @@ btr_create(
const btr_create_t* btr_redo_create_info,
mtr_t* mtr)
{
- ulint page_no;
buf_block_t* block;
- buf_frame_t* frame;
page_t* page;
page_zip_des_t* page_zip;
@@ -1170,33 +1168,28 @@ btr_create(
+ IBUF_HEADER + IBUF_TREE_SEG_HEADER,
IBUF_TREE_ROOT_PAGE_NO,
FSP_UP, mtr);
- ut_ad(block->page.id.page_no() == IBUF_TREE_ROOT_PAGE_NO);
- } else {
- block = fseg_create(space, 0,
- PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
- }
- if (block == NULL) {
-
- return(FIL_NULL);
- }
+ if (block == NULL) {
+ return(FIL_NULL);
+ }
- page_no = block->page.id.page_no();
- frame = buf_block_get_frame(block);
+ ut_ad(block->page.id.page_no() == IBUF_TREE_ROOT_PAGE_NO);
- if (type & DICT_IBUF) {
- /* It is an insert buffer tree: initialize the free list */
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
- ut_ad(page_no == IBUF_TREE_ROOT_PAGE_NO);
-
- flst_init(frame + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST, mtr);
+ flst_init(block->frame + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
+ mtr);
} else {
- /* It is a non-ibuf tree: create a file segment for leaf
- pages */
+ block = fseg_create(space, 0,
+ PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
+
+ if (block == NULL) {
+ return(FIL_NULL);
+ }
+
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
- if (!fseg_create(space, page_no,
+ if (!fseg_create(space, block->page.id.page_no(),
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
/* Not enough space for new segment, free root
segment before return. */
@@ -1287,7 +1280,7 @@ btr_create(
ut_ad(page_get_max_insert_size(page, 2) > 2 * BTR_PAGE_MAX_REC_SIZE);
- return(page_no);
+ return(block->page.id.page_no());
}
/** Free a B-tree except the root page. The root page MUST be freed after