From a7abddeffa6a760ce948c2dfb007cdf3f1a369d5 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 9 Mar 2018 14:05:35 +0200 Subject: Create 'main' test directory and move 't' and 'r' there --- .../main/set_statement_notembedded_binlog.result | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 mysql-test/main/set_statement_notembedded_binlog.result (limited to 'mysql-test/main/set_statement_notembedded_binlog.result') diff --git a/mysql-test/main/set_statement_notembedded_binlog.result b/mysql-test/main/set_statement_notembedded_binlog.result new file mode 100644 index 00000000000..50fcde5a1cb --- /dev/null +++ b/mysql-test/main/set_statement_notembedded_binlog.result @@ -0,0 +1,108 @@ +drop table if exists t1; +drop view if exists t1; +# +# MDEV-6948: SET STATEMENT gtid_domain_id = ... FOR has no effect +# (same for gtid_seq_no and server_id) +# +reset master; +create table t1 (i int); +set gtid_domain_id = 10; +insert into t1 values (1),(2); +set statement gtid_domain_id = 20 for insert into t1 values (3),(4); +show binlog events limit 5,5; +Log_name Pos Event_type Server_id End_log_pos Info +x x x x x BEGIN GTID 10-1-1 +x x x x x use `test`; insert into t1 values (1),(2) +x x x x x COMMIT +x x x x x BEGIN GTID 20-1-1 +x x x x x use `test`; set statement gtid_domain_id = 20 for insert into t1 values (3),(4) +drop table t1; +reset master; +SET @a=11; +create table t1 (a int not null auto_increment, c int, d int, primary key (a)); +create table t2 (b int); +insert into t2 values (1),(2); +CREATE function f1() returns int +BEGIN +SET STATEMENT last_insert_id=@a for insert into t1 values (NULL, @a, +last_insert_id()); +SET @a:=@a*100+13; +return @a; +end| +call mtr.add_suppression("Unsafe statement written to the binary log using"); +select f1() from t2; +f1() +1113 +111313 +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave +show binlog events limit 16, 100; +Log_name Pos Event_type Server_id End_log_pos Info +x x x x x LAST_INSERT_ID=0 +x x x x x INSERT_ID=1 +x x x x x @`a`=11 +x x x x x @`a`=11 +x x x x x use `test`; SELECT `test`.`f1`() +x x x x x LAST_INSERT_ID=0 +x x x x x INSERT_ID=2 +x x x x x @`a`=1113 +x x x x x @`a`=1113 +x x x x x use `test`; SELECT `test`.`f1`() +x x x x x COMMIT +select * from t1; +a c d +1 11 11 +2 1113 1113 +drop function f1; +drop table t1,t2; +reset master; +SET @a=11; +create table t1 (a int not null auto_increment, c int, d int, primary key (a)); +create table t2 (b int); +insert into t2 values (1),(2); +CREATE function f1() returns int +BEGIN +SET @save= @@last_insert_id; +SET session last_insert_id=@a; +insert into t1 values (NULL, @a, last_insert_id()); +SET session last_insert_id=@save; +SET @a:=@a*100+13; +return @a; +end| +select f1() from t2; +f1() +1113 +111313 +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave +show binlog events limit 13, 100; +Log_name Pos Event_type Server_id End_log_pos Info +x x x x x LAST_INSERT_ID=0 +x x x x x INSERT_ID=1 +x x x x x @`a`=11 +x x x x x @`save`=0 +x x x x x use `test`; SELECT `test`.`f1`() +x x x x x LAST_INSERT_ID=0 +x x x x x INSERT_ID=2 +x x x x x @`a`=1113 +x x x x x @`save`=0 +x x x x x use `test`; SELECT `test`.`f1`() +x x x x x COMMIT +select * from t1; +a c d +1 11 11 +2 1113 1113 +drop function f1; +drop table t1,t2; +reset master; +set statement last_insert_id = 112 for create table t1 as select last_insert_id(); +show binlog events limit 4,1; +Log_name Pos Event_type Server_id End_log_pos Info +x x x x x LAST_INSERT_ID=112 +drop table t1; -- cgit v1.2.1