summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-10-16 03:08:40 +0300
committerunknown <monty@mashka.mysql.fi>2003-10-16 03:08:40 +0300
commitaff45e1b0733947abde48f712c1af64b4f2549a7 (patch)
treebd2eb4ac5dffdd3ac1af40b53a3680a0a9d78195 /mysql-test
parent893797be02d4dff2e1aafbdb98ac4e33b9726628 (diff)
parent0fc97bc9e5c6c0a4f380841b325f6f0647a90bb5 (diff)
downloadmariadb-git-aff45e1b0733947abde48f712c1af64b4f2549a7.tar.gz
merge with 4.0
BitKeeper/deleted/.del-MYSQL.ICO~d93519b5f0d6ee1: Auto merged client/client_priv.h: Auto merged extra/resolveip.c: Auto merged include/mysql.h: Auto merged include/thr_alarm.h: Auto merged myisam/myisamchk.c: Auto merged scripts/mysql_config.sh: Auto merged scripts/mysqld_safe.sh: Auto merged sql/slave.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_handler.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_test.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/create.result38
-rw-r--r--mysql-test/t/create.test71
-rw-r--r--mysql-test/t/mysqlbinlog.test16
3 files changed, 103 insertions, 22 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 277ae9e0b8d..805a21d92ca 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -220,6 +220,44 @@ ERROR 23000: Column 'k1' cannot be null
insert into t1 values (NULL, NULL);
ERROR 23000: Column 'k1' cannot be null
drop table t1;
+create table t1 select 1,2,3;
+create table if not exists t1 select 1,2;
+create table if not exists t1 select 1,2,3,4;
+Column count doesn't match value count at row 1
+create table if not exists t1 select 1;
+select * from t1;
+1 2 3
+1 2 3
+0 1 2
+0 0 1
+drop table t1;
+create table t1 select 1,2,3;
+create table if not exists t1 select 1,2;
+create table if not exists t1 select 1,2,3,4;
+Column count doesn't match value count at row 1
+create table if not exists t1 select 1;
+select * from t1;
+1 2 3
+1 2 3
+0 1 2
+0 0 1
+drop table t1;
+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;
+a b
+1 1
+0 2
+create table if not exists t1 select 3 as 'a',4 as 'b';
+create table if not exists t1 select 3 as 'a',3 as 'b';
+Duplicate entry '3' for key 1
+select * from t1;
+a b
+1 1
+0 2
+3 4
+drop table t1;
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
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
#
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 956afb3e7ca..c71ffb21354 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -39,28 +39,28 @@ select "--- Local --" as "";
#
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000001
# this should not fail but shouldn't produce any working statements
--disable_query_log
select "--- Broken LOAD DATA --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ $MYSQL_TEST_DIR/var/log/master-bin.000002
# this should show almost nothing
--disable_query_log
select "--- --database --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001
# this test for position option
--disable_query_log
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --position=27 $MYSQL_TEST_DIR/var/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=27 $MYSQL_TEST_DIR/var/log/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -76,28 +76,28 @@ select "--- Remote --" as "";
# This is broken now
# By the way it seems that remote version fetches all events with name >= master-bin.000001
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
# This is broken too
--disable_query_log
select "--- Broken LOAD DATA --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# And this too ! (altough it is documented)
--disable_query_log
select "--- --database --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001
# Strangely but this works
--disable_query_log
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# clean up
drop table t1;