summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2006-02-18 19:07:32 +0100
committerunknown <guilhem@mysql.com>2006-02-18 19:07:32 +0100
commit16bc37632ce546704116a1e09388a709c7b13fca (patch)
tree752fc742b26a858079ca0b5b18f032c03f5a605b /mysql-test
parent309f51cd28625316f2eb2ad34ba0f95b0d986264 (diff)
parent8dc567dbed7ab9c6489d0b2f2c72d723c87c68e5 (diff)
downloadmariadb-git-16bc37632ce546704116a1e09388a709c7b13fca.tar.gz
Merge mysql.com:/home/mysql_src/mysql-5.0
into mysql.com:/home/mysql_src/mysql-5.1-new; will fix manually sp_head.cc and mysqld.cc later soon. mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Auto merged mysql-test/r/binlog_stm_mix_innodb_myisam.result: Auto merged mysql-test/r/rpl_sp.result: Auto merged mysql-test/r/sql_mode.result: Auto merged mysql-test/t/rpl_sp-slave.opt: Auto merged mysql-test/t/rpl_sp.test: Auto merged mysql-test/t/sql_mode.test: Auto merged sql/set_var.cc: Auto merged sql/log.cc: auto merged sql/mysqld.cc: will fix manually sql/sp_head.cc: will fix manually
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test33
-rw-r--r--mysql-test/r/binlog_stm_mix_innodb_myisam.result23
-rw-r--r--mysql-test/r/rpl_sp.result21
-rw-r--r--mysql-test/r/sql_mode.result16
-rw-r--r--mysql-test/t/rpl_sp-slave.opt2
-rw-r--r--mysql-test/t/rpl_sp.test10
-rw-r--r--mysql-test/t/sql_mode.test9
7 files changed, 98 insertions, 16 deletions
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
index 0de20ed8be8..3329e1d53e0 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -250,5 +250,36 @@ show binlog events from 102;
do release_lock("lock1");
drop table t0,t2;
-
# End of 4.1 tests
+
+# Test for BUG#16559 (ROLLBACK should always have a zero error code in
+# binlog). Has to be here and not earlier, as the SELECTs influence
+# XIDs differently between normal and ps-protocol (and SHOW BINLOG
+# EVENTS above read XIDs).
+
+connect (con4,localhost,root,,);
+connection con3;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+select get_lock("a",10);
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+disconnect con3;
+
+connection con4;
+select get_lock("a",10); # wait for rollback to finish
+
+# we check that the error code of the "ROLLBACK" event is 0 and not
+# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
+# and does not make slave to stop)
+--exec $MYSQL_BINLOG --start-position=547 $MYSQL_TEST_DIR/var/log/master-bin.000001 > var/tmp/mix_innodb_myisam_binlog.output
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval select
+(@a:=load_file("$MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output"))
+is not null;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval select
+@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
+@a not like "%#%error_code=%error_code=%";
diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result
index 59280961e41..e9aba14ec87 100644
--- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/r/binlog_stm_mix_innodb_myisam.result
@@ -256,3 +256,26 @@ master-bin.000001 1654 Query 1 # use `test`; create table t2 (n int) engine=inno
master-bin.000001 1754 Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
do release_lock("lock1");
drop table t0,t2;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+select get_lock("a",10);
+get_lock("a",10)
+1
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+select get_lock("a",10);
+get_lock("a",10)
+1
+select
+(@a:=load_file("MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output"))
+is not null;
+(@a:=load_file("MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output"))
+is not null
+1
+select
+@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
+@a not like "%#%error_code=%error_code=%";
+@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
+1 1
diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result
index 8aa0f445438..e0db67e3016 100644
--- a/mysql-test/r/rpl_sp.result
+++ b/mysql-test/r/rpl_sp.result
@@ -233,20 +233,25 @@ end @ # #
delete from t2;
alter table t2 add unique (a);
drop function fn1;
-create function fn1()
+create function fn1(x int)
returns int
begin
-insert into t2 values(20),(20);
+insert into t2 values(x),(x);
return 10;
end|
-select fn1();
+do fn1(100);
+Warnings:
+Error 1062 Duplicate entry '100' for key 1
+select fn1(20);
ERROR 23000: Duplicate entry '20' for key 1
select * from t2;
a
20
+100
select * from t2;
a
20
+100
create trigger trg before insert on t1 for each row set new.a= 10;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
delete from t1;
@@ -324,7 +329,7 @@ insert into t1 values (x);
return x+2;
end
master-bin.000001 # Query 1 # use `mysqltest1`; delete t1,t2 from t1,t2
-master-bin.000001 # Query 1 # use `mysqltest1`; DO `fn1`(20)
+master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(20)
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t2 values(fn1(21))
master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
master-bin.000001 # Query 1 # use `mysqltest1`; create function fn1()
@@ -351,13 +356,14 @@ end
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
master-bin.000001 # Query 1 # use `mysqltest1`; drop function fn1
-master-bin.000001 # Query 1 # use `mysqltest1`; create function fn1()
+master-bin.000001 # Query 1 # use `mysqltest1`; create function fn1(x int)
returns int
begin
-insert into t2 values(20),(20);
+insert into t2 values(x),(x);
return 10;
end
-master-bin.000001 # Query 1 # use `mysqltest1`; DO `fn1`()
+master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(100)
+master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `fn1`(20)
master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values (1)
@@ -415,4 +421,3 @@ col
test
DROP PROCEDURE p1;
drop table t1;
-reset master;
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 8e8844fa6dc..f9f8fd8446c 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -460,4 +460,20 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VI
create view v2 as select a from t2 where a in (select a from v1);
drop view v2, v1;
drop table t1, t2;
+select @@sql_mode;
+@@sql_mode
+ANSI_QUOTES
+set sql_mode=2097152;
+select @@sql_mode;
+@@sql_mode
+STRICT_TRANS_TABLES
+set sql_mode=16384+(65536*4);
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
+set sql_mode=2147483648;
+ERROR 42000: Variable 'sql_mode' can't be set to the value of '2147483648'
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
SET @@SQL_MODE=@OLD_SQL_MODE;
diff --git a/mysql-test/t/rpl_sp-slave.opt b/mysql-test/t/rpl_sp-slave.opt
index 611ee1f33be..709a224fd92 100644
--- a/mysql-test/t/rpl_sp-slave.opt
+++ b/mysql-test/t/rpl_sp-slave.opt
@@ -1 +1 @@
---log_bin_trust_routine_creators=0 --slave-skip-errors=1062
+--log_bin_trust_routine_creators=0
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test
index 73f14bd49b3..d5bd7c75648 100644
--- a/mysql-test/t/rpl_sp.test
+++ b/mysql-test/t/rpl_sp.test
@@ -296,21 +296,19 @@ alter table t2 add unique (a);
drop function fn1;
delimiter |;
-create function fn1()
+create function fn1(x int)
returns int
begin
- insert into t2 values(20),(20);
+ insert into t2 values(x),(x);
return 10;
end|
delimiter ;|
-# Because of BUG#14769 the following statement requires that we start
-# slave with --slave-skip-errors=1062. When that bug is fixed, that
-# option can be removed.
+do fn1(100);
--error 1062
-select fn1();
+select fn1(20);
select * from t2;
sync_slave_with_master;
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index 08a03df3274..b4225ef8c4e 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -255,4 +255,13 @@ create view v2 as select a from t2 where a in (select a from v1);
drop view v2, v1;
drop table t1, t2;
+select @@sql_mode;
+set sql_mode=2097152;
+select @@sql_mode;
+set sql_mode=16384+(65536*4);
+select @@sql_mode;
+--error 1231
+set sql_mode=2147483648; # that mode does not exist
+select @@sql_mode;
+
SET @@SQL_MODE=@OLD_SQL_MODE;