| 1 |
# Test database resiliency against scenario where the server crashes |
| 2 |
# right before fts_sync_commit commits its transaction |
| 3 |
|
| 4 |
source include/have_debug.inc; |
| 5 |
source include/not_valgrind.inc; |
| 6 |
|
| 7 |
CREATE TABLE opening_lines ( |
| 8 |
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, |
| 9 |
opening_line TEXT(500), |
| 10 |
author VARCHAR(200), |
| 11 |
title VARCHAR(200) |
| 12 |
) ENGINE=InnoDB; |
| 13 |
|
| 14 |
CREATE FULLTEXT INDEX idx ON opening_lines(opening_line); |
| 15 |
CREATE FULLTEXT INDEX ft_idx1 ON opening_lines(title); |
| 16 |
|
| 17 |
INSERT INTO opening_lines(opening_line,author,title) VALUES |
| 18 |
('Call me Ishmael.','Herman Melville','Moby Dick'), |
| 19 |
('A screaming comes across the sky.','Thomas Pynchon','Gravity\'s Rainbow'), |
| 20 |
('I am an invisible man.','Ralph Ellison','Invisible Man'), |
| 21 |
('Where now? Who now? When now?','Samuel Beckett','The Unnamable'), |
| 22 |
('It was love at first sight.','Joseph Heller','Catch-22'), |
| 23 |
('All this happened, more or less.','Kurt Vonnegut','Slaughterhouse-Five'), |
| 24 |
('Mrs. Dalloway said she would buy the flowers herself.','Virginia Woolf','Mrs. Dalloway'), |
| 25 |
('It was a pleasure to burn.','Ray Bradbury','Fahrenheit 451'); |
| 26 |
|
| 27 |
SET GLOBAL innodb_ft_aux_table='test/opening_lines'; |
| 28 |
SELECT * FROM information_schema.innodb_ft_config; |
| 29 |
|
| 30 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('Ishmael'); |
| 31 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('invisible'); |
| 32 |
SELECT * FROM opening_lines; |
| 33 |
|
| 34 |
SET GLOBAL innodb_optimize_fulltext_only=ON; |
| 35 |
SET GLOBAL debug='+d,fts_crash_before_commit_sync'; |
| 36 |
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 37 |
--error CR_SERVER_LOST |
| 38 |
OPTIMIZE TABLE opening_lines; |
| 39 |
|
| 40 |
--enable_reconnect |
| 41 |
--source include/wait_until_connected_again.inc |
| 42 |
|
| 43 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('Ishmael'); |
| 44 |
SELECT * FROM opening_lines WHERE MATCH(opening_line) AGAINST('invisible'); |
| 45 |
SELECT * FROM opening_lines; |
| 46 |
|
| 47 |
DROP TABLE opening_lines; |