diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-13 10:18:42 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-13 10:18:42 +0100 |
commit | 5b3c10078848260414663f542a007c36e2b7aae7 (patch) | |
tree | ec87cfac7cb5859e8e56dab12d239ff818e5117b /storage/innobase/btr | |
parent | 162399515813a4e23c8735473f9d2dd622a6679b (diff) | |
parent | e9eaaa4b4acdb8a72308953e30b39bc663c98d2b (diff) | |
download | mariadb-git-5b3c10078848260414663f542a007c36e2b7aae7.tar.gz |
Merge branch 'merge/merge-innodb-5.6' into 10.0
Diffstat (limited to 'storage/innobase/btr')
-rw-r--r-- | storage/innobase/btr/btr0btr.cc | 20 | ||||
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 4 |
2 files changed, 21 insertions, 3 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 79b533481b7..99bb42466d0 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -2101,7 +2101,7 @@ the tuple. It is assumed that mtr contains an x-latch on the tree. NOTE that the operation of this function must always succeed, we cannot reverse it: therefore enough free disk space must be guaranteed to be available before this function is called. -@return inserted record */ +@return inserted record or NULL if run out of space */ UNIV_INTERN rec_t* btr_root_raise_and_insert( @@ -2162,6 +2162,11 @@ btr_root_raise_and_insert( level = btr_page_get_level(root, mtr); new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, mtr, mtr); + + if (new_block == NULL && os_has_said_disk_full) { + return(NULL); + } + new_page = buf_block_get_frame(new_block); new_page_zip = buf_block_get_page_zip(new_block); ut_a(!new_page_zip == !root_page_zip); @@ -2938,7 +2943,7 @@ function must always succeed, we cannot reverse it: therefore enough free disk space (2 pages) must be guaranteed to be available before this function is called. -@return inserted record */ +@return inserted record or NULL if run out of space */ UNIV_INTERN rec_t* btr_page_split_and_insert( @@ -3052,9 +3057,18 @@ func_start: } } + DBUG_EXECUTE_IF("disk_is_full", + os_has_said_disk_full = true; + return(NULL);); + /* 2. Allocate a new page to the index */ new_block = btr_page_alloc(cursor->index, hint_page_no, direction, btr_page_get_level(page, mtr), mtr, mtr); + + if (new_block == NULL && os_has_said_disk_full) { + return(NULL); + } + new_page = buf_block_get_frame(new_block); new_page_zip = buf_block_get_page_zip(new_block); btr_page_create(new_block, new_page_zip, cursor->index, diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 7dfcd79cfdb..c60542af3f8 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1605,6 +1605,10 @@ btr_cur_pessimistic_insert( flags, cursor, offsets, heap, entry, n_ext, mtr); } + if (*rec == NULL && os_has_said_disk_full) { + return(DB_OUT_OF_FILE_SPACE); + } + ut_ad(page_rec_get_next(btr_cur_get_rec(cursor)) == *rec); if (!(flags & BTR_NO_LOCKING_FLAG)) { |