diff options
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r-- | mysql-test/t/create.test | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 815aad560b1..8aee586268f 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -18,21 +18,30 @@ drop table if exists t1; # Test of some CREATE TABLE'S that should fail # -!$1146 create table t2 type=heap select * from t1; -!$1146 create table t2 select auto+1 from t1; +--error 1146 +create table t2 type=heap select * from t1; +--error 1146 +create table t2 select auto+1 from t1; drop table if exists t1,t2; -!$1167 create table t1 (b char(0) not null, index(b)); -!$1164 create table t1 (a int not null auto_increment,primary key (a)) type=heap; -!$1163 create table t1 (a int not null,b text) type=heap; +--error 1167 +create table t1 (b char(0) not null, index(b)); +--error 1164 +create table t1 (a int not null auto_increment,primary key (a)) type=heap; +--error 1163 +create table t1 (a int not null,b text) type=heap; drop table if exists t1; -!$1164 create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap; +--error 1164 +create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap; -- error 1044,1 create table not_existing_database.test (a int); -!$1103 create table `a/a` (a int); -!$1103 create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); -!$1059 create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); +--error 1103 +create table `a/a` (a int); +--error 1103 +create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); +--error 1059 +create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); # # test of dummy table names @@ -123,9 +132,12 @@ drop table t1; # create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2)); insert into t1 values ("a", 1), ("b", 2); -!$1048 insert into t1 values ("c", NULL); -!$1048 insert into t1 values (NULL, 3); -!$1048 insert into t1 values (NULL, NULL); +--error 1048 +insert into t1 values ("c", NULL); +--error 1048 +insert into t1 values (NULL, 3); +--error 1048 +insert into t1 values (NULL, NULL); drop table t1; # @@ -154,3 +166,16 @@ create table if not exists t1 select 1; select * from t1; drop table t1; +# +# Test create table if not exists with duplicate key error +# + +create table t1 (a int not null, b int, primary key (a)); +insert into t1 values (1,1); +create table if not exists t1 select 2; +select * from t1; +create table if not exists t1 select 3 as 'a',4 as 'b'; +--error 1062 +create table if not exists t1 select 3 as 'a',3 as 'b'; +select * from t1; +drop table t1; |