diff options
Diffstat (limited to 'storage/innobase/fts/fts0fts.cc')
-rw-r--r-- | storage/innobase/fts/fts0fts.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index bdc6660c0a6..c8ecf4d7d1f 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2021, Oracle and/or its affiliates. Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -1285,6 +1285,9 @@ fts_cache_node_add_positions( ptr = ilist + node->ilist_size; node->ilist_size_alloc = new_size; + if (cache) { + cache->total_size += new_size; + } } ptr_start = ptr; @@ -1311,6 +1314,9 @@ fts_cache_node_add_positions( if (node->ilist_size > 0) { memcpy(ilist, node->ilist, node->ilist_size); ut_free(node->ilist); + if (cache) { + cache->total_size -= node->ilist_size; + } } node->ilist = ilist; @@ -1318,10 +1324,6 @@ fts_cache_node_add_positions( node->ilist_size += enc_len; - if (cache) { - cache->total_size += enc_len; - } - if (node->first_doc_id == FTS_NULL_DOC_ID) { node->first_doc_id = doc_id; } |