Mroonga blog

2019-07-30

Mroonga 9.05 has been released!

Mroonga is a MySQL storage engine that supports fast fulltext search and geolocation search. It is CJK ready. It uses Groonga as a storage and fulltext search engine.

Mroonga 9.05 has been released!

Changes

The main changes are as follows.

  • Added support for MySQL 5.6.45, 5.7.27 and 8.0.17
  • Fixed an unique index update bug which causes duplicated key error

Note that if you already created an unique index, you must recreate target tables.

Added support for MySQL 5.6.45, 5.7.27 and 8.0.17

In this release, added support for MySQL 5.6.45, 5.7.27 and 8.0.17.

For MySQL 8.0, TIMESTAMP data type is supported. MySQL 8.0 support is still in experimental stage, so if you found a bug or suspicious behavior, please report to us!

Here is the documentation about "How to report a bug".

  • How to report a bug

    http://mroonga.org/docs/contribution/report.html

Fixed an unique index update bug which causes duplicated key error

In this release, an unique index update bug was fixed. This bug causes duplicated key error when the following conditions are met

  • An unique index is created against multiple column index
  • An partial unique key column is updated

For example, the following SQL can reproduce a bug.

MySQL [test]> CREATE TABLE fts_targets (
  ->   id int(11) NOT NULL AUTO_INCREMENT,
  ->   source_id int(11) NOT NULL,
  ->   source_type_id int(11) NOT NULL,
  ->   PRIMARY KEY (id),
  ->   -- Multiple column unique index
  ->   UNIQUE KEY (source_id, source_type_id)
  -> ) DEFAULT CHARSET=utf8mb4 ENGINE=Mroonga;
Query OK, 0 rows affected (0.027 sec)

MySQL [test]> INSERT INTO fts_targets (source_id, source_type_id) VALUES (10, 100);
Query OK, 1 row affected (0.006 sec)

MySQL [test]> UPDATE fts_targets SET source_id = 11 WHERE id = 1;
Query OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MySQL [test]> INSERT INTO fts_targets (source_id, source_type_id) VALUES (10, 100);
ERROR 1062 (23000): Duplicate entry '10-100' for key 'source_id'

In above example, the old index entry was not deleted correctly, therefore duplicated key error was occurred.

In this case, you must recreate an target table because unique index may have garbage entries. We recommend to recreate an target table with dump and restore, or execute the following queries.

ALTER TABLE (TABLE_NAME) DISABLE KEYS;
ALTER TABLE (TABLE_NAME) FORCE;
ALTER TABLE (TABLE_NAME) ENABLE KEYS;

Conclusion

See Release 9.05 - 2019-07-30 about detailed changes since 9.04.

Let's search by Mroonga!