| 1 |
CREATE TABLE opening_lines ( |
| 2 |
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, |
| 3 |
opening_line TEXT(500), |
| 4 |
author VARCHAR(200), |
| 5 |
title VARCHAR(200) |
| 6 |
) ENGINE=InnoDB; |
| 7 |
CREATE FULLTEXT INDEX idx ON opening_lines(opening_line); |
| 8 |
Warnings: |
| 9 |
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID |
| 10 |
CREATE FULLTEXT INDEX ft_idx1 ON opening_lines(title); |
| 11 |
INSERT INTO opening_lines(opening_line,author,title) VALUES |
| 12 |
('Call me Ishmael.','Herman Melville','Moby Dick'), |
| 13 |
('A screaming comes across the sky.','Thomas Pynchon','Gravity\'s Rainbow'), |
| 14 |
('I am an invisible man.','Ralph Ellison','Invisible Man'), |
| 15 |
('Where now? Who now? When now?','Samuel Beckett','The Unnamable'), |
| 16 |
('It was love at first sight.','Joseph Heller','Catch-22'), |
| 17 |
('All this happened, more or less.','Kurt Vonnegut','Slaughterhouse-Five'), |
| 18 |
('Mrs. Dalloway said she would buy the flowers herself.','Virginia Woolf','Mrs. Dalloway'), |
| 19 |
('It was a pleasure to burn.','Ray Bradbury','Fahrenheit 451'); |
| 20 |
SET GLOBAL innodb_ft_aux_table='test/opening_lines'; |
| 21 |
SELECT * FROM information_schema.innodb_ft_config; |
| 22 |
KEY VALUE |
| 23 |
optimize_checkpoint_limit 180 |
| 24 |
synced_doc_id 0 |
| 25 |
stopword_table_name |
| 26 |
use_stopword 1 |
| 27 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('Ishmael'); |
| 28 |
id opening_line author title |
| 29 |
1 Call me Ishmael. Herman Melville Moby Dick |
| 30 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('invisible'); |
| 31 |
id opening_line author title |
| 32 |
3 I am an invisible man. Ralph Ellison Invisible Man |
| 33 |
SELECT * FROM opening_lines; |
| 34 |
id opening_line author title |
| 35 |
1 Call me Ishmael. Herman Melville Moby Dick |
| 36 |
2 A screaming comes across the sky. Thomas Pynchon Gravity's Rainbow |
| 37 |
3 I am an invisible man. Ralph Ellison Invisible Man |
| 38 |
4 Where now? Who now? When now? Samuel Beckett The Unnamable |
| 39 |
5 It was love at first sight. Joseph Heller Catch-22 |
| 40 |
6 All this happened, more or less. Kurt Vonnegut Slaughterhouse-Five |
| 41 |
7 Mrs. Dalloway said she would buy the flowers herself. Virginia Woolf Mrs. Dalloway |
| 42 |
8 It was a pleasure to burn. Ray Bradbury Fahrenheit 451 |
| 43 |
SET GLOBAL innodb_optimize_fulltext_only=ON; |
| 44 |
SET GLOBAL debug='+d,fts_crash_before_commit_sync'; |
| 45 |
OPTIMIZE TABLE opening_lines; |
| 46 |
ERROR HY000: Lost connection to MySQL server during query |
| 47 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('Ishmael'); |
| 48 |
id opening_line author title |
| 49 |
1 Call me Ishmael. Herman Melville Moby Dick |
| 50 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('invisible'); |
| 51 |
id opening_line author title |
| 52 |
3 I am an invisible man. Ralph Ellison Invisible Man |
| 53 |
SELECT * FROM opening_lines; |
| 54 |
id opening_line author title |
| 55 |
1 Call me Ishmael. Herman Melville Moby Dick |
| 56 |
2 A screaming comes across the sky. Thomas Pynchon Gravity's Rainbow |
| 57 |
3 I am an invisible man. Ralph Ellison Invisible Man |
| 58 |
4 Where now? Who now? When now? Samuel Beckett The Unnamable |
| 59 |
5 It was love at first sight. Joseph Heller Catch-22 |
| 60 |
6 All this happened, more or less. Kurt Vonnegut Slaughterhouse-Five |
| 61 |
7 Mrs. Dalloway said she would buy the flowers herself. Virginia Woolf Mrs. Dalloway |
| 62 |
8 It was a pleasure to burn. Ray Bradbury Fahrenheit 451 |
| 63 |
DROP TABLE opening_lines; |