diff options
Diffstat (limited to 'mysql-test/t/key.test')
-rw-r--r-- | mysql-test/t/key.test | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 796e36cb608..e7072ae29f6 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -129,7 +129,11 @@ create table t2 INSERT t2 select * from t1; SELECT * FROM t2 WHERE name='[T,U]_axpy'; SELECT * FROM t2 WHERE name='[T,U]_axpby'; -drop table t1,t2; +# Test possible problems with warnings in CREATE ... SELECT +CREATE TABLE t3 SELECT * FROM t2 WHERE name='[T,U]_axpby'; +SELECT * FROM t2 WHERE name='[T,U]_axpby'; + +drop table t1,t2,t3; # # Test bug with long primary key @@ -295,7 +299,7 @@ drop table t1; # create dedicated error code for this and # and change my_printf_error() to my_error ---error 1105 +--error 1391 create table t1 (c char(10), index (c(0))); # @@ -347,5 +351,35 @@ insert into t1 values (2,' \t\tTest String'); insert into t1 values (3,' \n\tTest String'); update t1 set c2 = 'New Test String' where c1 = 1; select * from t1; +drop table t1; + +# +# If we use a partial field for a key that is actually the length of the +# field, and we extend the field, we end up with a key that includes the +# whole new length of the field. +# +create table t1 (a varchar(10), b varchar(10), key(a(10),b(10))); +show create table t1; +alter table t1 modify b varchar(20); +show create table t1; +alter table t1 modify a varchar(20); +show create table t1; +drop table t1; + +# +# Bug #11227: Incorrectly reporting 'MUL' vs. 'UNI' on varchar +# +create table t1 (a int not null primary key, b varchar(20) not null unique); +desc t1; +drop table t1; +create table t1 (a int not null primary key, b int not null unique); +desc t1; +drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10))); +desc t1; +drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10))); +desc t1; +drop table t1; # End of 4.1 tests |