MDEV-22765 i_s_fts_index_cache_fill_one_index() is not protect by the lock

- i_s_fts_index_cache_fill() should take shared lock of fts cache
before accessing index cache to avoid reading stale data.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2020-07-14 14:26:49 +05:30
commit dc58987eb7
2 changed files with 6 additions and 0 deletions

View file

@ -3367,6 +3367,8 @@ no_fts:
conv_str.f_len = sizeof word;
conv_str.f_str = word;
rw_lock_s_lock(&cache->lock);
for (ulint i = 0; i < ib_vector_size(cache->indexes); i++) {
fts_index_cache_t* index_cache;
@ -3377,6 +3379,7 @@ no_fts:
index_cache, thd, &conv_str, tables));
}
rw_lock_s_unlock(&cache->lock);
dict_table_close(user_table, FALSE, FALSE);
rw_lock_s_unlock(&dict_operation_lock);