diff options
Diffstat (limited to 'mysql-test/t/myisam.test')
-rw-r--r-- | mysql-test/t/myisam.test | 148 |
1 files changed, 133 insertions, 15 deletions
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index ce40cae3266..fb90c16bb86 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -450,11 +450,14 @@ drop table t1; # Test text and unique # create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20))); -insert into t1 (b) values ('a'),('a '),('a '); +insert into t1 (b) values ('a'),('b'),('c'); select concat(b,'.') from t1; update t1 set b='b ' where a=2; --error 1062 update t1 set b='b ' where a > 1; +--error 1062 +insert into t1 (b) values ('b'); +select * from t1; delete from t1 where b='b'; select a,concat(b,'.') from t1; drop table t1; @@ -573,20 +576,6 @@ check table t1; drop table t1; -# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce -# different statistics on the same table with NULL values. -create table t1 (a int, key(a)); - -insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL); -analyze table t1; -show keys from t1; - -alter table t1 disable keys; -alter table t1 enable keys; -show keys from t1; - -drop table t1; - # # Bug#12296 - CHECKSUM TABLE reports 0 for the table # This happened if the first record was marked as deleted. @@ -602,7 +591,10 @@ checksum table t1; checksum table t2; drop table t1, t2; +# # BUG#12232: New myisam_stats_method variable. +# + show variables like 'myisam_stats_method'; create table t1 (a int, key(a)); @@ -687,3 +679,129 @@ create index bug on t1 (bob(22), cip, time); select * from t1 where bob is null and cip=1; drop table t1; # End of 4.1 tests + +# +# Test varchar +# + +let $default=`select @@storage_engine`; +set storage_engine=MyISAM; +source include/varchar.inc; + +# +# Some errors/warnings on create +# + +create table t1 (v varchar(65530), key(v)); +drop table if exists t1; +create table t1 (v varchar(65536)); +show create table t1; +drop table t1; +create table t1 (v varchar(65530) character set utf8); +show create table t1; +drop table t1; + +# MyISAM specific varchar tests +--error 1118 +create table t1 (v varchar(65535)); + +eval set storage_engine=$default; + +# +# Test how DROP TABLE works if the index or data file doesn't exists + +create table t1 (a int) engine=myisam; +system rm ./var/master-data/test/t1.MYI ; +drop table if exists t1; +create table t1 (a int) engine=myisam; +system rm ./var/master-data/test/t1.MYI ; +--error 1051,6 +drop table t1; +create table t1 (a int) engine=myisam; +system rm ./var/master-data/test/t1.MYD ; +--error 1105,6,29 +drop table t1; +--error 1051 +drop table t1; + +# +# Test concurrent insert +# First with static record length +# +set @save_concurrent_insert=@@concurrent_insert; +set global concurrent_insert=1; +create table t1 (a int); +insert into t1 values (1),(2),(3),(4),(5); +lock table t1 read local; +connect (con1,localhost,root,,); +connection con1; +# Insert in table without hole +insert into t1 values(6),(7); +connection default; +unlock tables; +delete from t1 where a>=3 and a<=4; +lock table t1 read local; +connection con1; +set global concurrent_insert=2; +# Insert in table with hole -> Should insert at end +insert into t1 values (8),(9); +connection default; +unlock tables; +# Insert into hole +insert into t1 values (10),(11),(12); +select * from t1; +check table t1; +drop table t1; +disconnect con1; + +# Same test with dynamic record length +create table t1 (a int, b varchar(30) default "hello"); +insert into t1 (a) values (1),(2),(3),(4),(5); +lock table t1 read local; +connect (con1,localhost,root,,); +connection con1; +# Insert in table without hole +insert into t1 (a) values(6),(7); +connection default; +unlock tables; +delete from t1 where a>=3 and a<=4; +lock table t1 read local; +connection con1; +set global concurrent_insert=2; +# Insert in table with hole -> Should insert at end +insert into t1 (a) values (8),(9); +connection default; +unlock tables; +# Insert into hole +insert into t1 (a) values (10),(11),(12); +select a from t1; +check table t1; +drop table t1; +disconnect con1; +set global concurrent_insert=@save_concurrent_insert; + + +# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce +# different statistics on the same table with NULL values. +create table t1 (a int, key(a)); + +insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL); +analyze table t1; +show keys from t1; + +alter table t1 disable keys; +alter table t1 enable keys; +show keys from t1; + +drop table t1; + +# +# Bug#10056 - PACK_KEYS option take values greater than 1 while creating table +# +create table t1 (c1 int) engine=myisam pack_keys=0; +create table t2 (c1 int) engine=myisam pack_keys=1; +create table t3 (c1 int) engine=myisam pack_keys=default; +--error 1064 +create table t4 (c1 int) engine=myisam pack_keys=2; +drop table t1, t2, t3; + |