--source include/have_innodb.inc CREATE TABLE `ngram_simple` ( `i` int(11) NOT NULL AUTO_INCREMENT, `txt` text COLLATE utf8mb4_bin NOT NULL, PRIMARY KEY (`i`), FULLTEXT KEY `fx_txts` (`txt`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; insert into ngram_simple (txt) values ('CompP&C01'); insert into ngram_simple (txt) values ('CompP&C02'); insert into ngram_simple (txt) values ('CompP&C03'); insert into ngram_simple (txt) values ('CompP&C04'); insert into ngram_simple (txt) values ('CompP&C05'); insert into ngram_simple (txt) values ('CompP&C06'); insert into ngram_simple (txt) values ('CompP&c04'); insert into ngram_simple (txt) values ('abc*efg'); insert into ngram_simple (txt) values ('abc&efg'); insert into ngram_simple (txt) values ('abC&Efg'); #set ft_query_extra_word_chars=1; select * from ngram_simple where match(txt) against ('abc' in boolean mode); select * from ngram_simple where match(txt) against ('abC' in boolean mode); select * from ngram_simple where match(txt) against ('C04' in boolean mode); select * from ngram_simple where match(txt) against ('c04' in boolean mode); alter table ngram_simple drop key fx_txts; alter table ngram_simple add FULLTEXT KEY `fx_txts` (`txt`) with parser ngram; optimize table ngram_simple; select * from ngram_simple where match(txt) against ('abc' in boolean mode); select * from ngram_simple where match(txt) against ('abC' in boolean mode); select * from ngram_simple where match(txt) against ('C04' in boolean mode); select * from ngram_simple where match(txt) against ('c04' in boolean mode); alter table ngram_simple drop key fx_txts; alter table ngram_simple add FULLTEXT KEY `fx_txts` (`txt`); optimize table ngram_simple; select * from ngram_simple where match(txt) against ('abc' in boolean mode); select * from ngram_simple where match(txt) against ('abC' in boolean mode); select * from ngram_simple where match(txt) against ('C04' in boolean mode); select * from ngram_simple where match(txt) against ('c04' in boolean mode);