List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:October 19 2010 12:00pm
Subject:bzr commit into mysql-trunk-innodb branch (vasil.dimov:3259)
View as plain text  
#At file:///usr/local/devel/bzrroot/server/mysql-trunk-innodb/ based on revid:vasil.dimov@stripped

 3259 Vasil Dimov	2010-10-19 [merge]
      Merge mysql-trunk-bugfixing -> mysql-trunk-innodb

    modified:
      mysql-test/extra/rpl_tests/rpl_mixing_engines.inc
      mysql-test/extra/rpl_tests/rpl_mixing_engines.test
      mysql-test/r/not_partition.result
      mysql-test/r/partition_exchange.result
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
      sql/binlog.cc
      sql/share/errmsg-utf8.txt
=== modified file 'mysql-test/extra/rpl_tests/rpl_mixing_engines.inc'
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc	revid:vasil.dimov@stripped
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc	revid:vasil.dimov@stripped
@@ -141,6 +141,7 @@ if (`SELECT HEX(@commands) = HEX('config
   let $tb_id= 1;
   let $stmt_id= 1;
   let $commands= '';
+  let $sn= 0;
 
   SET @commands= '';
 }
@@ -183,8 +184,11 @@ while (`SELECT HEX(@commands) != HEX('')
   {
     let $commands= `SELECT @commands`;
   }
-  --echo -b-b-b-b-b-b-b-b-b-b-b- >> $command << -b-b-b-b-b-b-b-b-b-b-b-
-  let $pos_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+  if (`SELECT HEX(@verbose) != HEX('N')`)
+  {
+    --echo -b-b-b-b-b-b-b-b-b-b-b- >> $command << -b-b-b-b-b-b-b-b-b-b-b-
+    let $pos_command= query_get_value("SHOW MASTER STATUS", Position, 1);
+  }
   --enable_query_log
   if (`SELECT HEX(@command) = HEX('B')`)
   {
@@ -524,21 +528,37 @@ while (`SELECT HEX(@commands) != HEX('')
     --error 0, ER_GET_ERRMSG
     eval ROLLBACK;
   }
-  if (`SELECT HEX(@command) = HEX('S1')`)
+  if (`SELECT HEX(@command) = HEX('Sn')`)
   {
-    eval SAVEPOINT s1; 
+    eval SAVEPOINT S_$sn;
+    --inc $sn 
   }
-  if (`SELECT HEX(@command) = HEX('R1')`)
+  if (`SELECT HEX(@command) = HEX('Rn')`)
   {
-    eval ROLLBACK TO s1; 
+    if ($sn)
+    {
+      --dec $sn
+    }
+     eval ROLLBACK TO S_$sn;
+  }
+  if (`SELECT HEX(@command) = HEX('Cn')`)
+  {
+    if ($sn)
+    {
+      --dec $sn
+    }
+    eval RELEASE SAVEPOINT S_$sn;
   }
   --disable_query_log
   SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1));
   inc $stmt_id;
 
   let $binlog_start= $pos_command;
-  --source include/show_binlog_events.inc
-  --echo -e-e-e-e-e-e-e-e-e-e-e- >> $command << -e-e-e-e-e-e-e-e-e-e-e-
+  if (`SELECT HEX(@verbose) != HEX('N')`)
+  {
+    --source include/show_binlog_events.inc
+    --echo -e-e-e-e-e-e-e-e-e-e-e- >> $command << -e-e-e-e-e-e-e-e-e-e-e-
+  }
   if (`SELECT HEX(@commands) = HEX('')`)
   {
     let $binlog_start= $pos_trans_command;

=== modified file 'mysql-test/extra/rpl_tests/rpl_mixing_engines.test'
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test	revid:vasil.dimov@stripped
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test	revid:vasil.dimov@stripped
@@ -159,8 +159,8 @@
 # B - Begin.
 # C - Commit.
 # R - Rollback.
-# S1 - Savepoint.
-# R1 - Rollback to S1.
+# Sn - Savepoint Sn.
+# Rn - Rollback to Sn.
 #
 # - Change only T-Tables:
 # T - Updates a T-Table.
@@ -247,6 +247,7 @@
 
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 
+SET @verbose= 'Y';
 SET @commands= 'configure';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
@@ -1608,16 +1609,16 @@ SET @commands= 'B N TeN-func R';
 --echo ###################################################################################
 --echo #                               2 - SAVEPOINT
 --echo ###################################################################################
-SET @commands= 'B T S1 T R1 C';
+SET @commands= 'B T Sn T Rn C';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
-SET @commands= 'B N T S1 T R1 C';
+SET @commands= 'B N T Sn T Rn C';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
-SET @commands= 'B T N S1 T R1 C';
+SET @commands= 'B T N Sn T Rn C';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
-SET @commands= 'B T S1 N T R1 C';
+SET @commands= 'B T Sn N T Rn C';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
 --echo ###################################################################################
@@ -1728,7 +1729,7 @@ SET @commands= 'B T CT R';
 SET @commands= 'drop-CT';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
-SET @commands= 'B T S1 T CT R1 R';
+SET @commands= 'B T Sn T CT Rn R';
 --source extra/rpl_tests/rpl_mixing_engines.inc
 
 SET @commands= 'drop-CT';

=== modified file 'mysql-test/r/not_partition.result'
--- a/mysql-test/r/not_partition.result	revid:vasil.dimov@stripped
+++ b/mysql-test/r/not_partition.result	revid:vasil.dimov@stripped
@@ -3,7 +3,7 @@ FLUSH TABLES;
 SELECT * FROM t1;
 ERROR 42000: Unknown storage engine 'partition'
 TRUNCATE TABLE t1;
-ERROR 42000: Unknown storage engine 'partition'
+ERROR 42S02: Table 'test.t1' doesn't exist
 ANALYZE TABLE t1;
 Table	Op	Msg_type	Msg_text
 test.t1	analyze	Error	Unknown storage engine 'partition'

=== modified file 'mysql-test/r/partition_exchange.result'
--- a/mysql-test/r/partition_exchange.result	revid:vasil.dimov@stripped
+++ b/mysql-test/r/partition_exchange.result	revid:vasil.dimov@stripped
@@ -8,7 +8,7 @@ engine=innodb
 PARTITION BY LIST (s1)
 (PARTITION p1 VALUES IN (1,2,3));
 ALTER TABLE t3 EXCHANGE PARTITION p1 WITH TABLE t1;
-ERROR HY000: Table to exchange with partition have foreign key references: 't1'
+ERROR HY000: Table to exchange with partition has foreign key references: 't1'
 DROP TABLE t2, t1, t3;
 # Tests for WL#4445
 CREATE TABLE t (a INT,

=== modified file 'mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result'
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	revid:vasil.dimov@stripped
@@ -196,6 +196,7 @@ Log_name	Pos	Event_type	Server_id	End_lo
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `my_savepoint`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 delete from t1;
 delete from t2;
@@ -217,6 +218,7 @@ Log_name	Pos	Event_type	Server_id	End_lo
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `my_savepoint`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
@@ -270,6 +272,7 @@ Log_name	Pos	Event_type	Server_id	End_lo
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `my_savepoint`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result	revid:vasil.dimov@stripped
@@ -182,6 +182,7 @@ show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(14)
+master-bin.000001	#	Query	#	#	SAVEPOINT `my_savepoint`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 delete from t1;
 delete from t2;
@@ -202,6 +203,7 @@ show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(16)
+master-bin.000001	#	Query	#	#	SAVEPOINT `my_savepoint`
 master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(18)
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 delete from t1;
@@ -255,6 +257,7 @@ show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(16)
+master-bin.000001	#	Query	#	#	SAVEPOINT `my_savepoint`
 master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(18)
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 master-bin.000001	#	Query	#	#	BEGIN

=== modified file 'mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result'
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result	revid:vasil.dimov@stripped
@@ -992,6 +992,7 @@ master-bin.000001	#	Query	#	#	use `test_
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test_rpl`; INSERT INTO t1 VALUES (3, 'before savepoint s1')
+master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2')

=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result	revid:vasil.dimov@stripped
@@ -8,6 +8,7 @@ start slave;
 #                            CONFIGURATION
 #########################################################################
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET @verbose= 'Y';
 SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -10200,31 +10201,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10241,42 +10244,42 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B N T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B N T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10293,42 +10296,42 @@ master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4)
 master-bin.000001	#	Query	#	#	COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10338,10 +10341,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -10353,34 +10356,34 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn N T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn N T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
 #                            3 - CREATE TABLE...SELECT
@@ -11323,10 +11326,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -11335,33 +11338,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b-
 ROLLBACK;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;

=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result	revid:vasil.dimov@stripped
@@ -8,6 +8,7 @@ start slave;
 #                            CONFIGURATION
 #########################################################################
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET @verbose= 'Y';
 SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -10568,31 +10569,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10609,42 +10612,42 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B N T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B N T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10662,31 +10665,31 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -10694,11 +10697,11 @@ master-bin.000001	#	Write_rows	#	#	table
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10708,10 +10711,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -10724,23 +10727,23 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn N T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -10748,11 +10751,11 @@ master-bin.000001	#	Write_rows	#	#	table
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn N T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
 #                            3 - CREATE TABLE...SELECT
@@ -11695,10 +11698,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -11707,33 +11710,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b-
 ROLLBACK;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;

=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result	revid:vasil.dimov@stripped
@@ -8,6 +8,7 @@ start slave;
 #                            CONFIGURATION
 #########################################################################
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET @verbose= 'Y';
 SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -12176,33 +12177,35 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -12220,33 +12223,33 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B N T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -12255,12 +12258,12 @@ master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B N T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -12278,33 +12281,33 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -12313,12 +12316,12 @@ master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -12328,10 +12331,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -12344,25 +12347,25 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn N T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -12371,12 +12374,12 @@ master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn N T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
 #                            3 - CREATE TABLE...SELECT
@@ -13555,10 +13558,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -13567,35 +13570,35 @@ Log_name	Pos	Event_type	Server_id	End_lo
 CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b-
 ROLLBACK;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;

=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result	revid:vasil.dimov@stripped
@@ -8,6 +8,7 @@ start slave;
 #                            CONFIGURATION
 #########################################################################
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET @verbose= 'Y';
 SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -9818,31 +9819,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -9859,42 +9862,42 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B N T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B N T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -9910,41 +9913,41 @@ Warnings:
 Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -9954,10 +9957,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5);
 Warnings:
@@ -9968,33 +9971,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5)
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn N T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5)
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn N T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
 #                            3 - CREATE TABLE...SELECT
@@ -10885,10 +10888,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -10897,33 +10900,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b-
 ROLLBACK;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result	revid:vasil.dimov@stripped
@@ -8,6 +8,7 @@ start slave;
 #                            CONFIGURATION
 #########################################################################
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET @verbose= 'Y';
 SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -12176,33 +12177,35 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -12220,33 +12223,33 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B N T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -12255,12 +12258,12 @@ master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B N T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -12278,33 +12281,33 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -12313,12 +12316,12 @@ master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -12328,10 +12331,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -12344,25 +12347,25 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn N T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
@@ -12371,12 +12374,12 @@ master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn N T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
 #                            3 - CREATE TABLE...SELECT
@@ -13555,10 +13558,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -13567,35 +13570,35 @@ Log_name	Pos	Event_type	Server_id	End_lo
 CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b-
 ROLLBACK;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result	revid:vasil.dimov@stripped
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result	revid:vasil.dimov@stripped
@@ -8,6 +8,7 @@ start slave;
 #                            CONFIGURATION
 #########################################################################
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET @verbose= 'Y';
 SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -9950,31 +9951,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2)
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -9991,42 +9994,42 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B N T Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B N T Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10043,42 +10046,42 @@ master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4)
 master-bin.000001	#	Query	#	#	COMMIT
 -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T N Sn T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T N Sn T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
 BEGIN;
@@ -10088,10 +10091,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -10103,34 +10106,34 @@ master-bin.000001	#	Query	#	#	COMMIT
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
 COMMIT;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 -e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn N T Rn C << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5)
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7)
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn N T Rn C << -e-e-e-e-e-e-e-e-e-e-e-
 
 ###################################################################################
 #                            3 - CREATE TABLE...SELECT
@@ -11028,10 +11031,10 @@ Log_name	Pos	Event_type	Server_id	End_lo
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b-
-SAVEPOINT s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Sn << -b-b-b-b-b-b-b-b-b-b-b-
+SAVEPOINT S_0;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Sn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
 INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5);
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
@@ -11040,33 +11043,33 @@ Log_name	Pos	Event_type	Server_id	End_lo
 CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b-
-ROLLBACK TO s1;
+-b-b-b-b-b-b-b-b-b-b-b- >> Rn << -b-b-b-b-b-b-b-b-b-b-b-
+ROLLBACK TO S_0;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> Rn << -e-e-e-e-e-e-e-e-e-e-e-
 -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b-
 ROLLBACK;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
 -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T Sn T CT Rn R << -b-b-b-b-b-b-b-b-b-b-b-
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2)
-master-bin.000001	#	Query	#	#	SAVEPOINT `s1`
+master-bin.000001	#	Query	#	#	SAVEPOINT `S_0`
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5)
 master-bin.000001	#	Query	#	#	use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb
-master-bin.000001	#	Query	#	#	ROLLBACK TO `s1`
+master-bin.000001	#	Query	#	#	ROLLBACK TO `S_0`
 master-bin.000001	#	Query	#	#	ROLLBACK
--e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e-
+-e-e-e-e-e-e-e-e-e-e-e- >> B T Sn T CT Rn R << -e-e-e-e-e-e-e-e-e-e-e-
 
 -b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b-
 DROP TEMPORARY TABLE IF EXISTS tt_xx_12;

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	revid:vasil.dimov@stripped
+++ b/sql/binlog.cc	revid:vasil.dimov@stripped
@@ -697,20 +697,35 @@ static int binlog_rollback(handlerton *h
 static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
 {
   DBUG_ENTER("binlog_savepoint_set");
-
-  binlog_trans_log_savepos(thd, (my_off_t*) sv);
-  /* Write it to the binary log */
+  int error= 1;
 
   String log_query;
   if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) ||
       log_query.append("`") ||
       log_query.append(thd->lex->ident.str, thd->lex->ident.length) ||
       log_query.append("`"))
-    DBUG_RETURN(1);
+    DBUG_RETURN(error);
+
   int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
   Query_log_event qinfo(thd, log_query.c_ptr_safe(), log_query.length(),
                         TRUE, FALSE, TRUE, errcode);
-  DBUG_RETURN(mysql_bin_log.write(&qinfo));
+  /* 
+    We cannot record the position before writing the statement
+    because a rollback to a savepoint (.e.g. consider it "S") would
+    prevent the savepoint statement (i.e. "SAVEPOINT S") from being
+    written to the binary log despite the fact that the server could
+    still issue other rollback statements to the same savepoint (i.e. 
+    "S"). 
+    Given that the savepoint is valid until the server releases it,
+    ie, until the transaction commits or it is released explicitly,
+    we need to log it anyway so that we don't have "ROLLBACK TO S"
+    or "RELEASE S" without the preceding "SAVEPOINT S" in the binary
+    log.
+  */
+  if (!(error= mysql_bin_log.write(&qinfo)))
+    binlog_trans_log_savepos(thd, (my_off_t*) sv);
+
+  DBUG_RETURN(error);
 }
 
 static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	revid:vasil.dimov@stripped
+++ b/sql/share/errmsg-utf8.txt	revid:vasil.dimov@stripped
@@ -6434,5 +6434,5 @@ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MA
   eng "The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout."
 
 ER_PARTITION_EXCHANGE_FOREIGN_KEY
-  eng "Table to exchange with partition have foreign key references: '%-.64s'"
+  eng "Table to exchange with partition has foreign key references: '%-.64s'"
   swe "Tabellen att byta ut mot partition har foreign key referenser: '%-.64s'"


Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20101019120033-3fu2ig4ynvhgijng.bundle
Thread
bzr commit into mysql-trunk-innodb branch (vasil.dimov:3259) vasil.dimov19 Oct