summaryrefslogtreecommitdiff
path: root/storage/innobase/btr/btr0cur.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-10-17 17:08:58 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-10-17 17:08:58 +0300
commitb0278302327ee46715107ce1f9d3e7c3da0c3ba5 (patch)
tree43b3dfc702850ff1dc96055d16b83a1650101847 /storage/innobase/btr/btr0cur.cc
parent3ce14a66efc69a4ed9903ce121f5b0e9f469b12b (diff)
parentfa32d28f2f665f41aa2aad1c47ca49236a34d31d (diff)
downloadmariadb-git-b0278302327ee46715107ce1f9d3e7c3da0c3ba5.tar.gz
MDEV-20850 Merge new release of InnoDB 5.7.28 to 10.2
Diffstat (limited to 'storage/innobase/btr/btr0cur.cc')
-rw-r--r--storage/innobase/btr/btr0cur.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 788b34bca62..8c9693bea47 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -6775,7 +6775,7 @@ struct btr_blob_log_check_t {
ulint page_no = ULINT_UNDEFINED;
FlushObserver* observer = m_mtr->get_flush_observer();
- if (m_op == BTR_STORE_INSERT_BULK) {
+ if (UNIV_UNLIKELY(m_op == BTR_STORE_INSERT_BULK)) {
offs = page_offset(*m_rec);
page_no = page_get_page_no(
buf_block_get_frame(*m_block));
@@ -6798,14 +6798,13 @@ struct btr_blob_log_check_t {
m_mtr->set_named_space(index->space);
m_mtr->set_flush_observer(observer);
- if (m_op == BTR_STORE_INSERT_BULK) {
+ if (UNIV_UNLIKELY(m_op == BTR_STORE_INSERT_BULK)) {
page_id_t page_id(dict_index_get_space(index),
page_no);
page_size_t page_size(dict_table_page_size(
index->table));
page_cur_t* page_cur = &m_pcur->btr_cur.page_cur;
- mtr_x_lock(dict_index_get_lock(index), m_mtr);
page_cur->block = btr_block_get(
page_id, page_size, RW_X_LATCH, index, m_mtr);
page_cur->rec = buf_block_get_frame(page_cur->block)
@@ -6831,9 +6830,10 @@ struct btr_blob_log_check_t {
*m_rec,
MTR_MEMO_PAGE_X_FIX | MTR_MEMO_PAGE_SX_FIX));
- ut_ad(mtr_memo_contains_flagged(m_mtr,
- dict_index_get_lock(index),
- MTR_MEMO_SX_LOCK | MTR_MEMO_X_LOCK));
+ ut_ad((m_op == BTR_STORE_INSERT_BULK)
+ == !mtr_memo_contains_flagged(m_mtr, &index->lock,
+ MTR_MEMO_SX_LOCK
+ | MTR_MEMO_X_LOCK));
}
};
@@ -6887,8 +6887,10 @@ btr_store_big_rec_extern_fields(
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(rec_offs_any_extern(offsets));
- ut_ad(mtr_memo_contains_flagged(btr_mtr, dict_index_get_lock(index),
- MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK));
+ ut_ad(op == BTR_STORE_INSERT_BULK
+ || mtr_memo_contains_flagged(btr_mtr, &index->lock,
+ MTR_MEMO_X_LOCK
+ | MTR_MEMO_SX_LOCK));
ut_ad(mtr_is_block_fix(
btr_mtr, rec_block, MTR_MEMO_PAGE_X_FIX, index->table));
ut_ad(buf_block_get_frame(rec_block) == page_align(rec));
@@ -7014,7 +7016,7 @@ btr_store_big_rec_extern_fields(
mtr_t *alloc_mtr;
- if (op == BTR_STORE_INSERT_BULK) {
+ if (UNIV_UNLIKELY(op == BTR_STORE_INSERT_BULK)) {
mtr_start(&mtr_bulk);
mtr_bulk.set_spaces(mtr);
alloc_mtr = &mtr_bulk;
@@ -7036,7 +7038,7 @@ btr_store_big_rec_extern_fields(
alloc_mtr->release_free_extents(r_extents);
- if (op == BTR_STORE_INSERT_BULK) {
+ if (UNIV_UNLIKELY(op == BTR_STORE_INSERT_BULK)) {
mtr_commit(&mtr_bulk);
}
@@ -7192,7 +7194,7 @@ btr_store_big_rec_extern_fields(
}
/* We compress a page when finish bulk insert.*/
- if (op != BTR_STORE_INSERT_BULK) {
+ if (UNIV_LIKELY(op != BTR_STORE_INSERT_BULK)) {
page_zip_write_blob_ptr(
page_zip, rec, index, offsets,
field_no, &mtr);