1
drop table if exists t1;
2
create table t1 SELECT 1,"table 1";
3
repair table t1 use_frm;
4
Table Op Msg_type Msg_text
5
test.t1 repair warning Number of rows changed from 0 to 1
6
test.t1 repair status OK
7
alter table t1 ENGINE=HEAP;
8
repair table t1 use_frm;
9
Table Op Msg_type Msg_text
10
test.t1 repair note The storage engine for the table doesn't support repair
12
create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st));
13
insert into t1 values(1, "One");
14
alter table t1 disable keys;
16
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
17
t1 0 PRIMARY 1 id A 1 NULL NULL BTREE
18
t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled
19
repair table t1 extended;
20
Table Op Msg_type Msg_text
21
test.t1 repair status OK
23
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
24
t1 0 PRIMARY 1 id A 1 NULL NULL BTREE
25
t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled
27
repair table t1 use_frm;
28
Table Op Msg_type Msg_text
29
test.t1 repair Error Table 'test.t1' doesn't exist
30
test.t1 repair status Operation failed
31
create table t1 engine=myisam SELECT 1,"table 1";
34
Table Op Msg_type Msg_text
35
test.t1 repair Error Incorrect file format 't1'
36
test.t1 repair error Corrupt
37
repair table t1 use_frm;
38
Table Op Msg_type Msg_text
39
test.t1 repair warning Number of rows changed from 0 to 1
40
test.t1 repair status OK
42
CREATE TABLE t1(a INT, KEY(a));
43
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
44
SET myisam_repair_threads=2;
46
Table Op Msg_type Msg_text
47
test.t1 repair status OK
49
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
50
t1 1 a 1 a A 5 NULL NULL YES BTREE
51
SET myisam_repair_threads=@@global.myisam_repair_threads;
53
CREATE TABLE t1(a INT);
55
REPAIR TABLE test.t1 USE_FRM;
56
Table Op Msg_type Msg_text
57
test.t1 repair status OK
60
CREATE TABLE t1(a CHAR(255), KEY(a));
61
SET myisam_sort_buffer_size=4096;
63
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
64
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
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');
80
Error 1034 myisam_sort_buffer_size is too small
81
Error 1034 Number of rows changed from 0 to 157
82
SET myisam_repair_threads=2;
84
Table Op Msg_type Msg_text
85
test.t1 repair error myisam_sort_buffer_size is too small
86
test.t1 repair warning Number of rows changed from 0 to 157
87
test.t1 repair status OK
88
SET myisam_repair_threads=@@global.myisam_repair_threads;
89
SET myisam_sort_buffer_size=@@global.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
Table Op Msg_type Msg_text
113
test.t1 repair status OK
114
SET myisam_repair_threads=@@global.myisam_repair_threads;
115
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
118
# Test with a saved table from 4.1
119
SHOW TABLE STATUS LIKE 't1';
120
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
121
t1 MyISAM 9 Fixed 2 5 10 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
126
# Run CHECK TABLE, it should indicate table need a REPAIR TABLE
127
CHECK TABLE t1 FOR UPGRADE;
128
Table Op Msg_type Msg_text
129
test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
130
# REPAIR old table USE_FRM should fail
131
REPAIR TABLE t1 USE_FRM;
132
Table Op Msg_type Msg_text
133
t1 repair error Failed repairing incompatible .frm file
134
# Run REPAIR TABLE to upgrade .frm file
136
Table Op Msg_type Msg_text
137
test.t1 repair status OK
138
SHOW TABLE STATUS LIKE 't1';
139
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
140
t1 MyISAM 10 Fixed 2 7 14 1970324836974591 1024 0 NULL # # NULL latin1_swedish_ci NULL
145
REPAIR TABLE t1 USE_FRM;
146
Table Op Msg_type Msg_text
147
test.t1 repair warning Number of rows changed from 0 to 2
148
test.t1 repair status OK
154
DROP TABLE IF EXISTS tt1;
155
CREATE TEMPORARY TABLE tt1 (c1 INT);
156
REPAIR TABLE tt1 USE_FRM;
157
Table Op Msg_type Msg_text
158
tt1 repair error Cannot repair temporary table from .frm file