Description:
After altering the `innodb_ft_enable_stopword` flag, dropping and recreating a full-text in a single alter table statement will fail to update the 'use_stopword' flag.
How to repeat:
CREATE TABLE test (id INT, name VARCHAR(255));
SET innodb_ft_enable_stopword = 1;
ALTER TABLE test
    ADD FULLTEXT INDEX name_fti (name) WITH PARSER ngram;
SET GLOBAL innodb_ft_aux_table= '<snip>/test';
SELECT value FROM information_schema.INNODB_FT_CONFIG where `key`='use_stopword';
-- returns 1
SET innodb_ft_enable_stopword = 0;
ALTER TABLE test
    DROP INDEX name_fti,
    ADD FULLTEXT INDEX name_fti (name) WITH PARSER ngram;
SELECT value FROM information_schema.INNODB_FT_CONFIG where `key`='use_stopword';
-- returns 1
ALTER TABLE test
    DROP INDEX name_fti;
ALTER TABLE test
    ADD FULLTEXT INDEX name_fti (name) WITH PARSER ngram;
SELECT value FROM information_schema.INNODB_FT_CONFIG where `key`='use_stopword';
-- returns 0
Suggested fix:
I suspect this is related to the following call chain prepare_inplace_alter_table_dict() -> innobase_fts_load_stopword() -> fts_load_stopword(reload=false)
Correct behavior would be to call fts_load_stopword(reload=true) in this case.
  
 
 
Description: After altering the `innodb_ft_enable_stopword` flag, dropping and recreating a full-text in a single alter table statement will fail to update the 'use_stopword' flag. How to repeat: CREATE TABLE test (id INT, name VARCHAR(255)); SET innodb_ft_enable_stopword = 1; ALTER TABLE test ADD FULLTEXT INDEX name_fti (name) WITH PARSER ngram; SET GLOBAL innodb_ft_aux_table= '<snip>/test'; SELECT value FROM information_schema.INNODB_FT_CONFIG where `key`='use_stopword'; -- returns 1 SET innodb_ft_enable_stopword = 0; ALTER TABLE test DROP INDEX name_fti, ADD FULLTEXT INDEX name_fti (name) WITH PARSER ngram; SELECT value FROM information_schema.INNODB_FT_CONFIG where `key`='use_stopword'; -- returns 1 ALTER TABLE test DROP INDEX name_fti; ALTER TABLE test ADD FULLTEXT INDEX name_fti (name) WITH PARSER ngram; SELECT value FROM information_schema.INNODB_FT_CONFIG where `key`='use_stopword'; -- returns 0 Suggested fix: I suspect this is related to the following call chain prepare_inplace_alter_table_dict() -> innobase_fts_load_stopword() -> fts_load_stopword(reload=false) Correct behavior would be to call fts_load_stopword(reload=true) in this case.