60
60
# Test bug: Two optimize in a row reset index cardinality
63
create TEMPORARY table t1 (a int not null auto_increment, b int not null, primary key (a), index(b)) ENGINE=MYISAM;
63
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
64
64
insert into t1 (b) values (1),(2),(2),(2),(2);
65
alter table t1 engine=MYISAM;
66
66
show index from t1;
67
alter table t1 engine=MyISAM;
68
68
show index from t1;
89
89
# in ha_myisam::repair, and index size is changed (decreased).
92
create temporary table t1 ( t1 char(255), key(t1(250))) ENGINE=MYISAM;
92
create table t1 ( t1 char(255), key(t1(250)));
93
93
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
94
94
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
95
95
insert t1 values ('213872387238723872387238723872387238723867376737673767376737673767376737673767');
119
119
insert t1 values ('70'), ('84'), ('60'), ('20'), ('76'), ('89'), ('49'), ('50'),
120
120
('88'), ('61'), ('42'), ('98'), ('39'), ('30'), ('25'), ('66'), ('61'), ('48'),
121
121
('80'), ('84'), ('98'), ('19'), ('91'), ('42'), ('47');
122
alter table t1 ENGINE=myisam;
344
344
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
345
345
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
346
346
INSERT into t2 values (1,1,1), (2,2,2);
347
alter table t1 ENGINE=MYISAM;
348
348
show index from t1;
349
349
explain select * from t1,t2 where t1.a=t2.a;
350
350
explain select * from t1,t2 force index(a) where t1.a=t2.a;
495
495
# End of 4.0 tests
497
create table t1 (a int, b varchar(200), c text not null);
498
create table t2 (a int, b varchar(200), c text not null);
497
create table t1 (a int, b varchar(200), c text not null) checksum=1;
498
create table t2 (a int, b varchar(200), c text not null) checksum=0;
499
499
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
500
500
insert t2 select * from t1;
501
checksum table t1, t2, t3;
502
checksum table t1, t2, t3;
503
checksum table t1, t2, t3;
504
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
501
checksum table t1, t2, t3 quick;
502
checksum table t1, t2, t3;
503
checksum table t1, t2, t3 extended;
506
505
drop table t1,t2;
508
507
#@TODO Figure out what the heck the below is testing.
651
650
SELECT _id FROM t1;
652
651
DELETE FROM t1 WHERE _id < 8;
653
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
654
show table status LIKE 't1';
656
ALTER TABLE t1 ENGINE=MYISAM;
658
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
659
show table status LIKE 't1';
652
--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
653
SHOW TABLE STATUS LIKE 't1';
654
CHECK TABLE t1 EXTENDED;
656
CHECK TABLE t1 EXTENDED;
657
--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
658
SHOW TABLE STATUS LIKE 't1';
660
659
SELECT _id FROM t1;
667
666
# Bug#24607 - MyISAM pointer size determined incorrectly
669
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM;
670
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
671
show table status like 't1';
668
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
669
--replace_column 5 X 6 X 7 X 9 X 10 X 11 X 12 X 13 X 14 X 16 X
670
SHOW TABLE STATUS LIKE 't1';
862
# Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
864
create temporary table t1 (c1 int) engine=myisam pack_keys=0;
865
create temporary table t2 (c1 int) engine=myisam pack_keys=1;
866
create temporary table t3 (c1 int) engine=myisam pack_keys=default;
868
create temporary table t4 (c1 int) engine=myisam pack_keys=2;
869
drop table t1, t2, t3;
863
873
# Bug#28476: force index on a disabled myisam index gives error 124
865
875
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
879
889
# Bug#4692 - DISABLE/ENABLE KEYS waste a space
881
891
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
882
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
883
show table status like 't1';
892
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
893
SHOW TABLE STATUS LIKE 't1';
884
894
INSERT INTO t1 VALUES (1,1);
885
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
886
show table status like 't1';
887
ALTER TABLE t1 DISABLE KEYS;
888
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
889
show table status like 't1';
890
ALTER TABLE t1 ENABLE KEYS;
891
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
892
show table status like 't1';
893
ALTER TABLE t1 DISABLE KEYS;
894
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
895
show table status like 't1';
896
ALTER TABLE t1 ENABLE KEYS;
897
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
898
show table status like 't1';
895
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
896
SHOW TABLE STATUS LIKE 't1';
897
ALTER TABLE t1 DISABLE KEYS;
898
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
899
SHOW TABLE STATUS LIKE 't1';
900
ALTER TABLE t1 ENABLE KEYS;
901
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
902
SHOW TABLE STATUS LIKE 't1';
903
ALTER TABLE t1 DISABLE KEYS;
904
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
905
SHOW TABLE STATUS LIKE 't1';
906
ALTER TABLE t1 ENABLE KEYS;
907
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
908
SHOW TABLE STATUS LIKE 't1';
899
909
#--exec ls -log var/master-data/test/t1.MYI
900
910
#--exec myisamchk -dvv var/master-data/test/t1.MYI
901
911
#--exec myisamchk -iev var/master-data/test/t1.MYI
1142
1152
# Using Tamil Letter A, Unicode U+0B85
1143
1153
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1144
1154
SELECT COUNT(*) FROM t1;
1155
CHECK TABLE t1 EXTENDED;
1146
1156
SELECT COUNT(*) FROM t1;
1157
CHECK TABLE t1 EXTENDED;
1150
1160
# Test #7 - same as test #3, but UTF-8.
1197
1207
# With bug present, this shows that all long rows are gone.
1198
1208
SELECT COUNT(*) FROM t1;
1199
1209
CHECK TABLE t1;
1210
CHECK TABLE t1 EXTENDED;
1214
# Bug#29182 - MyISAMCHK reports wrong character set
1216
#@TODO Disabling the below, as no myisamcheck program
1218
# c1 VARCHAR(10) NOT NULL,
1219
# c2 CHAR(10) DEFAULT NULL,
1220
# c3 VARCHAR(10) NOT NULL,
1223
#) ENGINE=MyISAM PACK_KEYS=0;
1224
#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
1225
#--exec $DRIZZLECHK -d $MYSQLTEST_VARDIR/master-data/test/t1
1202
1228
--echo End of 5.1 tests