summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ansi.result17
-rw-r--r--mysql-test/r/create.result10
-rw-r--r--mysql-test/r/insert_select.result5
-rw-r--r--mysql-test/r/rpl000009.result53
-rw-r--r--mysql-test/t/ansi-master.opt1
-rw-r--r--mysql-test/t/ansi.test10
-rw-r--r--mysql-test/t/create.test13
-rw-r--r--mysql-test/t/insert_select.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test4
9 files changed, 79 insertions, 35 deletions
diff --git a/mysql-test/r/ansi.result b/mysql-test/r/ansi.result
index 6ec909f84bb..0b86634f67b 100644
--- a/mysql-test/r/ansi.result
+++ b/mysql-test/r/ansi.result
@@ -1,4 +1,12 @@
drop table if exists t1;
+set sql_mode="MySQL40";
+select @@sql_mode;
+@@sql_mode
+NO_FIELD_OPTIONS,MYSQL40
+set @@sql_mode="ANSI";
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI
SELECT 'A' || 'B';
'A' || 'B'
AB
@@ -8,11 +16,4 @@ id NULL 1 1.1 a
SELECT id FROM t1 GROUP BY id2;
ERROR 42000: 'test.t1.id' isn't in GROUP BY
drop table t1;
-set sql_mode="MySQL40";
-select @@sql_mode;
-@@sql_mode
-NO_FIELD_OPTIONS,MYSQL40
-set sql_mode="ANSI";
-select @@sql_mode;
-@@sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI
+SET @@SQL_MODE="";
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 8eff870e855..277ae9e0b8d 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -129,6 +129,16 @@ ERROR 42S21: Duplicate column name 'b'
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't2'
+CREATE TABLE t1 (a int not null);
+INSERT INTO t1 values (1),(2),(1);
+CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
+ERROR 23000: Duplicate entry '1' for key 1
+SELECT * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+DROP TABLE t1;
+DROP TABLE IF EXISTS t2;
+Warnings:
+Note 1051 Unknown table 't2'
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
Table Create Table
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 7b8e3c46200..8eecccf6fec 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -74,7 +74,12 @@ insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
+master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
master-bin.000001 79 Query 1 79 use `test`; insert into t1 select * from t2
+select * from t1;
+a
+1
+2
drop table t1, t2;
create table t1 (a int not null);
create table t2 (a int not null);
diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result
index fc55de7246c..1f78a505280 100644
--- a/mysql-test/r/rpl000009.result
+++ b/mysql-test/r/rpl000009.result
@@ -4,9 +4,13 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+drop database if exists mysqltest;
drop database if exists mysqltest2;
-create database mysqltest2;
+drop database if exists mysqltest3;
drop database if exists mysqltest;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
+create database mysqltest2;
create database mysqltest;
create database mysqltest2;
create table mysqltest2.foo (n int);
@@ -46,45 +50,43 @@ show databases;
Database
mysql
test
-create database foo;
-create table foo.t1(n int, s char(20));
-insert into foo.t1 values (1, 'original foo.t1');
-create table foo.t3(n int, s char(20));
-insert into foo.t3 values (1, 'original foo.t3');
-create database foo2;
-create table foo2.t1(n int, s char(20));
-insert into foo2.t1 values (1, 'original foo2.t1');
-create database bar;
-create table bar.t1(n int, s char(20));
-insert into bar.t1 values (1, 'original bar.t1');
-create table bar.t3(n int, s char(20));
-insert into bar.t3 values (1, 'original bar.t3');
+create database mysqltest2;
+create table mysqltest2.t1(n int, s char(20));
+insert into mysqltest2.t1 values (1, 'original foo.t1');
+create table mysqltest2.t3(n int, s char(20));
+insert into mysqltest2.t3 values (1, 'original foo.t3');
+create database mysqltest3;
+create table mysqltest3.t1(n int, s char(20));
+insert into mysqltest3.t1 values (1, 'original foo2.t1');
+create database mysqltest;
+create table mysqltest.t1(n int, s char(20));
+insert into mysqltest.t1 values (1, 'original bar.t1');
+create table mysqltest.t3(n int, s char(20));
+insert into mysqltest.t3 values (1, 'original bar.t3');
load data from master;
-Warnings:
-Note 1008 Can't drop database 'mysqltest'; database doesn't exist
-Note 1008 Can't drop database 'mysqltest2'; database doesn't exist
show databases;
Database
mysql
mysqltest
mysqltest2
+mysqltest3
test
use mysqltest2;
show tables;
Tables_in_mysqltest2
-use mysqltest;
t1
t3
select * from t1;
n s
1 original foo.t1
-use foo2;
+use mysqltest3;
show tables;
-Tables_in_foo2
+Tables_in_mysqltest3
t1
select * from t1;
n s
1 original foo2.t1
+use mysqltest;
show tables;
Tables_in_mysqltest
t1
@@ -100,6 +102,9 @@ n s
11 eleven test
12 twelve test
13 thirteen test
+select * from mysqltest.t3;
+n s
+1 original bar.t3
insert into mysqltest.t1 values (4, 'four test');
select * from mysqltest.t1;
n s
@@ -107,5 +112,13 @@ n s
2 two test
3 three test
4 four test
+load table mysqltest.t1 from master;
+ERROR 42S01: Table 't1' already exists
+drop table mysqltest.t1;
+load table mysqltest.t1 from master;
+load table bar.t1 from master;
+ERROR HY000: Error from master: 'Table 'bar.t1' doesn't exist'
drop database mysqltest;
drop database mysqltest2;
+drop database mysqltest2;
+drop database mysqltest3;
diff --git a/mysql-test/t/ansi-master.opt b/mysql-test/t/ansi-master.opt
deleted file mode 100644
index 6bf7a4f30e2..00000000000
--- a/mysql-test/t/ansi-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---ansi
diff --git a/mysql-test/t/ansi.test b/mysql-test/t/ansi.test
index f4aef5c3f8e..faf20f1e57e 100644
--- a/mysql-test/t/ansi.test
+++ b/mysql-test/t/ansi.test
@@ -6,6 +6,11 @@
drop table if exists t1;
--enable_warnings
+set sql_mode="MySQL40";
+select @@sql_mode;
+set @@sql_mode="ANSI";
+select @@sql_mode;
+
# Test some functions that works different in ansi mode
SELECT 'A' || 'B';
@@ -18,7 +23,4 @@ SELECT id,NULL,1,1.1,'a' FROM t1 GROUP BY id;
SELECT id FROM t1 GROUP BY id2;
drop table t1;
-set sql_mode="MySQL40";
-select @@sql_mode;
-set sql_mode="ANSI";
-select @@sql_mode;
+SET @@SQL_MODE="";
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 0b86b67fdbf..d57fd3bb193 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -111,6 +111,19 @@ create table t2 (b int) select a as b, a+1 as b from t1;
drop table if exists t1,t2;
#
+# Test CREATE ... SELECT when insert fails
+#
+
+CREATE TABLE t1 (a int not null);
+INSERT INTO t1 values (1),(2),(1);
+--error 1062
+CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
+--error 1146
+SELECT * from t2;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t2;
+
+#
# Test of primary key with 32 index
#
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 556b1ac9c8f..4effed9b6de 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -86,6 +86,7 @@ insert into t1 select * from t2;
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
show binlog events;
+select * from t1;
drop table t1, t2;
#
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 3a24efd9f39..956afb3e7ca 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -83,7 +83,7 @@ select "--- Remote --" as "";
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.002
+--exec $MYSQL_BINLOG --short-form --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
@@ -97,7 +97,7 @@ select "--- --database --" as "";
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.002
+--exec $MYSQL_BINLOG --short-form --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# clean up
drop table t1;