Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.4
Description
MySQL 8.0.40 includes the following change, which seems to be applicable to MariaDB Server:
Bug#36652127 InnoDB: FTS table optimization not working correctly with collation
No test case is included, but source code comments mention Chinese, Japanese, Korean (CJK) collations.
Attachments
Issue Links
- relates to
-
MDEV-35170 Merge applicable changes from InnoDB 8.0.40
-
- Closed
-
This patch just fixes the optimization during fulltext optimization. Basically, it avoid reading the words that need optimization multiple times.
This way it can avoid calling fts_optimize_write() multiple times.
Wrote a test case to check how collation behaves in fulltext index:
SET NAMES utf8;
CREATE TABLE t1 (
f1 INT NOT NULL PRIMARY KEY,
f2 VARCHAR(64) COLLATE utf8mb4_general_ci,
FULLTEXT ft(f2)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,'antenna');
ALTER TABLE t1 FORCE;
INSERT INTO t1 VALUES (2, 'äntenna'), (3, 'äntenna');
DELETE FROM t1 WHERE f1 > 2;
SELECT * FROM t1;
f1 f2
1 antenna
2 äntenna
SET GLOBAL innodb_optimize_fulltext_only=ON;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
SELECT * FROM t1 WHERE MATCH(f2) AGAINST("antenna" IN BOOLEAN MODE);
f1 f2
2 äntenna
DROP TABLE t1;
SET GLOBAL innodb_optimize_fulltext_only=OFF;
This happens only in MariaDB. As discussed with marko, reduce the priority of the issue.