~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/repair.test

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

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 GLOBAL myisam_sort_buffer_size=4096;
 
65
SHOW VARIABLES LIKE "myisam_sort_buffer_size";
 
66
# fails with ER_NOT_KEYFILE but really 'myisam_sort_buffer_size is too small'
 
67
--error ER_NOT_KEYFILE
 
68
INSERT INTO t1 VALUES
 
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'),('0'),('0'),('0'),
 
84
('0'),('0'),('0'),('0'),('0'),('0'),('0');
 
85
SET GLOBAL myisam_repair_threads=2;
 
86
REPAIR TABLE t1;
 
87
SET GLOBAL myisam_repair_threads=1;
 
88
SET GLOBAL myisam_sort_buffer_size=DEFAULT;
 
89
DROP TABLE t1;
 
90
 
 
91
#
 
92
# BUG#31174 - "Repair" command on MyISAM crashes with small 
 
93
#              myisam_sort_buffer_size
 
94
#
 
95
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
 
96
SET GLOBAL myisam_sort_buffer_size=16384;
 
97
INSERT INTO t1 VALUES
 
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'),('0'),('0'),('0'),
 
113
('0'),('0'),('0'),('0'),('0'),('0'),('0');
 
114
SET GLOBAL myisam_repair_threads=2;
 
115
REPAIR TABLE t1;
 
116
SET GLOBAL myisam_repair_threads=1;
 
117
SET GLOBAL myisam_sort_buffer_size=DEFAULT;
 
118
DROP TABLE t1;
 
119
 
 
120
--echo End of 4.1 tests
 
121
# End of 5.0 tests
 
122
 
 
123
#
 
124
# Bug#18775 - Temporary table from alter table visible to other threads
 
125
#
 
126
# REPAIR TABLE ... USE_FRM on temporary table crashed the table or server.
 
127
--disable_warnings
 
128
DROP TABLE IF EXISTS tt1;
 
129
--enable_warnings
 
130
CREATE TEMPORARY TABLE tt1 (c1 INT);
 
131
REPAIR TABLE tt1 USE_FRM;
 
132
DROP TABLE tt1;
 
133
 
 
134
SET GLOBAL myisam_sort_buffer_size=DEFAULT;