257
264
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
258
265
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
259
266
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
260
int, i999 int, i1000 int, b blob) row_format=dynamic;
267
int, i999 int, i1000 int, b blob) engine=myisam row_format=dynamic;
261
268
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
262
269
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
263
270
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
309
316
# Test of REPAIR that once failed
311
318
CREATE TABLE `t1` (
312
`post_id` mediumint(8) NOT NULL auto_increment,
313
`topic_id` mediumint(8) NOT NULL default '0',
314
`post_time` datetime NOT NULL default '0000-00-00 00:00:00',
319
`post_id` int NOT NULL auto_increment,
320
`topic_id` int NOT NULL default '0',
321
`post_time` datetime,
315
322
`post_text` text NOT NULL,
316
323
`icon_url` varchar(10) NOT NULL default '',
317
`sign` int(1) NOT NULL default '0',
324
`sign` int NOT NULL default '0',
318
325
`post_edit` varchar(150) NOT NULL default '',
319
326
`poster_login` varchar(35) NOT NULL default '',
320
327
`ip` varchar(15) NOT NULL default '',
340
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e));
341
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300));
350
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e)) ENGINE=MyISAM;
351
CREATE TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
343
353
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
347
357
# Test of cardinality of keys with NULL
350
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
360
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
351
361
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
352
362
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
353
363
INSERT into t2 values (1,1,1), (2,2,2);
371
381
create table t1 (a int not null auto_increment primary key, b varchar(255));
372
382
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
373
383
update t1 set b=repeat(left(b,1),200) where a=1;
374
delete from t1 where (a & 1)= 0;
385
# @TODO Because there are no notes on what the heck this
386
# is actually testing (which bug?), it's difficult to tell
387
# what the below DELETE statement is doing. Since we don't
388
# support bitwise operators, I am replacing the delete statement
389
# with a version we support.
390
#delete from t1 where (a & 1)= 0;
391
delete from t1 where (a mod 2) = 0;
375
392
update t1 set b=repeat('e',200) where a=1;
492
514
# Bug #14400 Join could miss concurrently inserted row
516
# @TODO The below test hangs drizzle. Commenting out for now so I can continue with this test. - JRP
495
create table t1 (a int not null, primary key(a));
496
create table t2 (a int not null, b int not null, primary key(a,b));
497
insert into t1 values (1),(2),(3),(4),(5),(6);
498
insert into t2 values (1,1),(2,1);
499
lock tables t1 read local, t2 read local;
500
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
501
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
502
insert into t2 values(2,0);
505
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
519
#create table t1 (a int not null, primary key(a));
520
#create table t2 (a int not null, b int not null, primary key(a,b));
521
#insert into t1 values (1),(2),(3),(4),(5),(6);
522
#insert into t2 values (1,1),(2,1);
523
#lock tables t1 read local, t2 read local;
524
#select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
525
#connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
526
#insert into t2 values(2,0);
529
#select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
510
CREATE TABLE t1 (c1 varchar(250) NOT NULL);
511
CREATE TABLE t2 (c1 varchar(250) NOT NULL, PRIMARY KEY (c1));
512
INSERT INTO t1 VALUES ('test000001'), ('test000002'), ('test000003');
513
INSERT INTO t2 VALUES ('test000002'), ('test000003'), ('test000004');
514
LOCK TABLES t1 READ LOCAL, t2 READ LOCAL;
515
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
516
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
517
connect (con1,localhost,root,,);
519
INSERT INTO t2 VALUES ('test000001'), ('test000005');
522
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
523
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
534
#CREATE TABLE t1 (c1 varchar(250) NOT NULL);
535
#CREATE TABLE t2 (c1 varchar(250) NOT NULL, PRIMARY KEY (c1));
536
#INSERT INTO t1 VALUES ('test000001'), ('test000002'), ('test000003');
537
#INSERT INTO t2 VALUES ('test000002'), ('test000003'), ('test000004');
538
#LOCK TABLES t1 READ LOCAL, t2 READ LOCAL;
539
#SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
540
# WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
541
#connect (con1,localhost,root,,);
543
#INSERT INTO t2 VALUES ('test000001'), ('test000005');
546
#SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
547
# WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
527
551
# End of 4.0 tests
533
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
534
# INSERT INTO t1 VALUES (1,1),(1,1);
535
# DELETE FROM rt WHERE a<1;
536
# DROP TABLE IF EXISTS t1;
538
553
create table t1 (a int, b varchar(200), c text not null) checksum=1;
539
554
create table t2 (a int, b varchar(200), c text not null) checksum=0;
540
555
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
545
560
#show table status;
546
561
drop table t1,t2;
548
create table t1 (a int, key (a));
550
alter table t1 disable keys;
552
create table t2 (a int);
554
set @@rand_seed1=31415926,@@rand_seed2=2718281828;
559
insert t2 values (rand()*100000);
562
insert t1 select * from t2;
564
alter table t1 enable keys;
566
alter table t1 engine=heap;
567
alter table t1 disable keys;
563
#@TODO Figure out what the heck the below is testing.
564
# It bombs the test with unknown system variables...
566
#create table t1 (a int, key (a));
568
#alter table t1 disable keys;
570
#create table t2 (a int);
572
#set @@rand_seed1=31415926,@@rand_seed2=2718281828;
577
# insert t2 values (rand()*100000);
580
#insert t1 select * from t2;
582
#alter table t1 enable keys;
584
#alter table t1 engine=heap;
585
#alter table t1 disable keys;
572
590
# index search for NULL in blob. Bug #4816
607
625
# BUG#12232: New myisam_stats_method variable.
610
show variables like 'myisam_stats_method';
612
create table t1 (a int, key(a));
613
insert into t1 values (0),(1),(2),(3),(4);
614
insert into t1 select NULL from t1;
627
# @TODO The following segfaults. Disabling for now - JRP
629
#show variables like 'myisam_stats_method';
631
#create table t1 (a int, key(a));
632
#insert into t1 values (0),(1),(2),(3),(4);
633
#insert into t1 select NULL from t1;
616
635
# default: NULLs considered inequal
619
insert into t1 values (11);
620
delete from t1 where a=11;
638
#insert into t1 values (11);
639
#delete from t1 where a=11;
624
643
# Set nulls to be equal:
625
set myisam_stats_method=nulls_equal;
626
show variables like 'myisam_stats_method';
627
insert into t1 values (11);
628
delete from t1 where a=11;
633
insert into t1 values (11);
634
delete from t1 where a=11;
644
#set myisam_stats_method=nulls_equal;
645
#show variables like 'myisam_stats_method';
646
#insert into t1 values (11);
647
#delete from t1 where a=11;
652
#insert into t1 values (11);
653
#delete from t1 where a=11;
639
658
# Set nulls back to be equal
640
set myisam_stats_method=DEFAULT;
641
show variables like 'myisam_stats_method';
642
insert into t1 values (11);
643
delete from t1 where a=11;
648
insert into t1 values (11);
649
delete from t1 where a=11;
659
#set myisam_stats_method=DEFAULT;
660
#show variables like 'myisam_stats_method';
661
#insert into t1 values (11);
662
#delete from t1 where a=11;
667
#insert into t1 values (11);
668
#delete from t1 where a=11;
656
675
# WL#2609, CSC#XXXX: MyISAM
657
set myisam_stats_method=nulls_ignored;
658
show variables like 'myisam_stats_method';
661
a char(3), b char(4), c char(5), d char(6),
664
insert into t1 values ('bcd','def1', NULL, 'zz');
665
insert into t1 values ('bcd','def2', NULL, 'zz');
666
insert into t1 values ('bce','def1', 'yuu', NULL);
667
insert into t1 values ('bce','def2', NULL, 'quux');
674
set myisam_stats_method=DEFAULT;
676
#set myisam_stats_method=nulls_ignored;
677
#show variables like 'myisam_stats_method';
680
# a char(3), b char(4), c char(5), d char(6),
683
#insert into t1 values ('bcd','def1', NULL, 'zz');
684
#insert into t1 values ('bcd','def2', NULL, 'zz');
685
#insert into t1 values ('bce','def1', 'yuu', NULL);
686
#insert into t1 values ('bce','def2', NULL, 'quux');
693
#set myisam_stats_method=DEFAULT;
677
696
# BUG#13814 - key value packed incorrectly for TINYBLOBs
734
753
# Bug#8283 - OPTIMIZE TABLE causes data loss
736
SET @@myisam_repair_threads=2;
755
SET GLOBAL myisam_repair_threads=2;
737
756
SHOW VARIABLES LIKE 'myisam_repair%';
739
758
# Test OPTIMIZE. This creates a new data file.
740
759
CREATE TABLE t1 (
741
`_id` int(11) NOT NULL default '0',
760
`_id` int NOT NULL default '0',
744
763
`description` text,
745
`loverlap` int(11) default NULL,
746
`roverlap` int(11) default NULL,
747
`lneighbor_id` int(11) default NULL,
748
`rneighbor_id` int(11) default NULL,
749
`length_` int(11) default NULL,
750
`sequence` mediumtext,
764
`loverlap` int default NULL,
765
`roverlap` int default NULL,
766
`lneighbor_id` int default NULL,
767
`rneighbor_id` int default NULL,
768
`length_` int default NULL,
752
771
`_obj_class` text NOT NULL,
753
772
PRIMARY KEY (`_id`),
754
773
UNIQUE KEY `sequence_name_index` (`name`(50)),
756
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
758
777
INSERT INTO t1 VALUES
759
778
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
760
779
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
781
800
# Test REPAIR QUICK. This retains the old data file.
782
801
CREATE TABLE t1 (
783
`_id` int(11) NOT NULL default '0',
802
`_id` int NOT NULL default '0',
786
805
`description` text,
787
`loverlap` int(11) default NULL,
788
`roverlap` int(11) default NULL,
789
`lneighbor_id` int(11) default NULL,
790
`rneighbor_id` int(11) default NULL,
791
`length_` int(11) default NULL,
792
`sequence` mediumtext,
806
`loverlap` int default NULL,
807
`roverlap` int default NULL,
808
`lneighbor_id` int default NULL,
809
`rneighbor_id` int default NULL,
810
`length_` int default NULL,
794
813
`_obj_class` text NOT NULL,
795
814
PRIMARY KEY (`_id`),
796
815
UNIQUE KEY `sequence_name_index` (`name`(50)),
798
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
800
819
INSERT INTO t1 VALUES
801
820
(1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
802
821
(2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
1027
1044
# Test concurrent insert
1028
1045
# First with static record length
1030
set @save_concurrent_insert=@@concurrent_insert;
1031
set global concurrent_insert=1;
1032
create table t1 (a int);
1033
insert into t1 values (1),(2),(3),(4),(5);
1034
lock table t1 read local;
1035
connect (con1,localhost,root,,);
1047
#@TODO The below test fails with unknown system variable
1050
#set @save_concurrent_insert=@@concurrent_insert;
1051
#set global concurrent_insert=1;
1052
#create table t1 (a int);
1053
#insert into t1 values (1),(2),(3),(4),(5);
1054
#lock table t1 read local;
1055
#connect (con1,localhost,root,,);
1037
1057
# Insert in table without hole
1038
insert into t1 values(6),(7);
1041
delete from t1 where a>=3 and a<=4;
1042
lock table t1 read local;
1044
set global concurrent_insert=2;
1058
#insert into t1 values(6),(7);
1059
#connection default;
1061
#delete from t1 where a>=3 and a<=4;
1062
#lock table t1 read local;
1064
#set global concurrent_insert=2;
1045
1065
# Insert in table with hole -> Should insert at end
1046
insert into t1 values (8),(9);
1066
#insert into t1 values (8),(9);
1067
#connection default;
1049
1069
# Insert into hole
1050
insert into t1 values (10),(11),(12);
1070
#insert into t1 values (10),(11),(12);
1056
1076
# Same test with dynamic record length
1057
create table t1 (a int, b varchar(30) default "hello");
1058
insert into t1 (a) values (1),(2),(3),(4),(5);
1059
lock table t1 read local;
1060
connect (con1,localhost,root,,);
1077
#create table t1 (a int, b varchar(30) default "hello");
1078
#insert into t1 (a) values (1),(2),(3),(4),(5);
1079
#lock table t1 read local;
1080
#connect (con1,localhost,root,,);
1062
1082
# Insert in table without hole
1063
insert into t1 (a) values(6),(7);
1066
delete from t1 where a>=3 and a<=4;
1067
lock table t1 read local;
1069
set global concurrent_insert=2;
1070
# Insert in table with hole -> Should insert at end
1071
insert into t1 (a) values (8),(9);
1083
#insert into t1 (a) values(6),(7);
1084
#connection default;
1086
#delete from t1 where a>=3 and a<=4;
1087
#lock table t1 read local;
1089
#set global concurrent_insert=2;
1090
## Insert in table with hole -> Should insert at end
1091
#insert into t1 (a) values (8),(9);
1092
#connection default;
1074
1094
# Insert into hole
1075
insert into t1 (a) values (10),(11),(12);
1080
set global concurrent_insert=@save_concurrent_insert;
1095
#insert into t1 (a) values (10),(11),(12);
1100
#set global concurrent_insert=@save_concurrent_insert;
1083
1103
# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
1178
1198
# Test of key_block_size
1181
create table t1 (a int not null, key `a` (a) key_block_size=1024);
1182
show create table t1;
1185
create table t1 (a int not null, key `a` (a) key_block_size=2048);
1186
show create table t1;
1189
create table t1 (a varchar(2048), key `a` (a));
1190
show create table t1;
1193
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
1194
show create table t1;
1197
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
1201
create table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1202
show create table t1;
1205
create table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
1206
show create table t1;
1209
create table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
1210
show create table t1;
1213
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
1214
show create table t1;
1217
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
1198
1218
show create table t1;
1199
1219
alter table t1 key_block_size=2048;
1200
1220
show create table t1;
1205
1225
show create table t1;
1208
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
1209
show create table t1;
1212
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
1213
show create table t1;
1216
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
1228
create table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
1229
show create table t1;
1232
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) ENGINE=MyISAM key_block_size=8192;
1233
show create table t1;
1236
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) ENGINE=MyISAM key_block_size=16384;
1217
1237
show create table t1;
1221
1241
# Test limits and errors of key_block_size
1223
create table t1 (a int not null, key `a` (a) key_block_size=512);
1224
show create table t1;
1227
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
1228
show create table t1;
1231
create table t1 (a int not null, key `a` (a) key_block_size=1025);
1232
show create table t1;
1236
create table t1 (a int not null, key key_block_size=1024 (a));
1238
create table t1 (a int not null, key `a` key_block_size=1024 (a));
1243
create table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
1244
show create table t1;
1247
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
1248
show create table t1;
1251
create table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
1252
show create table t1;
1256
create table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
1258
create table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
1241
1261
# Bug#22119 - Changing MI_KEY_BLOCK_LENGTH makes a wrong myisamchk