~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/myisam.test

  • Committer: Brian Aker
  • Date: 2009-08-15 00:59:30 UTC
  • mfrom: (1115.1.7 merge)
  • Revision ID: brian@gaz-20090815005930-q47yenjrq1esiwsz
Merge of Trond + Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
# Test bug: Two optimize in a row reset index cardinality
61
61
#
62
62
 
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;
 
65
optimize table t1;
66
66
show index from t1;
67
 
alter table t1 engine=MyISAM;
 
67
optimize table t1;
68
68
show index from t1;
69
69
drop table t1;
70
70
 
89
89
# in ha_myisam::repair, and index size is changed (decreased).
90
90
#
91
91
 
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;
 
122
optimize table t1;
123
123
check table t1;
124
124
drop table t1;
125
125
 
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;
 
347
optimize table t1;
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;
494
494
 
495
495
# End of 4.0 tests
496
496
 
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 #
505
 
show table status;
 
501
checksum table t1, t2, t3 quick;
 
502
checksum table t1, t2, t3;
 
503
checksum table t1, t2, t3 extended;
 
504
#show table status;
506
505
drop table t1,t2;
507
506
 
508
507
#@TODO Figure out what the heck the below is testing.
526
525
#show keys from t1;
527
526
#alter table t1 enable keys;
528
527
#show keys from t1;
529
 
#alter table t1 engine=MEMORY;
 
528
#alter table t1 engine=heap;
530
529
#alter table t1 disable keys;
531
530
#show keys from t1;
532
531
#drop table t1,t2;
650
649
#
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';
655
 
CHECK TABLE t1;
656
 
ALTER TABLE t1 ENGINE=MYISAM;
657
 
CHECK TABLE t1;
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;
 
655
OPTIMIZE TABLE t1;
 
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;
661
660
DROP TABLE t1;
662
661
#
666
665
#
667
666
# Bug#24607 - MyISAM pointer size determined incorrectly
668
667
#
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';
672
671
DROP TABLE t1;
673
672
 
674
673
#
860
859
 
861
860
 
862
861
#
 
862
# Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
 
863
#
 
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;
 
867
--error 1064
 
868
create temporary table t4 (c1 int) engine=myisam pack_keys=2;
 
869
drop table t1, t2, t3;
 
870
 
 
871
 
 
872
#
863
873
# Bug#28476: force index on a disabled myisam index gives error 124
864
874
#
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
880
890
#
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
904
914
ALTER TABLE t1 DISABLE KEYS;
905
915
ALTER TABLE t1 ENABLE KEYS;
906
916
SET GLOBAL myisam_repair_threads=1;
907
 
CHECK TABLE t1;
 
917
CHECK TABLE t1 EXTENDED;
908
918
DROP TABLE t1;
909
919
 
910
920
#
1061
1071
) ENGINE=MyISAM;
1062
1072
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1063
1073
SELECT COUNT(*) FROM t1;
1064
 
CHECK TABLE t1;
 
1074
CHECK TABLE t1 EXTENDED;
1065
1075
SELECT COUNT(*) FROM t1;
1066
 
CHECK TABLE t1;
 
1076
CHECK TABLE t1 EXTENDED;
1067
1077
DROP TABLE t1;
1068
1078
#
1069
1079
# Test #3 - same as test #1, but using OPTIMIZE TABLE.
1079
1089
INSERT INTO t1 VALUES('c', 'b');
1080
1090
DELETE FROM t1 WHERE c1='b';
1081
1091
SELECT COUNT(*) FROM t1;
1082
 
ALTER TABLE t1 ENGINE=MyISAM;
 
1092
OPTIMIZE TABLE t1;
1083
1093
SELECT COUNT(*) FROM t1;
1084
1094
DROP TABLE t1;
1085
1095
#
1114
1124
# With bug present, this shows that all long rows are gone.
1115
1125
SELECT COUNT(*) FROM t1;
1116
1126
CHECK TABLE t1;
1117
 
CHECK TABLE t1;
 
1127
CHECK TABLE t1 EXTENDED;
1118
1128
DROP TABLE t1;
1119
1129
#
1120
1130
# Test #5 - same as test #1 but UTF-8.
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;
1145
 
CHECK TABLE t1;
 
1155
CHECK TABLE t1 EXTENDED;
1146
1156
SELECT COUNT(*) FROM t1;
1147
 
CHECK TABLE t1;
 
1157
CHECK TABLE t1 EXTENDED;
1148
1158
DROP TABLE t1;
1149
1159
#
1150
1160
# Test #7 - same as test #3, but UTF-8.
1161
1171
INSERT INTO t1 VALUES('c', 'b');
1162
1172
DELETE FROM t1 WHERE c1='b';
1163
1173
SELECT COUNT(*) FROM t1;
1164
 
ALTER TABLE t1 ENGINE=MyISAM;
 
1174
OPTIMIZE TABLE t1;
1165
1175
SELECT COUNT(*) FROM t1;
1166
1176
DROP TABLE t1;
1167
1177
#
1197
1207
# With bug present, this shows that all long rows are gone.
1198
1208
SELECT COUNT(*) FROM t1;
1199
1209
CHECK TABLE t1;
1200
 
CHECK TABLE t1;
 
1210
CHECK TABLE t1 EXTENDED;
1201
1211
DROP TABLE t1;
 
1212
 
 
1213
#
 
1214
# Bug#29182 - MyISAMCHK reports wrong character set
 
1215
#
 
1216
#@TODO Disabling the below, as no myisamcheck program
 
1217
#CREATE TABLE t1 (
 
1218
#  c1 VARCHAR(10) NOT NULL,
 
1219
#  c2 CHAR(10) DEFAULT NULL,
 
1220
#  c3 VARCHAR(10) NOT NULL,
 
1221
#  KEY (c1),
 
1222
#  KEY (c2)
 
1223
#) ENGINE=MyISAM PACK_KEYS=0;
 
1224
#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
1225
#--exec $DRIZZLECHK -d $MYSQLTEST_VARDIR/master-data/test/t1
 
1226
#DROP TABLE t1;
 
1227
#
1202
1228
--echo End of 5.1 tests
1203
1229