Details
-
Type:
Task
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Fix Version/s: 10.0.5
-
Component/s: None
-
Labels:None
Description
It's possible to create a fulltext index in an InnoDB table in 10.0.3, and, superficially, it appears to work as expected. This feature is untested, so either needs to be fully tested and incorporated as a feature, or disabled.
Gliffy Diagrams
Attachments
Issue Links
- duplicates
-
MDEV-4115 Merge InnoDB fulltext index from MySQL 5.6
-
- Closed
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Summary of relevant failures from innodb_fts suite:
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)) ENGINE = InnoDB;
INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Full-text indexes', 'are called collections'), ('Only MyISAM tables','support collections'), ('Function MATCH ... AGAINST()','is used to do a search'), ('Full-text search in MySQL', 'implements vector space model');
select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE);
-------------------
-----------------------+-------------------
-----------------------+-------------------
-----------------------+2 rows in set (0.01 sec)
(the 2nd row shouldn't be there)
Upd: fixed in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10
====================================================
CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a)) ENGINE = InnoDB;
INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
INSERT INTO t1 VALUES('testword\'\'');
SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE);
Empty set (0.01 sec)
(should be a row)
Upd: still fails in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10. It also fails in MySQL 5.6.10 (but works in 5.6.12), so the behavior is consistent with MySQL 5.6.10 (GA).
====================================================
SET NAMES utf8;
CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE = INNODB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES('„MySQL“');
SELECT a FROM t1 WHERE MATCH a AGAINST('“MySQL„' IN BOOLEAN MODE);
Empty set (0.01 sec)
(should be a row)
Upd: still fails in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10. It also fails in MySQL 5.6.10 (but works in 5.6.12).
====================================================
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
) ENGINE=InnoDB;
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 ...');
ANALYZE TABLE articles;
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('mysql - Security&DBMS' IN BOOLEAN MODE);
---
-----------------------------------------------------------------
-----------------------------------------------------------------
--------------------------------------------------------------6 rows in set (0.01 sec)
According to comments in the text, it should work same way as
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('mysql - (Security DBMS)' IN BOOLEAN MODE);
but it does not:
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('mysql - (Security DBMS)' IN BOOLEAN MODE);
---
-----------------------------------------------------------------
-----------------------------------------------------------------
--------------------------------------------------------------4 rows in set (0.00 sec)
For a note, there seems to be a bug with the latter query on MyISAM tables
Upd: still fails in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10. It also fails in MySQL 5.6.10 (but works in 5.6.12).
====================================================
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
) ENGINE=InnoDB;
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 ...');
ANALYZE TABLE articles;
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"following comparison"@3' IN BOOLEAN MODE);
Empty set (0.01 sec)
(should be a row)
It's just one example, basically proximity doesn't work at all.
Upd: fixed in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10
==============================================
Assertion failure
130703 21:54:11 InnoDB: Assertion failure in thread 139830781155072 in file fts0fts.cc line 4781
InnoDB: Failing assertion: savepoint->name == NULL
#5 0x00007f2ce8241b8b in __GI_abort () at abort.c:91
#6 0x0000000000d33d3c in fts_trx_free (fts_trx=0x7f2cb0025ad8) at 10.0/storage/innobase/fts/fts0fts.cc:4781
#7 0x0000000000ca8436 in trx_finalize_for_fts (trx=0x7f2cb00f4398, is_commit=0) at 10.0/storage/innobase/trx/trx0trx.cc:970
#8 0x0000000000ca8f4f in trx_commit (trx=0x7f2cb00f4398) at 10.0/storage/innobase/trx/trx0trx.cc:1170
#9 0x0000000000ca1246 in trx_rollback_finish (trx=0x7f2cb00f4398) at 10.0/storage/innobase/trx/trx0roll.cc:1323
#10 0x0000000000c9e94b in trx_rollback_to_savepoint_low (trx=0x7f2cb00f4398, savept=0x0) at 10.0/storage/innobase/trx/trx0roll.cc:117
#11 0x0000000000c9ebd4 in trx_rollback_for_mysql_low (trx=0x7f2cb00f4398) at 10.0/storage/innobase/trx/trx0roll.cc:181
#12 0x0000000000c9ef3d in trx_rollback_for_mysql (trx=0x7f2cb00f4398) at 10.0/storage/innobase/trx/trx0roll.cc:214
#13 0x0000000000bdb556 in innobase_rollback (hton=0x26b5738, thd=0x2c8e8d8, rollback_trx=true) at 10.0/storage/innobase/handler/ha_innodb.cc:3466
#14 0x000000000080609d in ha_rollback_trans (thd=0x2c8e8d8, all=true) at 10.0/sql/handler.cc:1561
#15 0x0000000000750700 in trans_rollback (thd=0x2c8e8d8) at 10.0/sql/transaction.cc:297
#16 0x00000000005e7277 in THD::cleanup (this=0x2c8e8d8) at 10.0/sql/sql_class.cc:1471
#17 0x000000000056af1f in thd_cleanup (thd=0x2c8e8d8) at 10.0/sql/mysqld.cc:2599
#18 0x000000000056b0b9 in unlink_thd (thd=0x2c8e8d8) at 10.0/sql/mysqld.cc:2655
#19 0x000000000056b504 in one_thread_per_connection_end (thd=0x2c8e8d8, put_in_cache=true) at 10.0/sql/mysqld.cc:2783
#20 0x000000000073d8c6 in do_handle_one_connection (thd_arg=0x2c8e8d8) at 10.0/sql/sql_connect.cc:1278
#21 0x000000000073d573 in handle_one_connection (arg=0x2c8e8d8) at 10.0/sql/sql_connect.cc:1181
#22 0x00000000009d32b4 in pfs_spawn_thread (arg=0x2602ca8) at 10.0/storage/perfschema/pfs.cc:1800
#23 0x00007f2ce921de9a in start_thread (arg=0x7f2ce40a1700) at pthread_create.c:308
#24 0x00007f2ce82fbcbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
create table `fts_test`(`a` text,fulltext key(`a`))engine=innodb;
set session autocommit=0;
insert into `fts_test` values ('');
savepoint `b`;
savepoint `b`;
Upd: fixed in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10
==============================================
The test below has a comment that claims
#
#
and checks 'Sort%' status variables for that. Ours get populated, so we don't meet the requirement.
Strangely though, EXPLAIN on MySQL still shows filesort.
CREATE TABLE wp(
FTS_DOC_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
title VARCHAR(255) NOT NULL DEFAULT '',
text MEDIUMTEXT NOT NULL,
dummy INTEGER,
PRIMARY KEY (FTS_DOC_ID),
UNIQUE KEY FTS_DOC_ID_INDEX (FTS_DOC_ID),
FULLTEXT KEY idx (title,text)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO wp (title, text) VALUES
('MySQL Tutorial','DBMS stands for MySQL 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 to database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
FLUSH STATUS;
SELECT title, MATCH(title, text) AGAINST ('database') AS score
FROM wp
WHERE MATCH(title, text) AGAINST ('database')
ORDER BY score DESC;
SHOW SESSION STATUS LIKE 'Sort%';
------------------
------+------------------
------+------------------
------+4 rows in set (0.00 sec)
There are more tests like that.
Upd: still fails in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10, although it works in MySQL 5.6.10, so if it's a bug, it might be MariaDB-only.
==============================================
CREATE TABLE user_stopword(value varchar(30)) ENGINE = InnoDB
DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci;
INSERT INTO user_stopword VALUES('lòve');
SET GLOBAL innodb_ft_server_stopword_table = 'test/user_stopword';
MySQL allows to set it, MariaDB says Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/user_stopword'.
It should be possible, according to docs.
Upd: still fails in 10.0-monty (revno 3637) after merge with InnoDB of 5.6.10. It also fails in MySQL 5.6.10 (but works in 5.6.12).
==============================================
Minor issues: wrong error codes