1
drop table if exists t1;
2
create table t1 ENGINE=MyISAM 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)) ENGINE=MyISAM;
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 Index_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 Index_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 error Corrupt
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)) ENGINE=MyISAM;
43
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
44
SET GLOBAL 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 Index_Comment
50
t1 1 a 1 a A 5 NULL NULL YES BTREE
51
SET GLOBAL myisam_repair_threads=1;
53
CREATE TABLE t1(a INT) ENGINE=MyISAM;
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)) ENGINE=MyISAM;
61
SET GLOBAL myisam_sort_buffer_size=4096;
62
SHOW VARIABLES LIKE "myisam_sort_buffer_size";
64
myisam_sort_buffer_size 4096
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'),('0'),('0'),('0'),
81
('0'),('0'),('0'),('0'),('0'),('0'),('0');
82
ERROR HY000: myisam_sort_buffer_size is too small
83
SET GLOBAL myisam_repair_threads=2;
85
Table Op Msg_type Msg_text
86
test.t1 repair error myisam_sort_buffer_size is too small
87
test.t1 repair warning Number of rows changed from 0 to 157
88
test.t1 repair status OK
89
SET GLOBAL myisam_repair_threads=1;
90
SET GLOBAL myisam_sort_buffer_size=DEFAULT;
92
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
93
SET GLOBAL myisam_sort_buffer_size=16384;
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'),('0'),('0'),('0'),
110
('0'),('0'),('0'),('0'),('0'),('0'),('0');
111
SET GLOBAL myisam_repair_threads=2;
113
Table Op Msg_type Msg_text
114
test.t1 repair status OK
115
SET GLOBAL myisam_repair_threads=1;
116
SET GLOBAL myisam_sort_buffer_size=DEFAULT;
119
DROP TABLE IF EXISTS tt1;
120
CREATE TEMPORARY TABLE tt1 (c1 INT);
121
REPAIR TABLE tt1 USE_FRM;
122
Table Op Msg_type Msg_text
123
tt1 repair error Cannot repair temporary table from .frm file
125
SET GLOBAL myisam_sort_buffer_size=DEFAULT;