~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Test of repair table
3
#
4
5
--disable_warnings
6
drop table if exists t1;
7
--enable_warnings
8
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
9
create table t1 ENGINE=MyISAM SELECT 1,"table 1";
1 by brian
clean slate
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
#
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
18
create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st)) ENGINE=MyISAM;
1 by brian
clean slate
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;
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
32
--system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
673.3.19 by Stewart Smith
add repair test back to main suite (with result file fixed and bug filed for the bug in there)
33
# BUG: REPAIR returns Ok when it shouldn't
34
# https://bugs.launchpad.net/drizzle/+bug/310389
1 by brian
clean slate
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
#
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
42
CREATE TABLE t1(a INT, KEY(a)) ENGINE=MyISAM;
1 by brian
clean slate
43
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
753 by Brian Aker
Converted myisam_repair_threads to being in module for MyISAM
44
SET GLOBAL myisam_repair_threads=2;
1 by brian
clean slate
45
REPAIR TABLE t1;
46
SHOW INDEX FROM t1;
753 by Brian Aker
Converted myisam_repair_threads to being in module for MyISAM
47
SET GLOBAL myisam_repair_threads=1;
1 by brian
clean slate
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
#
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
54
CREATE TABLE t1(a INT) ENGINE=MyISAM;
1 by brian
clean slate
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
#
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
63
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
1 by brian
clean slate
64
SET myisam_sort_buffer_size=4096;
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
65
# fails with ER_NOT_KEYFILE but really 'myisam_sort_buffer_size is too small'
66
--error ER_NOT_KEYFILE
1 by brian
clean slate
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');
753 by Brian Aker
Converted myisam_repair_threads to being in module for MyISAM
84
SET GLOBAL myisam_repair_threads=2;
1 by brian
clean slate
85
REPAIR TABLE t1;
753 by Brian Aker
Converted myisam_repair_threads to being in module for MyISAM
86
SET GLOBAL myisam_repair_threads=1;
1 by brian
clean slate
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
#
673.3.17 by Stewart Smith
mostly fix repair test. fix syntax for Drizzle (all tests are MyISAM reliant).
94
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
95
SET myisam_sort_buffer_size=16384;
1 by brian
clean slate
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');
753 by Brian Aker
Converted myisam_repair_threads to being in module for MyISAM
113
SET GLOBAL myisam_repair_threads=2;
1 by brian
clean slate
114
REPAIR TABLE t1;
753 by Brian Aker
Converted myisam_repair_threads to being in module for MyISAM
115
SET GLOBAL myisam_repair_threads=1;
1 by brian
clean slate
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