~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/myisam.test

  • Committer: Brian Aker
  • Date: 2010-07-15 23:18:11 UTC
  • mto: This revision was merged to the branch mainline in revision 1661.
  • Revision ID: brian@gaz-20100715231811-c5erivy1nvwf6bii
Merge in move identifier work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
# Test problem with rows that are 65517-65520 bytes long
31
31
#
32
32
 
33
 
create temporary table t1 (a int not null auto_increment, b blob not null, primary key (a)) engine=myisam;
 
33
create table t1 (a int not null auto_increment, b blob not null, primary key (a));
34
34
 
35
35
let $1=100;
36
36
disable_query_log;
329
329
# Test of creating table with too long key
330
330
#
331
331
 
332
 
--error ER_TOO_LONG_KEY
 
332
--error 1071
333
333
CREATE TEMPORARY 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;
334
334
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
335
 
--error ER_TOO_LONG_KEY
 
335
--error 1071
336
336
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
337
337
DROP TABLE t1;
338
338
 
342
342
 
343
343
CREATE TEMPORARY TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
344
344
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
345
 
create temporary table t2 (a int not null, b int, c int, key(b), key(c), key(a)) engine=myisam;
 
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
347
alter table t1 ENGINE=MYISAM;
348
348
show index from t1;
361
361
# Test bug when updating a split dynamic row where keys are not changed
362
362
#
363
363
 
364
 
create temporary table t1 (a int not null auto_increment primary key, b varchar(255)) engine=myisam;
 
364
create table t1 (a int not null auto_increment primary key, b varchar(255));
365
365
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
366
366
update t1 set b=repeat(left(b,1),200) where a=1;
367
367
 
441
441
#
442
442
# Verify blob handling
443
443
#
444
 
create temporary table t1 (a blob) engine=myisam;
 
444
create table t1 (a blob);
445
445
insert into t1 values('a '),('a');
446
446
select concat(a,'.') from t1 where a='a';
447
447
select concat(a,'.') from t1 where a='a ';
453
453
#
454
454
# Test text and unique
455
455
#
456
 
create temporary table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20))) engine=myisam;
 
456
create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
457
457
insert into t1 (b) values ('a'),('b'),('c');
458
458
select concat(b,'.') from t1;
459
459
update t1 set b='b ' where a=2;
469
469
#
470
470
# Test keys with 0 segments. (Bug #3203)
471
471
#
472
 
create temporary table t1 (a int not null) engine=myisam;
473
 
create temporary table t2 (a int not null, primary key (a)) engine=myisam;
 
472
create table t1 (a int not null);
 
473
create table t2 (a int not null, primary key (a));
474
474
insert into t1 values (1);
475
475
insert into t2 values (1),(2);
476
476
select sql_big_result distinct t1.a from t1,t2 order by t2.a;
494
494
 
495
495
# End of 4.0 tests
496
496
 
497
 
create temporary table t1 (a int, b varchar(200), c text not null) engine=myisam;
498
 
create temporary table t2 (a int, b varchar(200), c text not null) engine=myisam;
 
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);
499
499
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
500
500
insert t2 select * from t1;
501
501
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
531
531
#
532
532
# index search for NULL in blob. Bug #4816
533
533
#
534
 
create temporary table t1 ( a tinytext, b char(1), index idx (a(1),b) ) engine=myisam;
 
534
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
535
535
insert into t1 values (null,''), (null,'');
536
536
explain select count(*) from t1 where a is null;
537
537
select count(*) from t1 where a is null;
540
540
#
541
541
# bug9188 - Corruption Can't open file: 'table.MYI' (errno: 145)
542
542
#
543
 
create temporary table t1 (c1 int, c2 varchar(4) not null default '',
544
 
                 key(c2(3))) engine=myisam;
 
543
create table t1 (c1 int, c2 varchar(4) not null default '',
 
544
                 key(c2(3)));
545
545
insert into t1 values (1,'A'), (2, 'B'), (3, 'A');
546
546
update t1 set c2='A  B' where c1=2;
547
547
check table t1;
549
549
 
550
550
# BUG#13814 - key value packed incorrectly for TINYBLOBs
551
551
 
552
 
create temporary table t1(
 
552
create table t1(
553
553
  cip INT NOT NULL,
554
554
  score INT NOT NULL DEFAULT 0,
555
555
  bob TINYBLOB
556
 
) engine=myisam;
 
556
);
557
557
 
558
558
insert into t1 (cip) VALUES (1), (2), (3);
559
559
insert into t1 (cip, bob) VALUES (4, 'a' ), (5, 'b'), 
596
596
#
597
597
# Bug#8283 - OPTIMIZE TABLE causes data loss
598
598
#
 
599
SET GLOBAL myisam_repair_threads=2;
 
600
SHOW VARIABLES LIKE 'myisam_repair%';
 
601
#
599
602
# Test OPTIMIZE. This creates a new data file.
600
603
CREATE TEMPORARY TABLE t1 (
601
604
  `_id` int NOT NULL default '0',
637
640
show table status LIKE 't1';
638
641
SELECT _id FROM t1;
639
642
DROP TABLE t1;
 
643
#
 
644
SET GLOBAL myisam_repair_threads=1;
 
645
SHOW VARIABLES LIKE 'myisam_repair%';
640
646
 
641
647
#
642
648
# Bug#24607 - MyISAM pointer size determined incorrectly
805
811
# Some errors/warnings on create
806
812
#
807
813
 
808
 
--error ER_TOO_BIG_FIELDLENGTH
 
814
--error 1074
809
815
create temporary table t1 (v varchar(65530), key(v));
810
 
--error ER_TOO_BIG_FIELDLENGTH
 
816
--error 1074
811
817
create temporary table t1 (v varchar(65536));
812
 
--error ER_TOO_BIG_FIELDLENGTH
 
818
--error 1074
813
819
create temporary table t1 (v varchar(65530));
814
820
 
815
821
# MyISAM specific varchar tests
816
 
--error ER_TOO_BIG_FIELDLENGTH
 
822
--error 1074
817
823
create temporary table t1 (v varchar(65535));
818
824
 
819
825
eval set storage_engine=$default;
821
827
 
822
828
# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
823
829
# different statistics on the same table with NULL values.
824
 
create temporary table t1 (a int, key(a)) engine=myisam;
 
830
create table t1 (a int, key(a));
825
831
 
826
832
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
827
833
analyze table t1;
875
881
#--exec myisamchk -dvv var/master-data/test/t1.MYI
876
882
#--exec myisamchk -iev var/master-data/test/t1.MYI
877
883
--echo # Enable keys with parallel repair
 
884
SET GLOBAL myisam_repair_threads=2;
878
885
ALTER TABLE t1 DISABLE KEYS;
879
886
ALTER TABLE t1 ENABLE KEYS;
 
887
SET GLOBAL myisam_repair_threads=1;
880
888
CHECK TABLE t1;
881
889
DROP TABLE t1;
882
890