summaryrefslogtreecommitdiff
path: root/storage/innobase/btr/btr0cur.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-10-18 09:05:27 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-10-18 09:05:27 +0300
commit0b9cee2cbfe6bce17dca980764076c65e14513f5 (patch)
treeb7bed7be09af6318bb1f7d6c1ebafee83c1ac8b4 /storage/innobase/btr/btr0cur.cc
parentde2186dd2f5937a56d799f55c33078a7ad8ebddc (diff)
parentfa929f7cdf71e351a64639815d84ae5d4f3dc053 (diff)
downloadmariadb-git-0b9cee2cbfe6bce17dca980764076c65e14513f5.tar.gz
Merge 10.2 into 10.3
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 87eb8b678a4..2e2f536afb2 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -7206,7 +7206,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));
@@ -7229,8 +7229,7 @@ struct btr_blob_log_check_t {
index->set_modified(*m_mtr);
m_mtr->set_flush_observer(observer);
- if (m_op == BTR_STORE_INSERT_BULK) {
- mtr_x_lock(dict_index_get_lock(index), m_mtr);
+ if (UNIV_UNLIKELY(m_op == BTR_STORE_INSERT_BULK)) {
m_pcur->btr_cur.page_cur.block = btr_block_get(
page_id_t(index->table->space_id, page_no),
page_size_t(index->table->space->flags),
@@ -7259,9 +7258,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));
}
};
@@ -7315,8 +7315,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_memo_contains(btr_mtr, rec_block, MTR_MEMO_PAGE_X_FIX));
ut_ad(buf_block_get_frame(rec_block) == page_align(rec));
ut_a(dict_index_is_clust(index));
@@ -7441,7 +7443,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_bulk.start();
mtr_bulk.set_spaces(mtr);
alloc_mtr = &mtr_bulk;
@@ -7464,7 +7466,7 @@ btr_store_big_rec_extern_fields(
index->table->space->release_free_extents(r_extents);
- if (op == BTR_STORE_INSERT_BULK) {
+ if (UNIV_UNLIKELY(op == BTR_STORE_INSERT_BULK)) {
mtr_bulk.commit();
}
@@ -7620,7 +7622,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);