diff options
author | Thirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com> | 2015-07-29 18:27:39 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com> | 2015-07-29 18:27:39 +0530 |
commit | 18b2c777803d97f9a798de7e0ff151b4afacbeb1 (patch) | |
tree | b610fabd8442eaebd87688d6c501a014f80a84c7 /storage/innobase | |
parent | 9cbd6d74f43252532034d585742efde46e358b60 (diff) | |
parent | 641ab6f36813516255738ba25d3c6b721189832e (diff) | |
download | mariadb-git-18b2c777803d97f9a798de7e0ff151b4afacbeb1.tar.gz |
Merge branch 'mysql-5.1' into mysql-5.5
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/btr/btr0cur.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 7762907b6aa..b573329c527 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -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) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -1995,6 +1995,7 @@ btr_cur_optimistic_update( ulint max_size; ulint new_rec_size; ulint old_rec_size; + ulint max_ins_size = 0; dtuple_t* new_entry; roll_ptr_t roll_ptr; trx_t* trx; @@ -2105,6 +2106,11 @@ any_extern: : (old_rec_size + page_get_max_insert_size_after_reorganize(page, 1)); + if (!page_zip) { + max_ins_size = page_get_max_insert_size_after_reorganize( + page, 1); + } + if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT) && (max_size >= new_rec_size)) || (page_get_n_recs(page) <= 1))) { @@ -2156,10 +2162,14 @@ any_extern: rec = btr_cur_insert_if_possible(cursor, new_entry, 0/*n_ext*/, mtr); ut_a(rec); /* <- We calculated above the insert would fit */ - if (page_zip && !dict_index_is_clust(index) + if (!dict_index_is_clust(index) && page_is_leaf(page)) { /* Update the free bits in the insert buffer. */ - ibuf_update_free_bits_zip(block, mtr); + if (page_zip) { + ibuf_update_free_bits_zip(block, mtr); + } else { + ibuf_update_free_bits_low(block, max_ins_size, mtr); + } } /* Restore the old explicit lock state on the record */ @@ -2268,6 +2278,7 @@ btr_cur_pessimistic_update( ulint n_reserved; ulint n_ext; ulint* offsets = NULL; + ulint max_ins_size = 0; *big_rec = NULL; @@ -2405,6 +2416,11 @@ make_external: ut_ad(flags & BTR_KEEP_POS_FLAG); } + if (!page_zip) { + max_ins_size = page_get_max_insert_size_after_reorganize( + page, 1); + } + /* Store state of explicit locks on rec on the page infimum record, before deleting rec. The page infimum acts as a dummy carrier of the locks, taking care also of lock releases, before we can move the locks @@ -2450,10 +2466,15 @@ make_external: big_rec_vec != NULL && (flags & BTR_KEEP_POS_FLAG), mtr); - if (page_zip && !dict_index_is_clust(index) + if (!dict_index_is_clust(index) && page_is_leaf(page)) { /* Update the free bits in the insert buffer. */ - ibuf_update_free_bits_zip(block, mtr); + if (page_zip) { + ibuf_update_free_bits_zip(block, mtr); + } else { + ibuf_update_free_bits_low(block, max_ins_size, + mtr); + } } err = DB_SUCCESS; |