Debian Codegraph @

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

raw
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`");
3 CREATE TABLE articles (
4 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
5 title VARCHAR(200),
6 body TEXT
7 ) ENGINE=InnoDB;
8 INSERT INTO articles (title,body) VALUES
9 ('MySQL Tutorial','DBMS stands for DataBase ...') ,
10 ('How To Use MySQL Well','After you went through a ...'),
11 ('Optimizing MySQL','In this tutorial we will show ...'),
12 ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
13 ('MySQL vs. YourSQL','In the following database comparison ...'),
14 ('MySQL Security','When configured properly, MySQL ...');
15 CREATE FULLTEXT INDEX idx on articles (title, body);
16 SELECT * FROM articles WHERE MATCH (title, body)
17 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
18 id title body
19 1 MySQL Tutorial DBMS stands for DataBase ...
20 3 Optimizing MySQL In this tutorial we will show ...
21 SELECT COUNT(*) FROM articles
22 WHERE MATCH (title, body)
23 AGAINST ('database' IN NATURAL LANGUAGE MODE);
24 COUNT(*)
25 2
26 SELECT * FROM articles
27 WHERE MATCH (title, body)
28 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
29 id title body
30 1 MySQL Tutorial DBMS stands for DataBase ...
31 3 Optimizing MySQL In this tutorial we will show ...
32 SELECT COUNT(IF(MATCH (title, body)
33 AGAINST ('database' IN NATURAL LANGUAGE MODE), 1, NULL))
34 AS count FROM articles;
35 count
36 2
37 ANALYZE TABLE articles;
38 Table Op Msg_type Msg_text
39 test.articles analyze status Engine-independent statistics collected
40 test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
41 test.articles analyze status OK
42 SELECT * FROM articles WHERE MATCH (title,body)
43 AGAINST ('+MySQL -YourSQL' IN BOOLEAN MODE);
44 id title body
45 6 MySQL Security When configured properly, MySQL ...
46 1 MySQL Tutorial DBMS stands for DataBase ...
47 2 How To Use MySQL Well After you went through a ...
48 3 Optimizing MySQL In this tutorial we will show ...
49 4 1001 MySQL Tricks 1. Never run mysqld as root. 2. ...
50 SELECT * FROM articles WHERE MATCH (title,body)
51 AGAINST ('DBMS Security' IN BOOLEAN MODE);
52 id title body
53 1 MySQL Tutorial DBMS stands for DataBase ...
54 6 MySQL Security When configured properly, MySQL ...
55 SELECT * FROM articles WHERE MATCH (title,body)
56 AGAINST ('+MySQL +YourSQL' IN BOOLEAN MODE);
57 id title body
58 5 MySQL vs. YourSQL In the following database comparison ...
59 DROP INDEX idx ON articles;
60 CREATE FULLTEXT INDEX idx on articles (title, body);
61 CREATE FULLTEXT INDEX idx1 on articles (title);
62 SELECT * FROM articles WHERE MATCH (title, body)
63 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
64 id title body
65 1 MySQL Tutorial DBMS stands for DataBase ...
66 3 Optimizing MySQL In this tutorial we will show ...
67 DROP INDEX idx ON articles;
68 DROP INDEX idx1 ON articles;
69 CREATE FULLTEXT INDEX idx1 on articles (title);
70 SELECT * FROM articles WHERE MATCH (title)
71 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
72 id title body
73 1 MySQL Tutorial DBMS stands for DataBase ...
74 drop table articles;
75 CREATE TABLE articles (
76 FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
77 title VARCHAR(200),
78 body TEXT
79 ) ENGINE=InnoDB;
80 create unique index FTS_DOC_ID_INDEX on articles(FTS_DOC_ID);
81 INSERT INTO articles (title,body) VALUES
82 ('MySQL Tutorial','DBMS stands for DataBase ...') ,
83 ('How To Use MySQL Well','After you went through a ...'),
84 ('Optimizing MySQL','In this tutorial we will show ...'),
85 ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
86 ('MySQL vs. YourSQL','In the following database comparison ...'),
87 ('MySQL Security','When configured properly, MySQL ...');
88 CREATE FULLTEXT INDEX idx on articles (title, body);
89 SELECT * FROM articles WHERE MATCH (title, body)
90 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
91 FTS_DOC_ID title body
92 1 MySQL Tutorial DBMS stands for DataBase ...
93 3 Optimizing MySQL In this tutorial we will show ...
94 drop table articles;
95 CREATE TABLE articles (
96 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
97 title VARCHAR(200),
98 body TEXT
99 ) ENGINE=InnoDB;
100 INSERT INTO articles (title,body) VALUES
101 ('MySQL Tutorial','DBMS stands for DataBase ...') ,
102 ('How To Use MySQL Well','After you went through a ...'),
103 ('Optimizing MySQL','In this tutorial we will show ...'),
104 ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
105 ('MySQL vs. YourSQL','In the following database comparison ...'),
106 ('MySQL Security','When configured properly, MySQL ...');
107 CREATE FULLTEXT INDEX idx on articles (title);
108 CREATE FULLTEXT INDEX idx2 on articles (body);
109 SELECT * FROM articles WHERE MATCH (title, body)
110 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
111 ERROR HY000: Can't find FULLTEXT index matching the column list
112 SELECT * FROM articles WHERE MATCH (title)
113 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
114 id title body
115 1 MySQL Tutorial DBMS stands for DataBase ...
116 SELECT * FROM articles WHERE MATCH (body)
117 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
118 id title body
119 3 Optimizing MySQL In this tutorial we will show ...
120 drop index idx2 on articles;
121 SELECT * FROM articles WHERE MATCH (body)
122 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
123 ERROR HY000: Can't find FULLTEXT index matching the column list
124 CREATE FULLTEXT INDEX idx2 on articles (body);
125 SELECT * FROM articles WHERE MATCH (body)
126 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
127 id title body
128 3 Optimizing MySQL In this tutorial we will show ...
129 UPDATE articles set title = 'aaaa'
130 WHERE MATCH(title) AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
131 SELECT * FROM articles WHERE MATCH (title)
132 AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);
133 id title body
134 SELECT * FROM articles WHERE MATCH (title)
135 AGAINST ('aaaa' IN NATURAL LANGUAGE MODE);
136 id title body
137 1 aaaa DBMS stands for DataBase ...
138 drop table articles;
139 CREATE TABLE articles (
140 FTS_DOC_ID BIGINT UNSIGNED NOT NULL ,
141 title VARCHAR(200),
142 body TEXT
143 ) ENGINE=InnoDB;
144 CREATE FULLTEXT INDEX idx on articles (title);
145 INSERT INTO articles VALUES (9, 'MySQL Tutorial','DBMS stands for DataBase ...');
146 UPDATE articles set title = 'bbbb' WHERE MATCH(title) AGAINST ('tutorial' IN NATURAL LANGUAGE MODE);
147 ERROR HY000: Invalid InnoDB FTS Doc ID
148 UPDATE articles set title = 'bbbb', FTS_DOC_ID=8 WHERE MATCH(title) AGAINST ('tutorial' IN NATURAL LANGUAGE MODE);
149 ERROR HY000: Invalid InnoDB FTS Doc ID
150 UPDATE articles set title = 'bbbb', FTS_DOC_ID=10 WHERE MATCH(title) AGAINST ('tutorial' IN NATURAL LANGUAGE MODE);
151 SELECT * FROM articles WHERE MATCH (title) AGAINST ('bbbb' IN NATURAL LANGUAGE MODE);
152 FTS_DOC_ID title body
153 10 bbbb DBMS stands for DataBase ...
154 SELECT * FROM articles WHERE MATCH (title) AGAINST ('tutorial' IN NATURAL LANGUAGE MODE);
155 FTS_DOC_ID title body
156 CREATE FULLTEXT INDEX idx2 ON articles (body);
157 SELECT * FROM articles WHERE MATCH (body) AGAINST ('database' IN NATURAL LANGUAGE MODE);
158 FTS_DOC_ID title body
159 10 bbbb DBMS stands for DataBase ...
160 UPDATE articles set body = 'bbbb', FTS_DOC_ID=11 WHERE MATCH(body) AGAINST ('database' IN NATURAL LANGUAGE MODE);
161 drop table articles;
162 create table `articles`(`a` varchar(2) not null)engine=innodb;
163 create fulltext index `FTS_DOC_ID_INDEX` on `articles`(`a`);
164 ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
165 create unique index `a` on `articles`(`a`);
166 drop table articles;
167 CREATE TABLE wp(
168 FTS_DOC_ID bigint PRIMARY KEY,
169 title VARCHAR(255) NOT NULL DEFAULT '',
170 text MEDIUMTEXT NOT NULL ) ENGINE=InnoDB;
171 INSERT INTO wp (FTS_DOC_ID, title, text) VALUES
172 (1, 'MySQL Tutorial','DBMS stands for DataBase ...'),
173 (2, 'How To Use MySQL Well','After you went through a ...');
174 CREATE FULLTEXT INDEX idx ON wp(title, text);
175 ERROR HY000: Column 'FTS_DOC_ID' is of wrong type for an InnoDB FULLTEXT index
176 DROP TABLE wp;
177 CREATE TABLE wp(
178 FTS_DOC_ID bigint unsigned PRIMARY KEY,
179 title VARCHAR(255) NOT NULL DEFAULT '',
180 text MEDIUMTEXT NOT NULL ) ENGINE=InnoDB;
181 INSERT INTO wp (FTS_DOC_ID, title, text) VALUES
182 (1, 'MySQL Tutorial','DBMS stands for DataBase ...'),
183 (2, 'How To Use MySQL Well','After you went through a ...');
184 CREATE FULLTEXT INDEX idx ON wp(title, text);
185 SELECT FTS_DOC_ID, MATCH(title, text) AGAINST ('database')
186 FROM wp;
187 FTS_DOC_ID MATCH(title, text) AGAINST ('database')
188 1 0.0906190574169159
189 2 0
190 DROP TABLE wp;