Bug #86460 | Deleted DOCID are not maintained during OPTIMIZE of InnoDB FULLTEXT tables | ||
---|---|---|---|
Submitted: | 25 May 2017 14:19 | Modified: | 31 May 2017 14:44 |
Reporter: | Michael Riediger | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.6 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | fulltext, innodb, Optimize |
[25 May 2017 14:19]
Michael Riediger
[31 May 2017 14:44]
MySQL Verification Team
Verified as described. Thanks for your report. mysql> use ft_test; Database changed mysql> CREATE TABLE articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; Query OK, 0 rows affected (0.36 sec) mysql> INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); Query OK, 6 rows affected (0.05 sec) Records: 6 Duplicates: 0 Warnings: 0 mysql> SET GLOBAL innodb_ft_aux_table = 'ft_test/articles'; Query OK, 0 rows affected (0.00 sec) mysql> SET GLOBAL innodb_optimize_fulltext_only=ON; Query OK, 0 rows affected (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; Empty set (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED; Empty set (0.00 sec) mysql> DELETE FROM ft_test.articles ORDER BY RAND() LIMIT 3; Query OK, 3 rows affected (0.04 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; +--------+ | DOC_ID | +--------+ | 2 | | 3 | | 6 | +--------+ 3 rows in set (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; +--------+ | DOC_ID | +--------+ | 2 | | 3 | | 6 | +--------+ 3 rows in set (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; +--------+ | DOC_ID | +--------+ | 2 | | 3 | | 6 | +--------+ 3 rows in set (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; +--------+ | DOC_ID | +--------+ | 2 | | 3 | | 6 | +--------+ 3 rows in set (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED; Empty set (0.00 sec) mysql> OPTIMIZE TABLE ft_test.articles; +------------------+----------+----------+----------+ | Table | Op | Msg_type | Msg_text | +------------------+----------+----------+----------+ | ft_test.articles | optimize | status | OK | +------------------+----------+----------+----------+ 1 row in set (0.23 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; +--------+ | DOC_ID | +--------+ | 2 | | 3 | | 6 | +--------+ 3 rows in set (0.00 sec) mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED; +--------+ | DOC_ID | +--------+ | 2 | | 3 | | 6 | +--------+ 3 rows in set (0.00 sec) mysql> show variables like 'ver%'; +-------------------------+------------------------------+ | Variable_name | Value | +-------------------------+------------------------------+ | version | 5.7.18 | | version_comment | MySQL Community Server (GPL) | | version_compile_machine | x86_64 | | version_compile_os | linux-glibc2.5 | +-------------------------+------------------------------+ 4 rows in set (0.00 sec) mysql>