From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- .../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 00000000..50fcde5a --- /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.3