6
drop table if exists t1;
9
create table t1 SELECT 1,"table 1";
10
repair table t1 use_frm;
11
alter table t1 ENGINE=HEAP;
12
repair table t1 use_frm;
16
# disabled keys during repair
18
create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st));
19
insert into t1 values(1, "One");
20
alter table t1 disable keys;
22
repair table t1 extended;
28
repair table t1 use_frm;
30
create table t1 engine=myisam SELECT 1,"table 1";
32
let $MYSQLD_DATADIR= `select @@datadir`;
33
system echo 1 > $MYSQLD_DATADIR/test/t1.MYI ;
35
repair table t1 use_frm;
39
# BUG#18874 - Setting myisam_repair_threads > 1, index cardinality always 1
41
CREATE TABLE t1(a INT, KEY(a));
42
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
43
SET myisam_repair_threads=2;
46
SET myisam_repair_threads=@@global.myisam_repair_threads;
50
# BUG#22562 - REPAIR TABLE .. USE_FRM causes server crash on Windows and
51
# server hangs on Linux
53
CREATE TABLE t1(a INT);
55
REPAIR TABLE test.t1 USE_FRM;
60
# BUG#23175 - MYISAM crash/repair failed during repair
62
CREATE TABLE t1(a CHAR(255), KEY(a));
63
SET myisam_sort_buffer_size=4096;
65
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
66
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
67
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
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');
81
SET myisam_repair_threads=2;
83
SET myisam_repair_threads=@@global.myisam_repair_threads;
84
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
88
# BUG#31174 - "Repair" command on MyISAM crashes with small
89
# myisam_sort_buffer_size
91
CREATE TABLE t1(a CHAR(255), KEY(a));
92
SET myisam_sort_buffer_size=4496;
94
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
95
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
96
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
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');
110
SET myisam_repair_threads=2;
112
SET myisam_repair_threads=@@global.myisam_repair_threads;
113
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
116
--echo End of 4.1 tests
119
# BUG#36055 - mysql_upgrade doesn't really 'upgrade' tables
122
--echo # Test with a saved table from 4.1
123
let $MYSQLD_DATADIR= `select @@datadir`;
124
--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/t1.frm
125
--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/t1.MYD
126
--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/t1.MYI
128
--replace_column 12 # 13 #
129
SHOW TABLE STATUS LIKE 't1';
132
--echo # Run CHECK TABLE, it should indicate table need a REPAIR TABLE
133
CHECK TABLE t1 FOR UPGRADE;
135
--echo # REPAIR old table USE_FRM should fail
136
REPAIR TABLE t1 USE_FRM;
138
--echo # Run REPAIR TABLE to upgrade .frm file
140
--replace_column 12 # 13 #
141
SHOW TABLE STATUS LIKE 't1';
144
REPAIR TABLE t1 USE_FRM;
151
# Bug#18775 - Temporary table from alter table visible to other threads
153
# REPAIR TABLE ... USE_FRM on temporary table crashed the table or server.
155
DROP TABLE IF EXISTS tt1;
157
CREATE TEMPORARY TABLE tt1 (c1 INT);
158
REPAIR TABLE tt1 USE_FRM;