summaryrefslogtreecommitdiff
path: root/storage/innobase/fts/fts0fts.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/fts/fts0fts.cc')
-rw-r--r--storage/innobase/fts/fts0fts.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 35d3d0edd34..6d1ac1b9300 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
@@ -1298,6 +1298,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;
@@ -1324,6 +1327,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;
@@ -1331,10 +1337,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;
}