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

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/t/partition_recover_myisam.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
# test the auto-recover (--myisam-recover) of partitioned myisam tables
 
2
 
 
3
call mtr.add_suppression("./test/t1_will_crash");
 
4
call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
 
5
 
 
6
--source include/have_partition.inc
 
7
--disable_warnings
 
8
--disable_query_log
 
9
drop table if exists t1_will_crash;
 
10
--enable_query_log
 
11
--enable_warnings
 
12
 
 
13
 
 
14
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
 
15
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
 
16
FLUSH TABLES;
 
17
 
 
18
--echo # replacing t1.MYI with a corrupt + unclosed one created by doing:
 
19
--echo # 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI 
 
20
let $MYSQLD_DATADIR= `select @@datadir`;
 
21
--remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI
 
22
--copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI
 
23
SELECT * FROM t1_will_crash;
 
24
DROP TABLE t1_will_crash;
 
25
CREATE TABLE t1_will_crash (a INT, KEY (a))
 
26
ENGINE=MyISAM
 
27
PARTITION BY HASH(a)
 
28
PARTITIONS 3;
 
29
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
 
30
FLUSH TABLES;
 
31
--echo # replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing:
 
32
--echo # 'create table t1 (a int key(a)) partition by hash (a) partitions 3'
 
33
--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI 
 
34
--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
 
35
--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
 
36
SELECT * FROM t1_will_crash;
 
37
DROP TABLE t1_will_crash;