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.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index ae270bf72b2..faf598ddd72 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -3314,7 +3314,7 @@ fts_add_doc_by_id(
dict_index_t* fts_id_index;
ibool is_id_cluster;
fts_cache_t* cache = ftt->table->fts->cache;
-
+ bool need_sync= false;
ut_ad(cache->get_docs);
/* If Doc ID has been supplied by the user, then the table
@@ -3443,7 +3443,7 @@ fts_add_doc_by_id(
shouldn't hold the cache lock for
longer time. So cache should sync
whenever cache size exceeds 512 KB */
- bool need_sync =
+ need_sync =
cache->total_size > 512*1024;
mysql_mutex_unlock(&table->fts->cache->lock);
@@ -3464,10 +3464,6 @@ fts_add_doc_by_id(
need_sync= true;
);
- if (need_sync) {
- fts_sync_table(table);
- }
-
mtr_start(&mtr);
if (i < num_idx - 1) {
@@ -3493,6 +3489,10 @@ func_exit:
ut_free(pcur.old_rec_buf);
mem_heap_free(heap);
+
+ if (need_sync) {
+ fts_sync_table(table);
+ }
}
@@ -3898,6 +3898,7 @@ err_exit:
ib::error() << "(" << error << ") writing"
" word node to FTS auxiliary index table "
<< table->name;
+ break;
}
}
@@ -3999,6 +4000,7 @@ fts_sync_commit(
mysql_mutex_unlock(&cache->lock);
fts_sql_commit(trx);
} else {
+ mysql_mutex_unlock(&cache->lock);
fts_sql_rollback(trx);
ib::error() << "(" << error << ") during SYNC of "
"table " << sync->table->name;