summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-03-28 15:25:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2023-03-28 15:25:52 +0300
commit0760ad3336521b85454b522390eb972a606def23 (patch)
treede6d7b7bc9923884b8095e4e5aa7ba17c68da27d /storage
parent216d99bb395c4fda43b4e3583672ef925103fae5 (diff)
parent402f36dd652b57a48d2d3e18949f5d7a1450363d (diff)
downloadmariadb-git-0760ad3336521b85454b522390eb972a606def23.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/dict/dict0dict.cc4
-rw-r--r--storage/innobase/dict/dict0load.cc3
-rw-r--r--storage/innobase/dict/dict0mem.cc2
-rw-r--r--storage/innobase/fts/fts0fts.cc23
-rw-r--r--storage/innobase/handler/ha_innodb.cc3
-rw-r--r--storage/innobase/handler/handler0alter.cc6
-rw-r--r--storage/innobase/include/fts0fts.h8
-rw-r--r--storage/innobase/include/row0ins.h1
-rw-r--r--storage/innobase/que/que0que.cc13
-rw-r--r--storage/innobase/row/row0merge.cc3
10 files changed, 20 insertions, 46 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 53d1031d270..d1c719d2090 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1922,8 +1922,8 @@ void dict_sys_t::remove(dict_table_t* table, bool lru, bool keep)
#ifdef BTR_CUR_HASH_ADAPT
if (table->fts) {
fts_optimize_remove_table(table);
- fts_free(table);
- table->fts = NULL;
+ table->fts->~fts_t();
+ table->fts = nullptr;
}
table->autoinc_mutex.wr_lock();
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 9910a000b5b..129a2539341 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -2527,7 +2527,8 @@ corrupted:
/* the table->fts could be created in dict_load_column
when a user defined FTS_DOC_ID is present, but no
FTS */
- fts_free(table);
+ table->fts->~fts_t();
+ table->fts = nullptr;
} else if (fts_optimize_wq) {
fts_optimize_add_table(table);
} else if (table->can_be_evicted) {
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index c18cfd28e62..59189d3e053 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -212,7 +212,7 @@ dict_mem_table_free(
|| DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID)
|| DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_ADD_DOC_ID)) {
if (table->fts) {
- fts_free(table);
+ table->fts->~fts_t();
}
}
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 9afbd8604a0..eed2eb72cd1 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -826,7 +826,8 @@ void fts_clear_all(dict_table_t *table)
fts_optimize_remove_table(table);
- fts_free(table);
+ table->fts->~fts_t();
+ table->fts= nullptr;
DICT_TF2_FLAG_UNSET(table, DICT_TF2_FTS);
}
@@ -5154,14 +5155,14 @@ fts_t::~fts_t()
{
ut_ad(add_wq == NULL);
- if (cache != NULL) {
+ if (cache) {
fts_cache_clear(cache);
fts_cache_destroy(cache);
- cache = NULL;
}
/* There is no need to call ib_vector_free() on this->indexes
because it is stored in this->fts_heap. */
+ mem_heap_free(fts_heap);
}
/*********************************************************************//**
@@ -5185,22 +5186,6 @@ fts_create(
}
/*********************************************************************//**
-Free the FTS resources. */
-void
-fts_free(
-/*=====*/
- dict_table_t* table) /*!< in/out: table with FTS indexes */
-{
- fts_t* fts = table->fts;
-
- fts->~fts_t();
-
- mem_heap_free(fts->fts_heap);
-
- table->fts = NULL;
-}
-
-/*********************************************************************//**
Take a FTS savepoint. */
UNIV_INLINE
void
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index cac20c70e02..c6a515b21d3 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -12801,7 +12801,8 @@ int create_table_info_t::create_table(bool create_fk)
m_table->name.m_name);
if (m_table->fts) {
- fts_free(m_table);
+ m_table->fts->~fts_t();
+ m_table->fts = nullptr;
}
my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0),
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 6a8986d76d2..7e4beeede3b 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1180,7 +1180,8 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
old_v_cols[i].~dict_v_col_t();
}
if (instant_table->fts) {
- fts_free(instant_table);
+ instant_table->fts->~fts_t();
+ instant_table->fts = nullptr;
}
dict_mem_table_free(instant_table);
}
@@ -8894,7 +8895,8 @@ innobase_rollback_sec_index(
&& !DICT_TF2_FLAG_IS_SET(user_table,
DICT_TF2_FTS_HAS_DOC_ID)
&& !innobase_fulltext_exist(table)) {
- fts_free(user_table);
+ user_table->fts->~fts_t();
+ user_table->fts = nullptr;
}
}
diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h
index 0a821647dab..720fe7f25b9 100644
--- a/storage/innobase/include/fts0fts.h
+++ b/storage/innobase/include/fts0fts.h
@@ -610,14 +610,6 @@ fts_create(
dict_table_t* table); /*!< out: table with FTS
indexes */
-/**********************************************************************//**
-Free the FTS resources. */
-void
-fts_free(
-/*=====*/
- dict_table_t* table); /*!< in/out: table with
- FTS indexes */
-
/*********************************************************************//**
Run OPTIMIZE on the given table.
@return DB_SUCCESS if all OK */
diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h
index 517319e5b13..ac2479c4863 100644
--- a/storage/innobase/include/row0ins.h
+++ b/storage/innobase/include/row0ins.h
@@ -177,6 +177,7 @@ struct ins_node_t
trx_id(0), entry_sys_heap(mem_heap_create(128))
{
}
+ ~ins_node_t() { mem_heap_free(entry_sys_heap); }
que_common_t common; /*!< node type: QUE_NODE_INSERT */
ulint ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */
dtuple_t* row; /*!< row to insert */
diff --git a/storage/innobase/que/que0que.cc b/storage/innobase/que/que0que.cc
index 5f5f527e06b..d910ee2a881 100644
--- a/storage/innobase/que/que0que.cc
+++ b/storage/innobase/que/que0que.cc
@@ -236,9 +236,9 @@ que_graph_free_stat_list(
que_node_t* node) /*!< in: first query graph node in the list */
{
while (node) {
+ que_node_t* next = que_node_get_next(node);
que_graph_free_recursive(node);
-
- node = que_node_get_next(node);
+ node = next;
}
}
@@ -297,19 +297,10 @@ que_graph_free_recursive(
break;
case QUE_NODE_INSERT:
-
ins = static_cast<ins_node_t*>(node);
que_graph_free_recursive(ins->select);
- ins->select = NULL;
-
ins->~ins_node_t();
-
- if (ins->entry_sys_heap != NULL) {
- mem_heap_free(ins->entry_sys_heap);
- ins->entry_sys_heap = NULL;
- }
-
break;
case QUE_NODE_PURGE:
purge = static_cast<purge_node_t*>(node);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 535762ee105..70b51fbb812 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -3833,7 +3833,8 @@ static void row_merge_drop_fulltext_indexes(trx_t *trx, dict_table_t *table)
fts_optimize_remove_table(table);
fts_drop_tables(trx, *table);
- fts_free(table);
+ table->fts->~fts_t();
+ table->fts= nullptr;
DICT_TF2_FLAG_UNSET(table, DICT_TF2_FTS);
}