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