Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12888

Remove unused field dict_index_t::is_ngram

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: