mariadb/mysql-test/suite/binlog/t/binlog_tmp_table.test
Andrei Elkin 0eda48463c Manual resolving for the following files
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/r/show_check.result
Text conflict in mysql-test/r/sp-code.result
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/t/show_check.test
Text conflict in mysys/my_delete.c
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/repl_failsafe.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_yacc.yy
Text conflict in storage/myisam/ha_myisam.cc

Corrected results for
 stm_auto_increment_bug33029.reject      2009-12-01
		20:01:49.000000000 +0300
       <andrei> @@ -42,9 +42,6 @@
       <andrei>  RETURN i;
       <andrei>  END//
       <andrei>  CALL p1();
       <andrei> -Warnings:
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.

There should be indeed no Note present because there is in fact autoincrement 
top-level query in sp() that triggers inserting in yet another auto-inc table.
(todo: alert DaoGang to improve the test).
2009-12-01 21:07:18 +02:00

83 lines
1.9 KiB
Text

# ==== Purpose ====
#
# Test if statements used temporary tables are binlogged correctly
#
# ==== Method ====
#
# Use two connections, use temporary tables on both of them, and by
# switching connections between statements, the test can check if the
# statements are logged with the correct thread id.
#
# The statements current tested include:
# CREATE TEMPORARY TABLE
# CREATE TEMPORARY TABLE LIKE
# INSERT
# REPLACE
# UPDATE
# INSERT SELECT
# TRUNCATE
#
# Note: When adding new query statements, please add them between the
# two 'flush logs'. And aslo please make sure the connection is
# switched between each statement.
#
# ==== Related bugs ====
#
# BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used
#
source include/have_log_bin.inc;
source include/have_binlog_format_mixed_or_statement.inc;
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
create table foo (a int);
flush logs;
connection master;
create temporary table tmp1_foo like foo;
connection master1;
create temporary table tmp2_foo (a int);
connection master;
insert into tmp1_foo values (1), (2), (3), (4);
connection master1;
replace into tmp2_foo values (1), (2), (3), (4);
connection master;
update tmp1_foo set a=2*a-1;
connection master1;
update tmp2_foo set a=2*a;
connection master;
delete from tmp1_foo where a < 5;
connection master1;
delete from tmp2_foo where a < 5;
connection master;
insert into foo select * from tmp1_foo;
connection master1;
insert into foo select * from tmp2_foo;
connection master;
truncate table tmp1_foo;
connection master1;
truncate table tmp2_foo;
flush logs;
connection default;
select * from foo;
# prepare for the replay
drop table foo;
create table foo (a int);
# replay from binary log
let $MYSQLD_DATADIR= `select @@datadir`;
exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000002 | $MYSQL;
select * from foo;
# clean up
drop table foo;