Skip to content
Permalink
Browse files
MDEV-18637 Assertion `cache' failed in fts_init_recover_doc
I know no test case for this bug in 10.1. So a test case will be
committed separately in 10.2

fts_reset_get_doc(): properly initialize fts_get_doc_t::cache
  • Loading branch information
dr-m committed Mar 6, 2019
1 parent 4b5dc47 commit 485dcb0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2018, MariaDB Corporation.
Copyright (c) 2016, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -736,6 +736,7 @@ fts_reset_get_doc(
memset(get_doc, 0x0, sizeof(*get_doc));

get_doc->index_cache = ind_cache;
get_doc->cache = cache;
}

ut_ad(ib_vector_size(cache->get_docs)
@@ -4801,8 +4802,9 @@ fts_tokenize_document(
ut_a(!doc->tokens);
ut_a(doc->charset);

doc->tokens = rbt_create_arg_cmp(
sizeof(fts_token_t), innobase_fts_text_cmp, (void*) doc->charset);
doc->tokens = rbt_create_arg_cmp(sizeof(fts_token_t),
innobase_fts_text_cmp,
(void*) doc->charset);

for (ulint i = 0; i < doc->text.f_len; i += inc) {
inc = fts_process_token(doc, result, i, 0);
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2018, MariaDB Corporation.
Copyright (c) 2016, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -567,7 +567,7 @@ fts_index_cache_init(

index_cache->words = rbt_create_arg_cmp(
sizeof(fts_tokenizer_word_t), innobase_fts_text_cmp,
(void*)index_cache->charset);
(void*) index_cache->charset);

ut_a(index_cache->doc_stats == NULL);

@@ -736,6 +736,7 @@ fts_reset_get_doc(
memset(get_doc, 0x0, sizeof(*get_doc));

get_doc->index_cache = ind_cache;
get_doc->cache = cache;
}

ut_ad(ib_vector_size(cache->get_docs)
@@ -2004,7 +2005,8 @@ fts_create_one_index_table(
dict_mem_table_add_col(new_table, heap, "ilist", DATA_BLOB,
4130048, 0);

error = row_create_table_for_mysql(new_table, trx, false, FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY);
error = row_create_table_for_mysql(new_table, trx, false,
FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY);

if (error != DB_SUCCESS) {
trx->error_state = error;
@@ -4800,8 +4802,9 @@ fts_tokenize_document(
ut_a(!doc->tokens);
ut_a(doc->charset);

doc->tokens = rbt_create_arg_cmp(
sizeof(fts_token_t), innobase_fts_text_cmp, (void*) doc->charset);
doc->tokens = rbt_create_arg_cmp(sizeof(fts_token_t),
innobase_fts_text_cmp,
(void*) doc->charset);

for (ulint i = 0; i < doc->text.f_len; i += inc) {
inc = fts_process_token(doc, result, i, 0);

0 comments on commit 485dcb0

Please sign in to comment.