~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/myisam_crash_before_flush_keys.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--echo #
 
2
--echo # BUG#41330 - Myisam table open count set to zero before index blocks are written.
 
3
--echo #
 
4
--source include/not_embedded.inc
 
5
--echo # Don't test this under valgrind, memory leaks will occur
 
6
--source include/not_valgrind.inc
 
7
 
 
8
--echo # Binary must be compiled with debug for crash to occur
 
9
--source include/have_debug.inc
 
10
 
 
11
let $MYSQLD_DATADIR= `select @@datadir`;
 
12
SET GLOBAL delay_key_write=ALL;
 
13
CREATE TABLE t1(a INT, 
 
14
                b INT, 
 
15
                PRIMARY KEY(a , b), 
 
16
                KEY(b)) ENGINE=MyISAM DELAY_KEY_WRITE = 1;
 
17
INSERT INTO t1 VALUES (1,2),(2,3),(3,4),(4,5),(5,6);
 
18
 
 
19
--echo # Setup the mysqld to crash at certain point
 
20
SET SESSION debug="d,crash_before_flush_keys";
 
21
 
 
22
--echo # Write file to make mysql-test-run.pl expect crash
 
23
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 
24
 
 
25
--echo # Run the crashing query
 
26
--error 2013
 
27
FLUSH TABLE t1;
 
28
 
 
29
--echo # Write file to make mysql-test-run.pl start the server 
 
30
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 
31
 
 
32
--echo # Turn on reconnect
 
33
--enable_reconnect
 
34
 
 
35
--echo # Call script that will poll the server waiting for
 
36
--echo # it to be back online again
 
37
--source include/wait_until_connected_again.inc
 
38
 
 
39
# Must report that the table wasn't closed properly
 
40
CHECK TABLE t1;
 
41
DROP TABLE t1;