Skip to content

Commit ea3262d

Browse files
committed
Fix innodb_fts suite
* update (some) tests from 5.7 * update results (e.g. cardinality is no longer reported) * uncomment MYSQL_PLUGIN_FULLTEXT_PARSER/MYSQL_FTS_PARSER code * initialize m_prebuilt->m_fts_limit manually, as we do not use ft_init_ext_with_hints()
1 parent 4133d29 commit ea3262d

13 files changed

+505
-186
lines changed

mysql-test/suite/innodb_fts/r/fulltext.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
88
ANALYZE TABLE t1;
99
SHOW INDEX FROM t1;
1010
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
11-
t1 1 a 1 a NULL 5 NULL NULL YES FULLTEXT
12-
t1 1 a 2 b NULL 5 NULL NULL YES FULLTEXT
11+
t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
12+
t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
1313
select * from t1 where MATCH(a,b) AGAINST ("collections");
1414
a b
1515
Full-text indexes are called collections
@@ -235,7 +235,7 @@ id
235235
show keys from t2;
236236
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
237237
t2 1 tig 1 ticket A 3 NULL NULL YES BTREE
238-
t2 1 tix 1 inhalt NULL 3 NULL NULL YES FULLTEXT
238+
t2 1 tix 1 inhalt NULL NULL NULL NULL YES FULLTEXT
239239
show create table t2;
240240
Table Create Table
241241
t2 CREATE TABLE `t2` (

mysql-test/suite/innodb_fts/r/innodb-fts-fic.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
call mtr.add_suppression("\\[Warning\\] InnoDB: A new Doc ID must be supplied while updating FTS indexed columns.");
2+
call mtr.add_suppression("\\[Warning\\] InnoDB: FTS Doc ID must be larger than [0-9]+ for table `test`.`articles`");
13
CREATE TABLE articles (
24
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
35
title VARCHAR(200),

mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result

Lines changed: 86 additions & 80 deletions
Large diffs are not rendered by default.
Lines changed: 177 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,198 @@
11
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
2+
# Test Part 1: Grammar Test
23
CREATE TABLE articles (
34
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
45
title VARCHAR(200),
5-
body TEXT,
66
FULLTEXT (title) WITH PARSER simple_parser
77
) ENGINE=MyISAM;
88
ALTER TABLE articles ENGINE=InnoDB;
9-
ERROR HY000: Cannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB table
109
DROP TABLE articles;
1110
CREATE TABLE articles (
1211
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
1312
title VARCHAR(200),
1413
body TEXT,
14+
comment TEXT,
1515
FULLTEXT (title) WITH PARSER simple_parser
1616
) ENGINE=InnoDB;
17-
ERROR HY000: Cannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB table
17+
ALTER TABLE articles ADD FULLTEXT INDEX (body) WITH PARSER simple_parser;
18+
CREATE FULLTEXT INDEX ft_index ON articles(comment) WITH PARSER simple_parser;
19+
DROP TABLE articles;
20+
# Test Part 2: Create Index Test(CREATE TABLE WITH FULLTEXT INDEX)
1821
CREATE TABLE articles (
1922
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
2023
title VARCHAR(200),
2124
body TEXT,
22-
FULLTEXT (title)
25+
FULLTEXT (title, body) WITH PARSER simple_parser
2326
) ENGINE=InnoDB;
24-
ALTER TABLE articles ADD FULLTEXT INDEX (body) WITH PARSER simple_parser;
25-
ERROR HY000: Cannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB table
26-
CREATE FULLTEXT INDEX ft_index ON articles(body) WITH PARSER simple_parser;
27-
ERROR HY000: Cannot CREATE FULLTEXT INDEX WITH PARSER on InnoDB table
27+
INSERT INTO articles (title, body) VALUES
28+
('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
29+
('How To Use MySQL Well','After you went through a ...'),
30+
('Optimizing MySQL','In this tutorial we will show ...'),
31+
('1001 MySQL Tricks','How to use full-text search engine'),
32+
('Go MySQL Tricks','How to use full text search engine');
33+
SELECT * FROM articles WHERE
34+
MATCH(title, body) AGAINST('mysql');
35+
id title body
36+
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
37+
2 How To Use MySQL Well After you went through a ...
38+
3 Optimizing MySQL In this tutorial we will show ...
39+
4 1001 MySQL Tricks How to use full-text search engine
40+
5 Go MySQL Tricks How to use full text search engine
41+
SELECT * FROM articles WHERE
42+
MATCH(title, body) AGAINST('will go');
43+
id title body
44+
# Test plugin parser tokenizer difference
45+
SELECT * FROM articles WHERE
46+
MATCH(title, body) AGAINST('full-text');
47+
id title body
48+
4 1001 MySQL Tricks How to use full-text search engine
49+
SELECT * FROM articles WHERE
50+
MATCH(title, body) AGAINST('full text');
51+
id title body
52+
5 Go MySQL Tricks How to use full text search engine
53+
SELECT * FROM articles WHERE
54+
MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
55+
id title body
56+
DROP TABLE articles;
57+
# Test Part 3: Row Merge Create Index Test(ALTER TABLE ADD FULLTEXT INDEX)
58+
CREATE TABLE articles (
59+
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
60+
title VARCHAR(200),
61+
body TEXT
62+
) ENGINE=InnoDB;
63+
INSERT INTO articles (title, body) VALUES
64+
('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
65+
('How To Use MySQL Well','After you went through a ...'),
66+
('Optimizing MySQL','In this tutorial we will show ...'),
67+
('1001 MySQL Tricks','How to use full-text search engine'),
68+
('Go MySQL Tricks','How to use full text search engine');
69+
ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
70+
Warnings:
71+
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
72+
SELECT * FROM articles WHERE
73+
MATCH(title, body) AGAINST('mysql');
74+
id title body
75+
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
76+
2 How To Use MySQL Well After you went through a ...
77+
3 Optimizing MySQL In this tutorial we will show ...
78+
4 1001 MySQL Tricks How to use full-text search engine
79+
5 Go MySQL Tricks How to use full text search engine
80+
SELECT * FROM articles WHERE
81+
MATCH(title, body) AGAINST('will go');
82+
id title body
83+
# Test plugin parser tokenizer difference
84+
SELECT * FROM articles WHERE
85+
MATCH(title, body) AGAINST('full-text');
86+
id title body
87+
4 1001 MySQL Tricks How to use full-text search engine
88+
SELECT * FROM articles WHERE
89+
MATCH(title, body) AGAINST('full text');
90+
id title body
91+
5 Go MySQL Tricks How to use full text search engine
92+
SELECT * FROM articles WHERE
93+
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION);
94+
id title body
95+
4 1001 MySQL Tricks How to use full-text search engine
96+
5 Go MySQL Tricks How to use full text search engine
97+
2 How To Use MySQL Well After you went through a ...
98+
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
99+
3 Optimizing MySQL In this tutorial we will show ...
100+
SELECT * FROM articles WHERE
101+
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION);
102+
id title body
103+
5 Go MySQL Tricks How to use full text search engine
104+
4 1001 MySQL Tricks How to use full-text search engine
105+
2 How To Use MySQL Well After you went through a ...
106+
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
107+
3 Optimizing MySQL In this tutorial we will show ...
108+
SELECT * FROM articles WHERE
109+
MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
110+
id title body
111+
DROP TABLE articles;
112+
# Test Part 3 END
113+
# Test Part 4:crash on commit(before/after)
114+
CREATE TABLE articles (
115+
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
116+
title VARCHAR(200),
117+
body TEXT,
118+
FULLTEXT (title, body) WITH PARSER simple_parser
119+
) ENGINE=InnoDB;
120+
BEGIN;
121+
INSERT INTO articles (title, body) VALUES
122+
('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
123+
('How To Use MySQL Well','After you went through a ...'),
124+
('Optimizing MySQL','In this tutorial we will show ...'),
125+
('1001 MySQL Tricks','How to use full-text search engine'),
126+
('Go MySQL Tricks','How to use full text search engine');
127+
SELECT COUNT(*) FROM articles;
128+
COUNT(*)
129+
0
130+
SELECT * FROM articles WHERE
131+
MATCH(title, body) AGAINST('mysql');
132+
id title body
133+
INSERT INTO articles (title, body) VALUES
134+
('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
135+
('How To Use MySQL Well','After you went through a ...'),
136+
('Optimizing MySQL','In this tutorial we will show ...'),
137+
('1001 MySQL Tricks','How to use full-text search engine'),
138+
('Go MySQL Tricks','How to use full text search engine');
139+
SELECT * FROM articles WHERE
140+
MATCH(title, body) AGAINST('Tricks');
141+
id title body
142+
4 1001 MySQL Tricks How to use full-text search engine
143+
5 Go MySQL Tricks How to use full text search engine
144+
SELECT COUNT(*) FROM articles;
145+
COUNT(*)
146+
5
147+
DROP TABLE articles;
148+
# Test Part 5: Test Uninstall Plugin After Index is Built
149+
CREATE TABLE articles (
150+
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
151+
title VARCHAR(200),
152+
body TEXT,
153+
FULLTEXT (title, body) WITH PARSER simple_parser
154+
) ENGINE=InnoDB;
155+
UNINSTALL PLUGIN simple_parser;
156+
INSERT INTO articles (title, body) VALUES
157+
('MySQL Tutorial','DBMS stands for MySQL DataBase ...');
158+
ERROR HY000: Plugin 'simple_parser' is not loaded
159+
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
160+
INSERT INTO articles (title, body) VALUES
161+
('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
162+
('How To Use MySQL Well','After you went through a ...'),
163+
('Optimizing MySQL','In this tutorial we will show ...'),
164+
('1001 MySQL Tricks','How to use full-text search engine'),
165+
('Go MySQL Tricks','How to use full text search engine');
166+
UNINSTALL PLUGIN simple_parser;
167+
Warnings:
168+
Warning 1620 Plugin is busy and will be uninstalled on shutdown
169+
SELECT * FROM articles WHERE
170+
MATCH(title, body) AGAINST('mysql');
171+
id title body
172+
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
173+
2 How To Use MySQL Well After you went through a ...
174+
3 Optimizing MySQL In this tutorial we will show ...
175+
4 1001 MySQL Tricks How to use full-text search engine
176+
5 Go MySQL Tricks How to use full text search engine
177+
SELECT * FROM articles WHERE
178+
MATCH(title, body) AGAINST('will go');
179+
id title body
180+
# Test plugin parser tokenizer difference
181+
SELECT * FROM articles WHERE
182+
MATCH(title, body) AGAINST('full-text');
183+
id title body
184+
4 1001 MySQL Tricks How to use full-text search engine
185+
SELECT * FROM articles WHERE
186+
MATCH(title, body) AGAINST('full text');
187+
id title body
188+
5 Go MySQL Tricks How to use full text search engine
189+
CREATE TABLE articles2 (
190+
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
191+
title VARCHAR(200),
192+
body TEXT,
193+
FULLTEXT (title, body) WITH PARSER simple_parser
194+
) ENGINE=InnoDB;
195+
ERROR HY000: Function 'simple_parser' is not defined
28196
DROP TABLE articles;
29197
UNINSTALL PLUGIN simple_parser;
198+
ERROR 42000: PLUGIN simple_parser does not exist

mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ WHERE MATCH (a,b)
128128
AGAINST ('"mysql use"@1' IN BOOLEAN MODE);
129129
id a b
130130
INSERT INTO t1 (a,b) VALUES ('XYZ, long blob', repeat("a", 9000));
131-
INSERT INTO t1 (a,b) VALUES (repeat("b", 9000), 'XYZ, long blob');
131+
INSERT IGNORE INTO t1 (a,b) VALUES (repeat("b", 9000), 'XYZ, long blob');
132132
Warnings:
133133
Warning 1265 Data truncated for column 'a' at row 1
134134
SELECT count(*) FROM t1
@@ -137,7 +137,6 @@ AGAINST ('"xyz blob"@3' IN BOOLEAN MODE);
137137
count(*)
138138
2
139139
DROP TABLE t1;
140-
set global innodb_file_format="Barracuda";
141140
set global innodb_file_per_table=1;
142141
CREATE TABLE t1 (
143142
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -225,5 +224,4 @@ AGAINST ('"very blob"@3' IN BOOLEAN MODE);
225224
count(*)
226225
1
227226
DROP TABLE t1;
228-
SET GLOBAL innodb_file_format=Antelope;
229227
SET GLOBAL innodb_file_per_table=1;

mysql-test/suite/innodb_fts/t/innodb-fts-fic.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
-- source include/have_innodb.inc
44

5+
call mtr.add_suppression("\\[Warning\\] InnoDB: A new Doc ID must be supplied while updating FTS indexed columns.");
6+
call mtr.add_suppression("\\[Warning\\] InnoDB: FTS Doc ID must be larger than [0-9]+ for table `test`.`articles`");
57
# Create FTS table
68
CREATE TABLE articles (
79
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,

0 commit comments

Comments
 (0)