diff options
Diffstat (limited to 'mysql-test/main/long_unique_bugs.result')
-rw-r--r-- | mysql-test/main/long_unique_bugs.result | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result index 5d6c0562c8a..5f9715a14ee 100644 --- a/mysql-test/main/long_unique_bugs.result +++ b/mysql-test/main/long_unique_bugs.result @@ -10,6 +10,7 @@ create temporary table tmp (a varchar(1024), b int, c int, d int, e linestring, load data infile 'load.data' into table tmp; delete from tmp; drop table t1; +drop table tmp; create table t1 (b blob) engine=innodb; alter table t1 add unique (b); alter table t1 force; @@ -266,7 +267,7 @@ disconnect con1; connection default; DROP TABLE t1, t2; CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria; -ERROR 42000: Specified key was too long; max key length is 1000 bytes +ERROR 42000: Specified key was too long; max key length is 2000 bytes create table t1(a int, unique(a) using hash); #BULK insert > 100 rows (MI_MIN_ROWS_TO_DISABLE_INDEXES) drop table t1; @@ -288,3 +289,74 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par t2 0 a 1 a A NULL NULL NULL YES HASH t2 0 a 2 b A NULL NULL NULL YES HASH DROP TABLE t1,t2; +create temporary table tmp ( a int, b int, c blob not null, d int, e int default 0, f int, unique key (c)) engine=innodb; +create table t2 (x int); +lock table t2 write; +update tmp set c = 'foo'; +start transaction; +alter table tmp alter column a set default 8; +unlock tables; +drop table t2; +create table t1 (pk int primary key, f blob, unique(f)) engine=innodb; +insert t1 values (1, null); +select * into outfile 't1.data' from t1; +load data infile 't1.data' replace into table t1; +select * from t1; +pk f +1 NULL +drop table t1; +create table t1 (a int, b blob) engine=myisam; +insert t1 values (1,'foo'),(2,'bar'), (3, 'bar'); +create table t2 (c int, d blob, unique(d)) engine=myisam; +insert t2 select * from t1; +ERROR 23000: Duplicate entry 'bar' for key 'd' +select * from t2; +c d +1 foo +2 bar +insert ignore t2 select * from t1; +Warnings: +Warning 1062 Duplicate entry 'foo' for key 'd' +Warning 1062 Duplicate entry 'bar' for key 'd' +Warning 1062 Duplicate entry 'bar' for key 'd' +select * from t2; +c d +1 foo +2 bar +replace t2 select * from t1; +select * from t2; +c d +1 foo +3 bar +update t1, t2 set t2.d='off' where t1.a=t2.c and t1.b='foo'; +select * from t2; +c d +1 off +3 bar +alter table t2 add system versioning; +delete from t2 using t1, t2 where t1.a=t2.c and t1.b='foo'; +select * from t2; +c d +3 bar +create or replace table t2 (a int, b blob, unique(b)) as select * from t1; +ERROR 23000: Duplicate entry 'bar' for key 'b' +select * from t2; +ERROR 42S02: Table 'test.t2' doesn't exist +create or replace table t2 (a int, b blob, unique(b)) ignore as select * from t1; +Warnings: +Warning 1062 Duplicate entry 'bar' for key 'b' +select * from t2; +a b +1 foo +2 bar +create or replace table t2 (a int, b blob, unique(b)) replace as select * from t1; +select * from t2; +a b +1 foo +3 bar +drop table if exists t1, t2; +create table t1 (a int, b int, unique (b) using hash) engine=innodb partition by key (a) partitions 2; +insert into t1 values (1,10),(2,20); +update t1 set b = 30 limit 1; +drop table t1; +# End of 10.5 tests |