~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/repair.test

Merged Nathan from lp:~nlws/drizzle/fix-string-c-ptr-overrun

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
drop table if exists t1;
7
7
--enable_warnings
8
8
 
9
 
create table t1 SELECT 1,"table 1";
 
9
create table t1 ENGINE=MyISAM SELECT 1,"table 1";
10
10
repair table t1 use_frm;
11
11
alter table t1 ENGINE=HEAP;
12
12
repair table t1 use_frm;
15
15
#
16
16
# disabled keys during repair
17
17
#
18
 
create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st));
 
18
create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st)) ENGINE=MyISAM;
19
19
insert into t1 values(1, "One");
20
20
alter table t1 disable keys;
21
21
show keys from t1;
29
29
 
30
30
create table t1 engine=myisam SELECT 1,"table 1";
31
31
flush tables;
32
 
system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
 
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
33
35
repair table t1;
34
36
repair table t1 use_frm;
35
37
drop table t1;
37
39
#
38
40
# BUG#18874 - Setting myisam_repair_threads > 1, index cardinality always 1
39
41
#
40
 
CREATE TABLE t1(a INT, KEY(a));
 
42
CREATE TABLE t1(a INT, KEY(a)) ENGINE=MyISAM;
41
43
INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
42
 
SET myisam_repair_threads=2;
 
44
SET GLOBAL myisam_repair_threads=2;
43
45
REPAIR TABLE t1;
44
46
SHOW INDEX FROM t1;
45
 
SET myisam_repair_threads=@@global.myisam_repair_threads;
 
47
SET GLOBAL myisam_repair_threads=1;
46
48
DROP TABLE t1;
47
49
 
48
50
#
49
51
# BUG#22562 - REPAIR TABLE .. USE_FRM causes server crash on Windows and
50
52
#             server hangs on Linux
51
53
#
52
 
CREATE TABLE t1(a INT);
 
54
CREATE TABLE t1(a INT) ENGINE=MyISAM;
53
55
USE mysql;
54
56
REPAIR TABLE test.t1 USE_FRM;
55
57
USE test;
58
60
#
59
61
# BUG#23175 - MYISAM crash/repair failed during repair
60
62
#
61
 
CREATE TABLE t1(a CHAR(255), KEY(a));
62
 
SET myisam_sort_buffer_size=4096;
 
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
63
68
INSERT INTO t1 VALUES
64
69
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
65
70
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
77
82
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
78
83
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
79
84
('0'),('0'),('0'),('0'),('0'),('0'),('0');
80
 
SET myisam_repair_threads=2;
 
85
SET GLOBAL myisam_repair_threads=2;
81
86
REPAIR TABLE t1;
82
 
SET myisam_repair_threads=@@global.myisam_repair_threads;
83
 
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
 
87
SET GLOBAL myisam_repair_threads=1;
 
88
SET GLOBAL myisam_sort_buffer_size=DEFAULT;
84
89
DROP TABLE t1;
85
90
 
86
91
#
87
92
# BUG#31174 - "Repair" command on MyISAM crashes with small 
88
93
#              myisam_sort_buffer_size
89
94
#
90
 
CREATE TABLE t1(a CHAR(255), KEY(a));
91
 
SET myisam_sort_buffer_size=4496;
 
95
CREATE TABLE t1(a CHAR(255), KEY(a)) ENGINE=MyISAM;
 
96
SET GLOBAL myisam_sort_buffer_size=16384;
92
97
INSERT INTO t1 VALUES
93
98
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
94
99
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
106
111
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
107
112
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
108
113
('0'),('0'),('0'),('0'),('0'),('0'),('0');
109
 
SET myisam_repair_threads=2;
 
114
SET GLOBAL myisam_repair_threads=2;
110
115
REPAIR TABLE t1;
111
 
SET myisam_repair_threads=@@global.myisam_repair_threads;
112
 
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
 
116
SET GLOBAL myisam_repair_threads=1;
 
117
SET GLOBAL myisam_sort_buffer_size=DEFAULT;
113
118
DROP TABLE t1;
114
119
 
115
120
--echo End of 4.1 tests
126
131
REPAIR TABLE tt1 USE_FRM;
127
132
DROP TABLE tt1;
128
133
 
 
134
SET GLOBAL myisam_sort_buffer_size=DEFAULT;