summaryrefslogtreecommitdiff
path: root/mysql-test/t/create.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r--mysql-test/t/create.test71
1 files changed, 57 insertions, 14 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index d57fd3bb193..0148fa9431a 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -21,21 +21,30 @@ drop table 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));
+--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;
-!$1163 create table t1 (a int not null,b text) type=heap;
+--error 1163
+create table t1 (a int not null,b text) type=heap;
drop table if exists t1;
-!$1075 create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
+--error 1075
+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
@@ -167,6 +176,46 @@ insert into t1 values (NULL, NULL);
drop table t1;
#
+# 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;
+
+#
+# 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;
+
+#
# Test create with foreign keys
#
@@ -230,12 +279,6 @@ SET SESSION table_type=default;
drop table t1;
#
-# Bug # 801
-#
-create table t1 select x'4132';
-drop table t1;
-
-#
# Test types of data for create select with functions
#