| 1 |
if ($stopword_stage == create_table) |
| 2 |
{ |
| 3 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table not_defined does not exist."); |
| 4 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table test/user_stopword_session does not exist."); |
| 5 |
|
| 6 |
select * from information_schema.innodb_ft_default_stopword; |
| 7 |
|
| 8 |
# Create FTS table |
| 9 |
eval CREATE TABLE $stopword_table ( |
| 10 |
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, |
| 11 |
title VARCHAR(200), |
| 12 |
body TEXT, |
| 13 |
FULLTEXT (title,body) |
| 14 |
)$create_options ENGINE=InnoDB; |
| 15 |
|
| 16 |
# Insert six rows |
| 17 |
eval INSERT INTO $stopword_table (title,body) VALUES |
| 18 |
('MySQL Tutorial','DBMS stands for DataBase ...') , |
| 19 |
('How To Use MySQL Well','After you went through a ...'), |
| 20 |
('Optimizing MySQL','In this tutorial we will show ...'), |
| 21 |
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), |
| 22 |
('MySQL vs. YourSQL','In the following database comparison ...'), |
| 23 |
('MySQL Security','When configured properly, MySQL ...'); |
| 24 |
|
| 25 |
# "the" is in the default stopword, it would not be selected |
| 26 |
eval SELECT * FROM $stopword_table WHERE MATCH (title,body) |
| 27 |
AGAINST ('the' IN NATURAL LANGUAGE MODE); |
| 28 |
|
| 29 |
# Provide user defined stopword table, if not (correctly) defined, |
| 30 |
# it will be rejected |
| 31 |
--error ER_WRONG_VALUE_FOR_VAR |
| 32 |
set global innodb_ft_server_stopword_table = "not_defined"; |
| 33 |
set global innodb_ft_server_stopword_table = NULL; |
| 34 |
|
| 35 |
# Define a correct formatted user stopword table |
| 36 |
eval create table user_stopword(value varchar(30))$create_options engine = innodb; |
| 37 |
|
| 38 |
# The set operation should be successful |
| 39 |
set global innodb_ft_server_stopword_table = "test/user_stopword"; |
| 40 |
|
| 41 |
eval drop index title on $stopword_table; |
| 42 |
|
| 43 |
eval create fulltext index idx on $stopword_table(title, body); |
| 44 |
} |
| 45 |
|
| 46 |
if ($stopword_stage == select_1) |
| 47 |
{ |
| 48 |
--error 0, ER_INDEX_CORRUPT |
| 49 |
eval SELECT * FROM $stopword_table WHERE MATCH (title,body) |
| 50 |
AGAINST ('the' IN NATURAL LANGUAGE MODE); |
| 51 |
--error 0, ER_INDEX_CORRUPT |
| 52 |
eval SELECT * FROM $stopword_table WHERE MATCH (title,body) |
| 53 |
AGAINST ('this' IN NATURAL LANGUAGE MODE); |
| 54 |
|
| 55 |
} |