~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/repair.test

  • Committer: Brian Aker
  • Date: 2009-01-07 21:26:58 UTC
  • Revision ID: brian@tangent.org-20090107212658-2fh0s2uwh10w68y2
Committing fix lock_multi

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Test of repair table
 
3
#
 
4
 
 
5
--disable_warnings
 
6
drop table if exists t1;
 
7
--enable_warnings
 
8
 
 
9
create table t1 ENGINE=MyISAM SELECT 1,"table 1";
 
10
repair table t1 use_frm;
 
11
alter table t1 ENGINE=HEAP;
 
12
repair table t1 use_frm;
 
13
drop table t1;
 
14
 
 
15
#
 
16
# disabled keys during repair
 
17
#
 
18
create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st)) ENGINE=MyISAM;
 
19
insert into t1 values(1, "One");
 
20
alter table t1 disable keys;
 
21
show keys from t1;
 
22
repair table t1 extended;
 
23
show keys from t1;
 
24
drop table t1;
 
25
 
 
26
 
 
27
# non-existent table
 
28
repair table t1 use_frm;
 
29
 
 
30
create table t1 engine=myisam SELECT 1,"table 1";
 
31
flush tables;
 
32
--system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
 
33
# BUG: REPAIR returns Ok when it shouldn't
 
34
# https://bugs.launchpad.net/drizzle/+bug/310389
 
35
repair table t1;
 
36
repair table t1 use_frm;
 
37
drop table t1;
 
38
 
 
39
#
 
40
# BUG#18874 - Setting myisam_repair_threads > 1, index cardinality always 1
 
41
#
 
42
CREATE TABLE t1(a INT, KEY(a)) ENGINE=MyISAM;
 
43
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
 
44
SET GLOBAL myisam_repair_threads=2;
 
45
REPAIR TABLE t1;
 
46
SHOW INDEX FROM t1;
 
47
SET GLOBAL myisam_repair_threads=1;
 
48
DROP TABLE t1;
 
49
 
 
50
#
 
51
# BUG#22562 - REPAIR TABLE .. USE_FRM causes server crash on Windows and
 
52
#             server hangs on Linux
 
53
#
 
54
CREATE TABLE t1(a INT) ENGINE=MyISAM;
 
55
USE mysql;
 
56
REPAIR TABLE test.t1 USE_FRM;
 
57
USE test;
 
58
DROP TABLE t1;
 
59
 
 
60
#
 
61
# BUG#23175 - MYISAM crash/repair failed during repair
 
62
#
 
63
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
 
64
SET myisam_sort_buffer_size=4096;
 
65
# fails with ER_NOT_KEYFILE but really 'myisam_sort_buffer_size is too small'
 
66
--error ER_NOT_KEYFILE
 
67
INSERT INTO t1 VALUES
 
68
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
69
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
70
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
71
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
72
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
73
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
74
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
75
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
76
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
77
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
78
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
79
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
80
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
81
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
82
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
83
('0'),('0'),('0'),('0'),('0'),('0'),('0');
 
84
SET GLOBAL myisam_repair_threads=2;
 
85
REPAIR TABLE t1;
 
86
SET GLOBAL myisam_repair_threads=1;
 
87
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
 
88
DROP TABLE t1;
 
89
 
 
90
#
 
91
# BUG#31174 - "Repair" command on MyISAM crashes with small 
 
92
#              myisam_sort_buffer_size
 
93
#
 
94
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
 
95
SET myisam_sort_buffer_size=16384;
 
96
INSERT INTO t1 VALUES
 
97
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
98
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
99
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
100
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
101
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
102
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
103
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
104
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
105
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
106
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
107
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
108
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
109
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
110
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
111
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
 
112
('0'),('0'),('0'),('0'),('0'),('0'),('0');
 
113
SET GLOBAL myisam_repair_threads=2;
 
114
REPAIR TABLE t1;
 
115
SET GLOBAL myisam_repair_threads=1;
 
116
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
 
117
DROP TABLE t1;
 
118
 
 
119
--echo End of 4.1 tests
 
120
# End of 5.0 tests
 
121
 
 
122
#
 
123
# Bug#18775 - Temporary table from alter table visible to other threads
 
124
#
 
125
# REPAIR TABLE ... USE_FRM on temporary table crashed the table or server.
 
126
--disable_warnings
 
127
DROP TABLE IF EXISTS tt1;
 
128
--enable_warnings
 
129
CREATE TEMPORARY TABLE tt1 (c1 INT);
 
130
REPAIR TABLE tt1 USE_FRM;
 
131
DROP TABLE tt1;
 
132