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.
566
565
checksum table t2;
567
566
drop table t1, t2;
569
# BUG#12232: New myisam_stats_method variable.
571
# @TODO The following segfaults. Disabling for now - JRP
573
#show variables like 'myisam_stats_method';
575
#create table t1 (a int, key(a));
576
#insert into t1 values (0),(1),(2),(3),(4);
577
#insert into t1 select NULL from t1;
579
# default: NULLs considered inequal
582
#insert into t1 values (11);
583
#delete from t1 where a=11;
587
# Set nulls to be equal:
588
#set myisam_stats_method=nulls_equal;
589
#show variables like 'myisam_stats_method';
590
#insert into t1 values (11);
591
#delete from t1 where a=11;
596
#insert into t1 values (11);
597
#delete from t1 where a=11;
602
# Set nulls back to be equal
603
#set myisam_stats_method=DEFAULT;
604
#show variables like 'myisam_stats_method';
605
#insert into t1 values (11);
606
#delete from t1 where a=11;
611
#insert into t1 values (11);
612
#delete from t1 where a=11;
619
# WL#2609, CSC#XXXX: MyISAM
620
#set myisam_stats_method=nulls_ignored;
621
#show variables like 'myisam_stats_method';
624
# a char(3), b char(4), c char(5), d char(6),
627
#insert into t1 values ('bcd','def1', NULL, 'zz');
628
#insert into t1 values ('bcd','def2', NULL, 'zz');
629
#insert into t1 values ('bce','def1', 'yuu', NULL);
630
#insert into t1 values ('bce','def2', NULL, 'quux');
637
#set myisam_stats_method=DEFAULT;
569
640
# BUG#13814 - key value packed incorrectly for TINYBLOBs
651
722
SELECT _id FROM t1;
652
723
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';
724
--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
725
SHOW TABLE STATUS LIKE 't1';
726
CHECK TABLE t1 EXTENDED;
728
CHECK TABLE t1 EXTENDED;
729
--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
730
SHOW TABLE STATUS LIKE 't1';
660
731
SELECT _id FROM t1;
667
738
# 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';
740
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100;
741
--replace_column 5 X 6 X 7 X 9 X 10 X 11 X 12 X 13 X 14 X 16 X
742
SHOW TABLE STATUS LIKE 't1';
934
# Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
936
create temporary table t1 (c1 int) engine=myisam pack_keys=0;
937
create temporary table t2 (c1 int) engine=myisam pack_keys=1;
938
create temporary table t3 (c1 int) engine=myisam pack_keys=default;
940
create temporary table t4 (c1 int) engine=myisam pack_keys=2;
941
drop table t1, t2, t3;
863
945
# Bug#28476: force index on a disabled myisam index gives error 124
865
947
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
879
961
# Bug#4692 - DISABLE/ENABLE KEYS waste a space
881
963
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';
964
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
965
SHOW TABLE STATUS LIKE 't1';
884
966
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';
967
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
968
SHOW TABLE STATUS LIKE 't1';
969
ALTER TABLE t1 DISABLE KEYS;
970
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
971
SHOW TABLE STATUS LIKE 't1';
972
ALTER TABLE t1 ENABLE KEYS;
973
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
974
SHOW TABLE STATUS LIKE 't1';
975
ALTER TABLE t1 DISABLE KEYS;
976
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
977
SHOW TABLE STATUS LIKE 't1';
978
ALTER TABLE t1 ENABLE KEYS;
979
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
980
SHOW TABLE STATUS LIKE 't1';
899
981
#--exec ls -log var/master-data/test/t1.MYI
900
982
#--exec myisamchk -dvv var/master-data/test/t1.MYI
901
983
#--exec myisamchk -iev var/master-data/test/t1.MYI
1197
1279
# With bug present, this shows that all long rows are gone.
1198
1280
SELECT COUNT(*) FROM t1;
1199
1281
CHECK TABLE t1;
1282
CHECK TABLE t1 EXTENDED;
1286
# Bug#29182 - MyISAMCHK reports wrong character set
1288
#@TODO Disabling the below, as no myisamcheck program
1290
# c1 VARCHAR(10) NOT NULL,
1291
# c2 CHAR(10) DEFAULT NULL,
1292
# c3 VARCHAR(10) NOT NULL,
1295
#) ENGINE=MyISAM PACK_KEYS=0;
1296
#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
1297
#--exec $DRIZZLECHK -d $MYSQLTEST_VARDIR/master-data/test/t1
1202
1300
--echo End of 5.1 tests