summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-10-21 12:39:15 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-10-21 12:39:15 +0530
commit0ba5859324b9884d26db6b0024e73aec2c93359a (patch)
tree80a258ae3ac98eeb3031d34eaf8a0ddcf1b9f290
parent9c9ccd7ac62c30c868447e5db1bfbfd69fa824f4 (diff)
downloadmariadb-git-preview-10.7-MDEV-24621-innodb-bulk-insert.tar.gz
Fixup: Added UNIV_LIKELY(bulk_insert) IN bulk_insert_apply().preview-10.7-MDEV-24621-innodb-bulk-insert
row_merge_bulk_t::write_to_index(): Assign nullptr when the files are not created.
-rw-r--r--storage/innobase/include/trx0trx.h2
-rw-r--r--storage/innobase/row/row0merge.cc3
2 files changed, 3 insertions, 2 deletions
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index b2fe4266e7b..83fe07a48a4 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -1092,7 +1092,7 @@ public:
@return DB_SUCCESS or error code */
dberr_t bulk_insert_apply()
{
- if (!bulk_insert)
+ if (UNIV_LIKELY(!bulk_insert))
return DB_SUCCESS;
ut_ad(!check_unique_secondary);
ut_ad(!check_foreigns);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index adb3a3f4c49..6b3f0820d32 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -5156,7 +5156,8 @@ dberr_t row_merge_bulk_t::write_to_index(ulint index_no, trx_t *trx)
{
dberr_t err= DB_SUCCESS;
row_merge_buf_t buf= m_merge_buf[index_no];
- merge_file_t *file= &m_merge_files[index_no];
+ merge_file_t *file= m_merge_files ?
+ &m_merge_files[index_no] : nullptr;
dict_index_t *index= buf.index;
dict_table_t *table= index->table;
BtrBulk btr_bulk(index, trx);