summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-11-05 20:35:45 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2021-11-05 20:35:45 +0100
commit109fc67d4da46d52d2a96528eaea3b0ef6275692 (patch)
tree8d5f52c188eab272508e02a83ead266e50529608 /mysql-test/suite
parent9b967c4c31555174a293922d4717d83b7d68bc76 (diff)
parent8635be6a2962f8e256c27836c35064ccaabb7486 (diff)
downloadmariadb-git-109fc67d4da46d52d2a96528eaea3b0ef6275692.tar.gz
Merge branch '10.5' into 10.6mariadb-10.6.5
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test62
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result368
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result386
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result382
5 files changed, 1179 insertions, 21 deletions
diff --git a/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc
index a7ee54658f8..bbc7209e57f 100644
--- a/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc
+++ b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.inc
@@ -58,7 +58,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
--eval CREATE TEMPORARY TABLE nt_tmp_xx_1 ( id INT ) ENGINE = MyIsam
#
- # Creates a Temporary N-table that is never dropped.
+ # Creates a Temporary T-table that is never dropped.
#
--eval CREATE TEMPORARY TABLE tt_tmp_xx_1 ( id INT ) ENGINE = Innodb
diff --git a/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test
index 456419803db..6eb725d469c 100644
--- a/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/include/rpl_drop_create_temp_table.test
@@ -483,6 +483,65 @@ SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp Te R';
SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig R';
--source suite/rpl/include/rpl_drop_create_temp_table.inc
+--echo # > MDEV-26833
+--echo # Errored out and rolled back Te statement should not produce any event to binlog
+--echo # in the following cases:
+
+SET @sav_var = @@session.binlog_direct_non_transactional_updates;
+
+SET @@session.binlog_direct_non_transactional_updates = ON;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T N-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T N-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo # Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T N-Temp Te Ne R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @@session.binlog_direct_non_transactional_updates = OFF;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T N-Temp Te C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T N-Temp Te R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+--echo # Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+SET @commands= 'B T N-Temp Te Ne R';
+--source suite/rpl/include/rpl_drop_create_temp_table.inc
+
+SET @@session.binlog_direct_non_transactional_updates = @sav_var;
+--echo # < MDEV-26833
+
--echo ###################################################################################
--echo # CHECK CONSISTENCY
--echo ###################################################################################
@@ -495,8 +554,7 @@ if (`select @@session.binlog_format != 'STATEMENT'`)
{
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-slave.sql
- # uncomment when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y from mysql-5.6 is merged
- #--diff_files $MYSQLD_DATADIR/test-temporary-master.sql $MYSQLD_DATADIR/test-temporary-slave.sql
+ --diff_files $MYSQLD_DATADIR/test-temporary-master.sql $MYSQLD_DATADIR/test-temporary-slave.sql
}
--echo #########################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
index d2f590ad136..f8af2d439eb 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
@@ -2119,6 +2119,374 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e-
+# > MDEV-26833
+# Errored out and rolled back Te statement should not produce any event to binlog
+# in the following cases:
+SET @sav_var = @@session.binlog_direct_non_transactional_updates;
+SET @@session.binlog_direct_non_transactional_updates = ON;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (7), (7);
+ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (8), (8);
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (9), (9);
+ERROR 23000: Duplicate entry '9' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (10), (10);
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (11), (11);
+ERROR 23000: Duplicate entry '11' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (12), (12);
+ERROR 23000: Duplicate entry '12' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (13), (13);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (14), (14);
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+# Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (15), (15);
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (13), (13);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (13), (13)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te Ne R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (16), (16);
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (14), (14);
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (14), (14)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @@session.binlog_direct_non_transactional_updates = OFF;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (17), (17);
+ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (18), (18);
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (19), (19);
+ERROR 23000: Duplicate entry '19' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (20), (20);
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (21), (21);
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (22), (22);
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (23), (23);
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (24), (24);
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+# Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (25), (25);
+ERROR 23000: Duplicate entry '25' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (15), (15);
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (15), (15)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te Ne R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (26), (26);
+ERROR 23000: Duplicate entry '26' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (16), (16);
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (16), (16)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @@session.binlog_direct_non_transactional_updates = @sav_var;
+# < MDEV-26833
###################################################################################
# CHECK CONSISTENCY
###################################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
index f6e04b950d8..3be043eb8af 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
@@ -619,9 +619,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Annotate_rows # # INSERT INTO tt_error_1() VALUES (1), (1)
-master-bin.000001 # Table_map # # table_id: # (test.tt_error_1)
-master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1163,9 +1160,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Annotate_rows # # INSERT INTO tt_error_1() VALUES (2), (2)
-master-bin.000001 # Table_map # # table_id: # (test.tt_error_1)
-master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
@@ -1633,12 +1627,6 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
COMMIT;
-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
include/show_binlog_events.inc
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT INTO tt_error_1() VALUES (3), (3)
-master-bin.000001 # Table_map # # table_id: # (test.tt_error_1)
-master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig C';
@@ -1725,12 +1713,6 @@ ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
ROLLBACK;
-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
include/show_binlog_events.inc
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT INTO tt_error_1() VALUES (4), (4)
-master-bin.000001 # Table_map # # table_id: # (test.tt_error_1)
-master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp NeT-trig R';
@@ -2066,6 +2048,374 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e-
+# > MDEV-26833
+# Errored out and rolled back Te statement should not produce any event to binlog
+# in the following cases:
+SET @sav_var = @@session.binlog_direct_non_transactional_updates;
+SET @@session.binlog_direct_non_transactional_updates = ON;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (7), (7);
+ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (8), (8);
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (9), (9);
+ERROR 23000: Duplicate entry '9' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (10), (10);
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (11), (11);
+ERROR 23000: Duplicate entry '11' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (12), (12);
+ERROR 23000: Duplicate entry '12' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (13), (13);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (14), (14);
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+# Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (15), (15);
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (13), (13);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (13), (13)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te Ne R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (16), (16);
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (14), (14);
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (14), (14)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @@session.binlog_direct_non_transactional_updates = OFF;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (17), (17);
+ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (18), (18);
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (19), (19);
+ERROR 23000: Duplicate entry '19' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (20), (20);
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (21), (21);
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (22), (22);
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (23), (23);
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (24), (24);
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+# Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (25), (25);
+ERROR 23000: Duplicate entry '25' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (15), (15);
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (15), (15)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te Ne R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (26), (26);
+ERROR 23000: Duplicate entry '26' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (16), (16);
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Annotate_rows # # INSERT INTO nt_error_1() VALUES (16), (16)
+master-bin.000001 # Table_map # # table_id: # (test.nt_error_1)
+master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @@session.binlog_direct_non_transactional_updates = @sav_var;
+# < MDEV-26833
###################################################################################
# CHECK CONSISTENCY
###################################################################################
diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
index d4250159866..976097fb4ec 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
@@ -2195,6 +2195,388 @@ master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM tt_t
master-bin.000001 # Query # # ROLLBACK
-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e-
+# > MDEV-26833
+# Errored out and rolled back Te statement should not produce any event to binlog
+# in the following cases:
+SET @sav_var = @@session.binlog_direct_non_transactional_updates;
+SET @@session.binlog_direct_non_transactional_updates = ON;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (7), (7);
+ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (8), (8);
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (9), (9);
+ERROR 23000: Duplicate entry '9' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (10), (10);
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (11), (11);
+ERROR 23000: Duplicate entry '11' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (12), (12);
+ERROR 23000: Duplicate entry '12' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (13), (13);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (14), (14);
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+# Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (15), (15);
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (13), (13);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (13), (13)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te Ne R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (16), (16);
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (14), (14);
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (14), (14)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @@session.binlog_direct_non_transactional_updates = OFF;
+SET @commands= 'B T Drop-Temp-TT-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (17), (17);
+ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te C';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (18), (18);
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (19), (19);
+ERROR 23000: Duplicate entry '19' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (20), (20);
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TT-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2;
+INSERT INTO tt_error_1() VALUES (21), (21);
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_1`,`tt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'Drop-Temp-T-Temp B T Create-T-Temp Te R';
+DROP TEMPORARY TABLE tt_tmp_2;
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb;
+INSERT INTO tt_error_1() VALUES (22), (22);
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp B T Create-T-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T Drop-Temp-TN-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2;
+INSERT INTO tt_error_1() VALUES (23), (23);
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+ROLLBACK;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `nt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* generated by server */
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (24), (24);
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te R << -e-e-e-e-e-e-e-e-e-e-e-
+
+# Non-transactional side effects.
+SET @commands= 'B T N-Temp Te Ne C';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (25), (25);
+ERROR 23000: Duplicate entry '25' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (15), (15);
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne C << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (15), (15)
+master-bin.000001 # Xid # # COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne C << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @commands= 'B T N-Temp Te Ne R';
+BEGIN;
+INSERT INTO tt_xx_1() VALUES (1);
+INSERT INTO nt_tmp_xx_1() VALUES (1);
+INSERT INTO tt_error_1() VALUES (26), (26);
+ERROR 23000: Duplicate entry '26' for key 'PRIMARY'
+INSERT INTO nt_error_1() VALUES (16), (16);
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning # Some non-transactional changed tables couldn't be rolled back
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N-Temp Te Ne R << -b-b-b-b-b-b-b-b-b-b-b-
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1)
+master-bin.000001 # Query # # use `test`; INSERT INTO nt_error_1() VALUES (16), (16)
+master-bin.000001 # Query # # ROLLBACK
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N-Temp Te Ne R << -e-e-e-e-e-e-e-e-e-e-e-
+
+SET @@session.binlog_direct_non_transactional_updates = @sav_var;
+# < MDEV-26833
###################################################################################
# CHECK CONSISTENCY
###################################################################################