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 |
||
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; |
|
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)); |
|
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 |
repair table t1; |
|
34 |
repair table t1 use_frm; |
|
35 |
drop table t1; |
|
36 |
||
37 |
#
|
|
38 |
# BUG#18874 - Setting myisam_repair_threads > 1, index cardinality always 1
|
|
39 |
#
|
|
40 |
CREATE TABLE t1(a INT, KEY(a)); |
|
41 |
INSERT INTO t1 VALUES(1),(2),(3),(4),(5); |
|
42 |
SET myisam_repair_threads=2; |
|
43 |
REPAIR TABLE t1; |
|
44 |
SHOW INDEX FROM t1; |
|
45 |
SET myisam_repair_threads=@@global.myisam_repair_threads; |
|
46 |
DROP TABLE t1; |
|
47 |
||
48 |
#
|
|
49 |
# BUG#22562 - REPAIR TABLE .. USE_FRM causes server crash on Windows and
|
|
50 |
# server hangs on Linux
|
|
51 |
#
|
|
52 |
CREATE TABLE t1(a INT); |
|
53 |
USE mysql; |
|
54 |
REPAIR TABLE test.t1 USE_FRM; |
|
55 |
USE test; |
|
56 |
DROP TABLE t1; |
|
57 |
||
58 |
#
|
|
59 |
# BUG#23175 - MYISAM crash/repair failed during repair
|
|
60 |
#
|
|
61 |
CREATE TABLE t1(a CHAR(255), KEY(a)); |
|
62 |
SET myisam_sort_buffer_size=4096; |
|
63 |
INSERT INTO t1 VALUES |
|
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'),('0'),('0'),('0'), |
|
79 |
('0'),('0'),('0'),('0'),('0'),('0'),('0'); |
|
80 |
SET myisam_repair_threads=2; |
|
81 |
REPAIR TABLE t1; |
|
82 |
SET myisam_repair_threads=@@global.myisam_repair_threads; |
|
83 |
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; |
|
84 |
DROP TABLE t1; |
|
85 |
||
86 |
#
|
|
87 |
# BUG#31174 - "Repair" command on MyISAM crashes with small
|
|
88 |
# myisam_sort_buffer_size
|
|
89 |
#
|
|
90 |
CREATE TABLE t1(a CHAR(255), KEY(a)); |
|
91 |
SET myisam_sort_buffer_size=4496; |
|
92 |
INSERT INTO t1 VALUES |
|
93 |
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), |
|
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'); |
|
109 |
SET myisam_repair_threads=2; |
|
110 |
REPAIR TABLE t1; |
|
111 |
SET myisam_repair_threads=@@global.myisam_repair_threads; |
|
112 |
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; |
|
113 |
DROP TABLE t1; |
|
114 |
||
115 |
--echo End of 4.1 tests |
|
116 |
# End of 5.0 tests
|
|
117 |
||
118 |
#
|
|
119 |
# Bug#18775 - Temporary table from alter table visible to other threads
|
|
120 |
#
|
|
121 |
# REPAIR TABLE ... USE_FRM on temporary table crashed the table or server.
|
|
122 |
--disable_warnings |
|
123 |
DROP TABLE IF EXISTS tt1; |
|
124 |
--enable_warnings |
|
125 |
CREATE TEMPORARY TABLE tt1 (c1 INT); |
|
126 |
REPAIR TABLE tt1 USE_FRM; |
|
127 |
DROP TABLE tt1; |
|
128 |