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.cc49
1 files changed, 13 insertions, 36 deletions
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index dbfd37544e6..cc0a41042af 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -370,7 +370,7 @@ fts_load_default_stopword(
new_word.nodes = ib_vector_create(
allocator, sizeof(fts_node_t), 4);
- str.f_len = ut_strlen(word);
+ str.f_len = strlen(word);
str.f_str = reinterpret_cast<byte*>(word);
fts_string_dup(&new_word.text, &str, heap);
@@ -847,17 +847,8 @@ fts_drop_index(
doc_id_t current_doc_id;
doc_id_t first_doc_id;
- /* If we are dropping the only FTS index of the table,
- remove it from optimize thread */
- fts_optimize_remove_table(table);
-
DICT_TF2_FLAG_UNSET(table, DICT_TF2_FTS);
- while (index->index_fts_syncing
- && !trx_is_interrupted(trx)) {
- DICT_BG_YIELD(trx);
- }
-
current_doc_id = table->fts->cache->next_doc_id;
first_doc_id = table->fts->cache->first_doc_id;
fts_cache_clear(table->fts->cache);
@@ -874,10 +865,6 @@ fts_drop_index(
index_cache = fts_find_index_cache(cache, index);
if (index_cache != NULL) {
- while (index->index_fts_syncing
- && !trx_is_interrupted(trx)) {
- DICT_BG_YIELD(trx);
- }
if (index_cache->words) {
fts_words_free(index_cache->words);
rbt_free(index_cache->words);
@@ -1291,7 +1278,7 @@ fts_cache_node_add_positions(
} else if (new_size < 48) {
new_size = 48;
} else {
- new_size = (ulint)(1.2 * new_size);
+ new_size = new_size * 6 / 5;
}
ilist = static_cast<byte*>(ut_malloc_nokey(new_size));
@@ -1447,7 +1434,7 @@ fts_drop_table(
dict_table_close(table, TRUE, FALSE);
- /* Pass nonatomic=false (dont allow data dict unlock),
+ /* Pass nonatomic=false (don't allow data dict unlock),
because the transaction may hold locks on SYS_* tables from
previous calls to fts_drop_table(). */
error = row_drop_table_for_mysql(table_name, trx,
@@ -4165,7 +4152,8 @@ fts_sync_commit(
<< ": SYNC time: "
<< (time(NULL) - sync->start_time)
<< " secs: elapsed "
- << (double) n_nodes / elapsed_time
+ << static_cast<double>(n_nodes)
+ / static_cast<double>(elapsed_time)
<< " ins/sec";
}
@@ -4293,8 +4281,6 @@ begin_sync:
DBUG_EXECUTE_IF("fts_instrument_sync_before_syncing",
os_thread_sleep(300000););
- index_cache->index->index_fts_syncing = true;
-
error = fts_sync_index(sync, index_cache);
if (error != DB_SUCCESS) {
@@ -4332,13 +4318,6 @@ end_sync:
}
rw_lock_x_lock(&cache->lock);
- /* Clear fts syncing flags of any indexes in case sync is
- interrupted */
- for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
- static_cast<fts_index_cache_t*>(
- ib_vector_get(cache->indexes, i))
- ->index->index_fts_syncing = false;
- }
sync->interrupted = false;
sync->in_progress = false;
@@ -4531,8 +4510,8 @@ fts_get_token_size(
int ctype;
int mbl;
- mbl = cs->cset->ctype(
- cs, &ctype,
+ mbl = cs->ctype(
+ &ctype,
reinterpret_cast<uchar*>(start),
reinterpret_cast<uchar*>(end));
@@ -5267,7 +5246,9 @@ fts_update_doc_id(
clust_index = dict_table_get_first_index(table);
- ufield->field_no = dict_col_get_clust_pos(col, clust_index);
+ ufield->field_no = static_cast<unsigned>(
+ dict_col_get_clust_pos(col, clust_index))
+ & dict_index_t::MAX_N_FIELDS;
dict_col_copy_type(col, dfield_get_type(&ufield->new_val));
/* It is possible we update record that has
@@ -5294,7 +5275,7 @@ fts_t::fts_t(
added_synced(0), dict_locked(0),
add_wq(NULL),
cache(NULL),
- doc_col(ULINT_UNDEFINED), in_queue(false),
+ doc_col(ULINT_UNDEFINED), in_queue(false), sync_message(false),
fts_heap(heap)
{
ut_a(table->fts == NULL);
@@ -5936,11 +5917,7 @@ fts_valid_stopword_table(
return(NULL);
} else {
- const char* col_name;
-
- col_name = dict_table_get_col_name(table, 0);
-
- if (ut_strcmp(col_name, "value")) {
+ if (strcmp(dict_table_get_col_name(table, 0), "value")) {
ib::error() << "Invalid column name for stopword"
" table " << stopword_table_name << ". Its"
" first column must be named as 'value'.";
@@ -6063,7 +6040,7 @@ fts_load_stopword(
if (!reload) {
str.f_n_char = 0;
str.f_str = (byte*) stopword_to_use;
- str.f_len = ut_strlen(stopword_to_use);
+ str.f_len = strlen(stopword_to_use);
error = fts_config_set_value(
trx, &fts_table, FTS_STOPWORD_TABLE_NAME, &str);