[MDEV-12888] Remove unused field dict_index_t::is_ngram Created: 2017-05-24  Updated: 2017-05-26  Resolved: 2017-05-26

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.2
Fix Version/s: 10.2.7

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: plugins

Issue Links:
PartOf
is part of MDEV-12358 GCC 7 issues Closed
Relates
relates to MDEV-11649 Uninitialized field fts_token->positi... Closed

 Description   

When MySQL 5.7 introduced fulltext parser plugins to InnoDB, it hard-coded the plugin name "ngram" to mean something special, causing the field dict_index_t::is_ngram to be set.

Because -fsanitize=undefined was issuing warnings for the assignment in row_merge_create_index() that the value for dict_index_t::is_ngram out of range for Boolean, I would prefer to remove the field altogether.

As part of this, I made an honest attempt to import plugin/fulltext from MySQL 5.7 to MariaDB 10.2. This would result in some errors due to API mismatch:

/mariadb/10.2/plugin/fulltext/ngram_parser/plugin_ngram.cc:59:14: error: use of
      undeclared identifier 'my_mbcharlen_ptr'; did you mean 'my_charlen_fix'?
                char_len = my_mbcharlen_ptr(cs, next, end);
                           ^~~~~~~~~~~~~~~~
                           my_charlen_fix
/mariadb/10.2/include/m_ctype.h:1077:6: note: 'my_charlen_fix' declared here
uint my_charlen_fix(CHARSET_INFO *cs, const char *str, const char *end)
     ^
/mariadb/10.2/plugin/fulltext/ngram_parser/plugin_ngram.cc:80:15: error: no
      member named 'position' in 'st_mysql_ftparser_boolean_info'
                        bool_info->position = start - doc;
                        ~~~~~~~~~  ^

The second one is for the field MYSQL_FTPARSER_BOOLEAN_INFO::position that was added as part of WL#6943, changing the fulltext parser plugin API and ABI in MySQL 5.7.

Also the other InnoDB fulltext parser plugin plugin/fulltext/mecab_parser/plugin_mecab.cc is filling in MYSQL_FTPARSER_BOOLEAN_INFO::position in mecab_parse().

Based on this, the InnoDB fulltext parser plugins are not directly usable with MariaDB 10.2 and we can safely remove the dict_index_t::is_ngram field and possibly revert some other WL#6943 changes.



 Comments   
Comment by Marko Mäkelä [ 2017-05-24 ]

Please follow up to the existing review that was created as part of MDEV-12358.

Comment by Jan Lindström (Inactive) [ 2017-05-26 ]

ok to push.

Generated at Thu Feb 08 08:01:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.