summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-04-04 09:56:52 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-04-04 09:57:26 +0530
commit4266da8e784d8683f5b6c8aadec0bb858767b948 (patch)
tree0b79715db039fe783625bf440479b53cdc5deee9
parentd48774e0e042675d21de51659417cb738e41a0a7 (diff)
downloadmariadb-git-bb-10.7-MDEV-28138.tar.gz
MDEV-28138 MariaDB Assertion Failed in mtr_buf_t::has_spacebb-10.7-MDEV-28138
- After MDEV-24621, InnoDB does buffer the insert bulk operation for all indexes expect spatial one. But it leads to search the primary key lookup and it leads to failure. So InnoDB should avoid bulk insert when table has spatial index involved.
-rw-r--r--storage/innobase/include/dict0mem.h12
-rw-r--r--storage/innobase/row/row0ins.cc3
2 files changed, 14 insertions, 1 deletions
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 0b690bb865e..9bccd6b2afa 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -2382,6 +2382,18 @@ public:
static dict_table_t *create(const span<const char> &name, fil_space_t *space,
ulint n_cols, ulint n_v_cols, ulint flags,
ulint flags2);
+
+ /** Check whether the table has any spatial indexes */
+ bool has_spatial_index()
+ {
+ for (auto i= UT_LIST_GET_FIRST(indexes);
+ (i= UT_LIST_GET_NEXT(indexes, i)) != nullptr; )
+ {
+ if (i->type & DICT_SPATIAL)
+ return true;
+ }
+ return false;
+ }
};
inline void dict_index_t::set_modified(mtr_t& mtr) const
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 1967ec42154..0db0ffdd094 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -2638,7 +2638,8 @@ commit_exit:
&& !index->table->skip_alter_undo
&& !index->table->n_rec_locks
&& !trx->is_wsrep() /* FIXME: MDEV-24623 */
- && !thd_is_slave(trx->mysql_thd) /* FIXME: MDEV-24622 */) {
+ && !thd_is_slave(trx->mysql_thd) /* FIXME: MDEV-24622 */
+ && !index->table->has_spatial_index()) {
DEBUG_SYNC_C("empty_root_page_insert");
trx->bulk_insert = true;