From b58098c3b9652434c99784ce982471931706ded4 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Mon, 6 Oct 2003 20:02:27 +0200 Subject: bug #1434 (and related issues) --- mysql-test/t/create.test | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'mysql-test/t/create.test') diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index d46807f1dca..815aad560b1 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -129,8 +129,28 @@ insert into t1 values ("a", 1), ("b", 2); drop table t1; # -# Bug # 801 +# Bug #801 # create table t1 select x'4132'; drop table t1; + +# +# bug #1434 +# + +create table t1 select 1,2,3; +create table if not exists t1 select 1,2; +--error 1136 +create table if not exists t1 select 1,2,3,4; +create table if not exists t1 select 1; +select * from t1; +drop table t1; +create table t1 select 1,2,3; +create table if not exists t1 select 1,2; +--error 1136 +create table if not exists t1 select 1,2,3,4; +create table if not exists t1 select 1; +select * from t1; +drop table t1; + -- cgit v1.2.1 From 84d9d9807841cbbcb756c24ef56f0d0fe5ec3e2f Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Wed, 15 Oct 2003 21:41:13 +0300 Subject: Better fix for CREATE TABLE IF NOT EXISTS ... SELECT Fixed chsize() problem on windows Extend default timeout on windows clients to 1 year (to avoid timeout problems) --- mysql-test/t/create.test | 49 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'mysql-test/t/create.test') 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; -- cgit v1.2.1