MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:September 13 2009 4:12pm
Subject:bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687 WL#5072
View as plain text  
#At file:///home/acorreia/workspace.sun/repository.mysql/bzrwork/bug-40278/mysql-pe-wl2687-push/ based on revid:alfranio.correia@stripped

 3514 Alfranio Correia	2009-09-13
      WL#5072 Write a Test Case for WL#2687
      
      Checks if transactions that mixes transactional and non-transactional tables are
      correctly handled.

    added:
      mysql-test/extra/rpl_tests/rpl_mixing_engines.inc
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
      mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
      mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
    modified:
      mysql-test/extra/rpl_tests/rpl_mixing_engines.test
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
      mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
=== added file 'mysql-test/extra/rpl_tests/rpl_mixing_engines.inc'
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc	2009-09-13 16:12:48 +0000
@@ -0,0 +1,378 @@
+if (`SELECT strcmp(@commands, 'configure') = 0`)
+{
+  connection master;
+
+  SET SQL_LOG_BIN=0;
+  CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  SET SQL_LOG_BIN=1;
+
+  connection slave;
+
+  SET SQL_LOG_BIN=0;
+  CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+  CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+  SET SQL_LOG_BIN=1;
+
+  connection master;
+
+  INSERT INTO nt_1(b) VALUES(1);
+  INSERT INTO nt_2(b) VALUES(1);
+  INSERT INTO nt_3(b) VALUES(1);
+  INSERT INTO nt_4(b) VALUES(1);
+  INSERT INTO nt_5(b) VALUES(1);
+  INSERT INTO nt_6(b) VALUES(1);
+
+  INSERT INTO tt_1(b) VALUES(1);
+  INSERT INTO tt_2(b) VALUES(1);
+  INSERT INTO tt_3(b) VALUES(1);
+  INSERT INTO tt_4(b) VALUES(1);
+  INSERT INTO tt_5(b) VALUES(1);
+  INSERT INTO tt_6(b) VALUES(1);
+
+  DELIMITER |;
+
+  CREATE PROCEDURE pc_i_tt_3_suc (IN y VARCHAR(64))
+  BEGIN
+    INSERT INTO tt_3(a,c) VALUES (y, y);
+    INSERT INTO tt_3(a,c) VALUES (y, y);
+  END|
+
+  CREATE PROCEDURE pc_i_nt_4_suc (IN y VARCHAR(64))
+  BEGIN
+    INSERT INTO nt_4(a,c) VALUES (y, y);
+    INSERT INTO nt_4(a,c) VALUES (y, y);
+  END|
+
+  CREATE PROCEDURE pc_i_tt_5_suc (IN y VARCHAR(64))
+  BEGIN
+    INSERT INTO tt_5(a,c) VALUES (y, y);
+    INSERT INTO tt_5(a,c) VALUES (y, y);
+  END|
+
+  CREATE PROCEDURE pc_i_nt_5_suc (IN y VARCHAR(64))
+  BEGIN
+    INSERT INTO nt_5(a,c) VALUES (y, y);
+    INSERT INTO nt_5(a,c) VALUES (y, y);
+  END|
+
+  CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+  BEGIN
+    INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+    INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+  END|
+
+  CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+  BEGIN
+    INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+    INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+  END|
+
+  CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+  BEGIN
+    INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+    INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+  END|
+
+  CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+  BEGIN
+    INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+    INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+  END|
+
+  DELIMITER ;|
+
+  SET @commands='';
+}
+
+if (`SELECT strcmp(@commands, 'clean') = 0`)
+{
+  connection master;
+
+  DROP TABLE tt_1;
+  DROP TABLE tt_2;
+  DROP TABLE tt_3;
+  DROP TABLE tt_4;
+  DROP TABLE tt_5;
+  DROP TABLE tt_6;
+
+  DROP TABLE nt_1;
+  DROP TABLE nt_2;
+  DROP TABLE nt_3;
+  DROP TABLE nt_4;
+  DROP TABLE nt_5;
+  DROP TABLE nt_6;
+
+  DROP PROCEDURE pc_i_tt_3_suc;
+  DROP PROCEDURE pc_i_nt_4_suc;
+  DROP PROCEDURE pc_i_tt_5_suc;
+  DROP PROCEDURE pc_i_nt_5_suc;
+
+  sync_slave_with_master;
+
+  SET @commands='';
+}
+
+if (`SELECT strcmp(@commands, '') != 0`)
+{
+  #--let $val= `SELECT @commands`
+  #--echo DEBUG--$val
+
+  --disable_query_log
+  SET @command= SUBSTRING_INDEX(@commands, ' ', 1);
+  if (`SELECT strcmp(@command, 'B') = 0`)
+  {
+    --enable_query_log
+    eval BEGIN;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command,'T') = 0`)
+  {
+    let $key_tt1= `SELECT max(b) from tt_1`;
+    inc $key_tt1;
+    --enable_query_log
+    eval INSERT INTO tt_1(a, c) VALUES ("new text $key_tt1", "new text $key_tt1");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'T-trig') = 0`)
+  {
+    let $key_tt5= `SELECT max(b) from tt_5`;
+    inc $key_tt5;
+    --enable_query_log
+    if (`select @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
+    {
+      eval INSERT INTO tt_5(a,c) VALUES ("new text $key_tt5", "new text $key_tt5");
+    }
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'T-proc') = 0`)
+  {
+    let $key_tt5= `SELECT max(b) from tt_5`;
+    inc $key_tt5;
+    --enable_query_log
+    if (`select @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
+    {
+      eval CALL pc_i_tt_5_suc ("new text $key_tt5");
+    }
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Te-begin') = 0`)
+  {
+    let $key_tt1= `SELECT max(b) from tt_1`;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO tt_1(a, b, c) VALUES ("new text $key_tt1", $key_tt1, "new text $key_tt1");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Te-end') = 0`)
+  {
+    let $key_tt1= `SELECT max(b) from tt_1`;
+    let $old_key= $key_tt1;
+    inc $key_tt1;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO tt_1(a, b, c) VALUES ("new text $key_tt1", $key_tt1, "new text $key_tt1"), ("new text $old_key", $old_key, "new text $old_key");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Te-trig') = 0`)
+  {
+    let $key_tt5= `SELECT max(b) from tt_5`;
+    let $old_key= $key_tt5;
+    inc $key_tt5;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO tt_5(a, b, c) VALUES ("new text $key_tt5", $key_tt5, "new text $key_tt5"), ("new text $old_key", $old_key, "new text $old_key");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'N') = 0`)
+  {
+    let $key_nt1= `SELECT max(b) from nt_1`;
+    inc $key_nt1;
+    --enable_query_log
+    eval INSERT INTO nt_1(a, c) VALUES ("new text $key_nt1", "new text $key_nt1");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'N-trig') = 0`)
+  {
+    let $key_nt5= `SELECT max(b) from nt_5`;
+    inc $key_nt5;
+    --enable_query_log
+    eval INSERT INTO nt_5(a, c) VALUES ("new text $key_nt5", "new text $key_nt5");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'N-proc') = 0`)
+  {
+    let $key_nt5= `SELECT max(b) from nt_5`;
+    inc $key_nt5;
+    --enable_query_log
+    eval CALL pc_i_nt_5_suc ("new text $key_nt5");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Ne-begin') = 0`)
+  {
+    let $key_nt1= `SELECT max(b) from nt_1`;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO nt_1(a, b, c) VALUES ("new text $key_nt1", $key_nt1, "new text $key_nt1");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Ne-end') = 0`)
+  {
+    let $key_nt1= `SELECT max(b) from nt_1`;
+    let $old_key= $key_nt1;
+    inc $key_nt1;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO nt_1(a, b, c) VALUES ("new text $key_nt1", $key_nt1, "new text $key_nt1"), ("new text $old_key", $old_key, "new text $old_key");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Ne-trig') = 0`)
+  {
+    let $key_nt5= `SELECT max(b) from nt_5`;
+    let $old_key= $key_nt5;
+    inc $key_nt5;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO nt_5(a, b, c) VALUES ("new text $key_nt5", $key_nt5, "new text $key_nt5"), ("new text $old_key", $old_key, "new text $old_key");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Nt') = 0`)
+  {
+    let $key_nt1= `SELECT max(b) from nt_1`;
+    inc $key_nt1;
+    --enable_query_log
+    eval INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'Nte') = 0`)
+  {
+    let $key_nt1= `SELECT max(b) from nt_1`;
+    let $old_key= $key_nt1;
+    inc $key_nt1;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO nt_1(a, b, c) SELECT COUNT(*), $key_nt1, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), $old_key, COUNT(*) FROM tt_1;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'nT') = 0`)
+  {
+    let $key_tt1= `SELECT max(b) from tt_1`;
+    inc $key_tt1;
+    --enable_query_log
+    eval INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'nTe') = 0`)
+  {
+    let $key_tt1= `SELECT max(b) from tt_1`;
+    let $old_key= $key_tt1;
+    inc $key_tt1;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO tt_1(a, b, c) SELECT COUNT(*), $key_tt1, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), $old_key, COUNT(*) FROM nt_1;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'NT') = 0`)
+  {
+    let $key_nt4= `SELECT max(b) from nt_4`;
+    inc $key_nt4;
+    --enable_query_log
+    eval UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text $key_nt4", nt_4.a= "new text $key_nt4", tt_3.a= "new text $key_nt4", tt_4.a= "new text $key_nt4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'NT-trig') = 0`)
+  {
+    let $key_nt4= `SELECT max(b) from nt_4`;
+    inc $key_nt4;
+    --enable_query_log
+    eval INSERT INTO nt_4(a, c) VALUES ("new text $key_nt4", "new text $key_nt4");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'NT-proc') = 0`)
+  {
+    let $key_nt4= `SELECT max(b) from nt_4`;
+    inc $key_nt4;
+    --enable_query_log
+    eval CALL pc_i_nt_4_suc ("new text $key_nt4");
+    --disable_query_log
+  }
+  if (`SELECT strcmp (@command, 'NTe-trig') = 0`)
+  {
+    let $key_nt4= `SELECT max(b) from nt_4`;
+    let $old_key= $key_nt4;
+    inc $key_nt4;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO nt_4(a, b, c) VALUES ("new text $key_nt4", $key_nt4, "new text $key_nt4"), ("new text $old_key", $old_key, "new text $old_key");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'TN') = 0`)
+  {
+    let $key_tt3= `SELECT max(b) from tt_3`;
+    inc $key_tt3;
+    --enable_query_log
+    eval UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text $key_tt3", tt_4.a= "new text $key_tt3", nt_3.a= "new text $key_tt3", nt_4.a= "new text $key_tt3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'TN-trig') = 0`)
+  {
+    let $key_tt3= `SELECT max(b) from tt_3`;
+    inc $key_tt3;
+    --enable_query_log
+    eval INSERT INTO tt_3(a, c) VALUES ("new text $key_tt3", "new text $key_tt3");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'TN-proc') = 0`)
+  {
+    let $key_tt3= `SELECT max(b) from tt_3`;
+    inc $key_tt3;
+    --enable_query_log
+    eval CALL pc_i_tt_3_suc ("new text $key_tt3");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'TNe-trig') = 0`)
+  {
+    let $key_tt3= `SELECT max(b) from tt_3`;
+    let $old_key= $key_tt3;
+    inc $key_tt3;
+    --enable_query_log
+    --error ER_DUP_ENTRY
+    eval INSERT INTO tt_3(a, b, c) VALUES ("new text $key_tt3", $key_tt3, "new text $key_tt3"), ("new text $old_key", $old_key, "new text $old_key");
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'C') = 0`)
+  {
+    --enable_query_log
+    eval COMMIT;
+    --disable_query_log
+  }
+  if (`SELECT strcmp(@command, 'R') = 0`)
+  {
+    --enable_query_log
+    eval ROLLBACK;
+    --disable_query_log
+  }
+  SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1));
+  --enable_query_log
+  --source extra/rpl_tests/rpl_mixing_engines.inc
+}

=== modified file 'mysql-test/extra/rpl_tests/rpl_mixing_engines.test'
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test	2009-08-27 12:46:29 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test	2009-09-13 16:12:48 +0000
@@ -1,388 +1,819 @@
-###################################################################################
-# This test checks if transactions that mixes transactional and non-transactional
-# tables are correctly handled in statement mode. In an nutshell, we have what 
-# follows:
+################################################################################
+# This checks if transactions that mixes transactional and non-transactional are
+# correctly handled as follows. 
 #
-# 1) "B T T C" generates in binlog the "B T T C" entries.
+# Definitions:
 #
-# 2) "B T T R"  generates in binlog an "empty" entry.
+#   D1. A table that has a transactional engine is called a T-table.
 #
-# 3) "B T N C" generates in binlog the "B T N C" entries.
+#   D2. A table that has a non-transactional engine is called an
+#       N-table.
 #
-# 4) "B T N R" generates in binlog the "B T N R" entries.
+#   D3. Events are either appended to the Transaction Cache (TC) or to
+#       the Statement Cache (SC).
 #
-# 5) "T" generates in binlog the "B T C" entry.
+# CALL statements are unrolled, so that each statement executed by the
+# stored procedure is logged separately. (If a stored procedure A
+# invokes a stored procedure B, then B is unrolled recursively).  In the
+# following, we assume that unrolling has already been done, and the
+# word "statement" refers to a non-CALL top-level statement or a
+# non-CALL sub-statement.
 #
-# 6) "N" generates in binlog the "N" entry.
+# Let S be a statement that either updates a T-table or N-table.
 #
-# 7) "M" generates in binglog the "B M C" entries.
+# 1. Before executing S, determine unsafeness.
 #
-# 8) "B N N T C" generates in binglog the "N N B T C" entries.
+#   R1. If S reads or writes an N-table, and either S or a previous
+#       statement in the same transaction reads or writes to a T-table,
+#       then S is marked as unsafe.
 #
-# 9) "B N N T R" generates in binlog the "N N B T R" entries.
+# 2. When logging S, determine where to log it by applying the following
+#   rules in order.
 #
-# 10) "B N N C" generates in binglog the "N N" entries.
+#   R2. If logging in statement format:
 #
-# 11) "B N N R" generates in binlog the "N N" entries.
+#       - If S produces an error and does not update any N-table, do
+#         not log.
 #
-# 12) "B M T C" generates in the binlog the "B M T C" entries.
+#       - Otherwise, if either S or any previous statement in the same
+#         transaction reads or writes to any T-tables, log to TC.
 #
-# 13) "B M T R" generates in the binlog the "B M T R" entries.
-###################################################################################
+#       - Otherwise, log to SC.
+#
+#   R3. If logging in row format:
+#
+#       - Log row events that update N-tables to SC.
+#
+#       - If S produces an error, do not log row events that update
+#         T-tables.
+#
+#       - If S does not produce an error, log row events that update
+#         T-tables to TC.
+#
+#   R4. At the end of S, write the SC to the binlog and clear the SC.
+#
+# 3. At end of transaction:
+#
+#   R5. At COMMIT, if the COMMIT does not produce an error:
+#        - If the TC is non-empty, write BEGIN + TC + COMMIT to the binlog.
+#        - If the TC is empty, do nothing.
+#
+#   R6. At ROLLBACK or at COMMIT that produces an error:
+#        - If the TC contains writes to N-tables, write
+#          BEGIN + TC + ROLLBACK to the binlog.
+#        - If the TC does not contain writes to N-tables, do nothing.
+#
+#   R7. Clear the TC at the end of the transaction.
+#
+# In addition, we have the following properties:
+#
+#   R8. Savepoints should not affect the content of the SC cache.
+#
+#   R9. CREATE * SELECT should be flushed to the binary log as an atomic
+#   operation regarless the type of the table.
+# 
+# The format of the entries in the binlog depends on the mode and on the type
+# statements. In what follows, we use the following convention 
+#
+# - Format of the log:
+# S - statement.
+# R - row.
+#
+# - Define the scope of a transaction:
+# B - Begin.
+# C - Commit.
+# R - Rollback.
+#
+# - Change only T-Tables:
+# T - Updates a T-Table.
+# T-trig - Updates T-Tables through a trigger.
+# T-proc - Updates T-Tables through a procedure.
+# Te-beging - Fails while updating the first tuple in a T-Table.
+# Te-end - Fails while updating an n-tuple (n > 1) in a T-Table.
+# Te-trig - Fails while updating an n-tuple (n > 1) in a T-Table.
+#
+# - Change only N-Tables 
+# N - Updates a N-Table.
+# N-trig - Updates N-Tables through a trigger.
+# N-proc - Updates N-Tables through a procedure.
+# Ne-beging - Fails while updating the first tuple in a N-Table.
+# Ne-end - Fails while updating an n-tuple (n > 1) in a N-Table.
+# Ne-trig - Fails while updating an n-tuple (n > 1) in a N-Table.
+#
+# - Access both types of tables and change N-Tables:
+# Nt - Updates a N-Table
+# Nte - Fails while updating an n-tuple (n > 1) in a N-Table.
+#
+# - Access both types of tables and change N-Tables:
+# nT - Updates a T-Table.
+# nTe - Fails while updating an n-tuple (n > 1) in a T-Table.
+#
+# - Access and update both types of tables. First a N-Table and the a T-Table:
+# NT - Upates both types of tables through an update statement.
+# NT-trig - Updates both types of tables through a trigger.
+# NT-proc - Updates both types of tables through a procedure.
+# NTe-trig - Fails while updating an n-tuple (n > 1) in a T-Table.
+#
+# - Access and update both types of tables. First a T-Table and the a N-Table:
+# TN - Upates both types of tables through an update statement.
+# TN-trig - Updates both types of tables through a trigger.
+# TN-proc - Updates both types of tables through a procedure.
+# TNe-trig - Fails while updating an n-tuple (n > 1) in a N-Table.
+# 
+# For further details, please, read WL#2687 and WL#5072.
+################################################################################
+--source include/have_innodb.inc
  
---echo ###################################################################################
---echo #                                   CONFIGURATION
---echo ###################################################################################
+--echo #########################################################################
+--echo #                            CONFIGURATION
+--echo #########################################################################
+SET @commands= 'configure';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+--echo #########################################################################
+--echo #         1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
+--echo #########################################################################
 connection master;
 
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-
-connection slave;
-
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #1) Generates in the binlog what follows:
+--echo #      --> STMT  "B T C" entries, format S.
+--echo #      --> ROW   "B T C" entries, format R.
+--echo #      --> MIXED "B T C" entries, format S.
+--echo #
+SET @commands= 'T';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'T-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-connection master;
+SET @commands= 'T-proc';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELIMITER |;
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
-CREATE FUNCTION f1 () RETURNS VARCHAR(64)
-BEGIN
-  RETURN "Testing...";
-END|
-
-CREATE FUNCTION f2 () RETURNS VARCHAR(64)
-BEGIN
-  RETURN f1();
-END|
-
-CREATE PROCEDURE pc_i_tt_3 (IN x INT, IN y VARCHAR(64))
-BEGIN
-  INSERT INTO tt_3 VALUES (y,x,x);
-END|
-
-CREATE TRIGGER tr_i_tt_3_to_nt_3 BEFORE INSERT ON tt_3 FOR EACH ROW
-BEGIN
-  INSERT INTO nt_3 VALUES (NEW.a, NEW.b, NEW.c);
-END|
-
-CREATE TRIGGER tr_i_nt_4_to_tt_4 BEFORE INSERT ON nt_4 FOR EACH ROW
-BEGIN
-  INSERT INTO tt_4 VALUES (NEW.a, NEW.b, NEW.c);
-END|
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #1.e) Generates in the binlog what follows:
+--echo #        --> STMT  empty.
+--echo #        --> ROW   empty.
+--echo #        --> MIXED empty.
+--echo #
+SET @commands= 'Te-begin';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELIMITER ;|
+SET @commands= 'Te-end';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
---echo ###################################################################################
---echo #                 MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
---echo ###################################################################################
-connection master;
+SET @commands= 'Te-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #1) "B T T C" generates in binlog the "B T T C" entries.
+--echo #2) Generates in the binlog what follows:
+--echo #      --> STMT  "N" entry, format S.
+--echo #      --> ROW   "N" entry, format R.
+--echo #      --> MIXED "N" entry, format S.
 --echo #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4");
-INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4");
-COMMIT;
+SET @commands= 'N';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'N-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'N-proc';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #1.e) "B T T C" with error in T generates in binlog the "B T T C" entries.
+--echo #2.e) Generates in the binglog what follows if a N-table is changed:
+--echo #        --> STMT  "N" entry, format S.
+--echo #        --> ROW   "N" entry, format R.
+--echo #        --> MIXED "N" entry, format S.
 --echo #
-INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2");
-BEGIN;
---error ER_DUP_ENTRY
-INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -2", -2, "new text -2");
-INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3");
-COMMIT;
+SET @commands= 'Ne-begin';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5");
---error ER_DUP_ENTRY
-INSERT INTO tt_2 VALUES ("new text -4", -4, "new text -4"), ("new text -5", -5, "new text -5");
-COMMIT;
+SET @commands= 'Ne-end';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'Ne-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #2) "B T T R"  generates in binlog an "empty" entry.
+--echo #3) Generates in the binglog what follows:
+--echo #      --> STMT  "M" entry if only N-Table is changed, format S.
+--echo #      --> STMT  "B M C" entries, format S.
+--echo #      --> ROW   "N B T C" entries, format R.
+--echo #      --> MIXED "N B T C" entries, format R.
 --echo #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 5", 5, "new text 5");
-INSERT INTO tt_2 VALUES ("new text 5", 5, "new text 5");
-ROLLBACK;
+SET @commands= 'Nt';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'nT';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'NT';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'NT-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'NT-proc';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'TN';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'TN-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'TN-proc';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #2.e) "B T T R"  with error in T generates in binlog an "empty" entry.
+--echo #3.e) Generates in the binglog what follows:
+--echo #      --> STMT  "M" entry if only N-Table is changed, format S.
+--echo #      --> STMT  "B M R" entries, format S.
+--echo #      --> ROW   "N" entry, format R.
+--echo #      --> MIXED "N" entry, format R.
+SET @commands= 'Nte';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'nTe';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'NTe-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'TNe-trig';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
-INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7");
-BEGIN;
---error ER_DUP_ENTRY
-INSERT INTO tt_1 VALUES ("new text -6", -6, "new text -6"), ("new text -7", -7, "new text -7");
-INSERT INTO tt_2 VALUES ("new text -8", -8, "new text -8");
-ROLLBACK;
+--echo #4) Generates in the binlog what follows:
+--echo #     --> STMT  "B T T C" entries, format S.
+--echo #     --> ROW   "B T T C" entries, format R.
+--echo #     --> MIXED "B T T C" entries, format S
+--echo #
+SET @commands= 'B T T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_2 VALUES ("new text -10", -10, "new text -10");
---error ER_DUP_ENTRY
-INSERT INTO tt_2 VALUES ("new text -9", -9, "new text -9"), ("new text -10", -10, "new text -10");
-ROLLBACK;
+SET @commands= 'B T T-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T T-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig T-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig T-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T-proc T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc T-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc T-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #3) "B T N C" generates in binlog the "B T N C" entries.
+--echo #4.e) Generates in the binlog what follows:
+--echo #       --> STMT  "B T C" entries, format S.
+--echo #       --> ROW   "B T C" entries, format R.
+--echo #       --> MIXED "B T C" entries, format S.
 --echo #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6");
-INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6");
-COMMIT;
+SET @commands= 'B T Te-begin C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T Te-end C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T Te-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-begin T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-end T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #3.e) "B T N C" with error in either T or N generates in binlog the "B T N C" entries.
+--echo #5) Generates in the binlog what follows:
+--echo #     --> STMT  empty.
+--echo #     --> ROW   empty.
+--echo #     --> MIXED empty.
 --echo #
-INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12");
-BEGIN;
---error ER_DUP_ENTRY
-INSERT INTO tt_1 VALUES ("new text -11", -11, "new text -11"), ("new text -12", -12, "new text -12");
-INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13");
-COMMIT;
+SET @commands= 'B T T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14");
-INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16");
---error ER_DUP_ENTRY
-INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16");
-COMMIT;
+SET @commands= 'B T T-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T T-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig T-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T-trig T-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc T-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc T-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #4) "B T N R" generates in binlog the "B T N R" entries.
+--echo #5.e) Generates in the binlog what follows:
+--echo #       --> STMT  empty.
+--echo #       --> ROW   empty.
+--echo #       --> MIXED empty.
 --echo #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7");
-INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7");
-ROLLBACK;
+SET @commands= 'B T Te-begin R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T Te-end R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T Te-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-begin T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-end T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #4.e) "B T N R" with error in either T or N generates in binlog the "B T N R" entries.
+--echo #6) Generates in the binglog what follows:
+--echo #     --> STMT  "N N" entries, format S.
+--echo #     --> ROW   "N N" entries, format R.
+--echo #     --> MIXED "N N" entries, format S.
 --echo #
-INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17");
-BEGIN;
---error ER_DUP_ENTRY
-INSERT INTO tt_1 VALUES ("new text -16", -16, "new text -16"), ("new text -17", -17, "new text -17");
-INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18");
-ROLLBACK;
+SET @commands= 'B N N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19");
-INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21");
---error ER_DUP_ENTRY
-INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21");
-ROLLBACK;
+SET @commands= 'B N N-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N N-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig N-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig N-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B N-proc N-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc N-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #5) "T" generates in binlog the "B T C" entry.
+--echo #6.e) Generates in the binglog what follows if a N-Table is changed:
+--echo #     --> STMT  "N N" entries, format S.
+--echo #     --> ROW   "N N" entries, format R.
+--echo #     --> MIXED "N N" entries, format S.
 --echo #
-INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8");
+SET @commands= 'B N Ne-begin C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N Ne-end C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N Ne-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Ne-begin N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Ne-end N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B Ne-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #5.e) "T" with error in T generates in binlog an "empty" entry.
+--echo #7) Generates in the binlog what follows:
+--echo #      --> STMT  "N N" entries, format S.
+--echo #      --> ROW   "N N" entries, format R.
+--echo #      --> MIXED "N N" entries, format S.
 --echo #
-INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1");
---error ER_DUP_ENTRY
-INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -22", -22, "new text -22");
---error ER_DUP_ENTRY
-INSERT INTO tt_1 VALUES ("new text -23", -23, "new text -23"), ("new text -1", -1, "new text -1");
+SET @commands= 'B N N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N N-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N N-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig N-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B N-trig N-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc N-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc N-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #6) "N" generates in binlog the "N" entry.
+--echo #7.e) Generates in the binglog what follows if a N-Table is changed:
+--echo #     --> STMT  "N N" entries, format S.
+--echo #     --> ROW   "N N" entries, format R.
+--echo #     --> MIXED "N N" entries, format S.
 --echo #
-INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9");
+SET @commands= 'B N Ne-begin R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N Ne-end R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N Ne-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B Ne-begin N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Ne-end N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Ne-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #6.e) "N" with error in N generates in binlog an empty entry if the error
---echo # happens in the first tuple. Otherwise, generates the "N" entry and
---echo # the error is appended.
+--echo #8) Generates in the binlog what follows:
+--echo #       --> STMT  "B T N C" entries, format S.
+--echo #       --> ROW   "N B T C" entries, format R.
+--echo #       --> MIXED "N B T C" entries, format R in N and S in T.
 --echo #
-INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
---error ER_DUP_ENTRY
-INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
---error ER_DUP_ENTRY
-INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1");
+SET @commands= 'B T N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T N-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T N-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig N-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-trig N-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc N-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T-proc N-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #7) "M" generates in binglog the "B M C" entries.
+--echo #8.e) Generates in the binlog what follows if T-* fails:
+--echo #       --> STMT  "N" entry, format S.
+--echo #       --> ROW   "N" entry, format R.
+--echo #       --> MIXED "N" entry, format R.
+--echo #     Otherwise, what follows if N-* fails and a N-Table is changed:
+--echo #       --> STMT  "B T N C" entries, format S.
+--echo #       --> ROW   "N B T C" entries, format R.
+--echo #       --> MIXED "N B T C" entries, format R in N and S in T.
 --echo #
+SET @commands= 'B Te-begin N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELETE FROM nt_1;
+SET @commands= 'B Te-end N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO nt_1 SELECT * FROM tt_1;
+SET @commands= 'B T Ne-begin C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELETE FROM tt_1;
+SET @commands= 'B T Ne-end C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO tt_1 SELECT * FROM nt_1; 
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
-INSERT INTO tt_3 VALUES ("new text 000", 000, '');
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #9) Generates in the binlog what follows:
+--echo #     --> STMT  "B T N R" entries, format S.
+--echo #     --> ROW   "N" entry, format R.
+--echo #     --> MIXED "N" entry, format R.
+--echo #
+SET @commands= 'B T N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO tt_3 VALUES("new text 100", 100, f1());
+SET @commands= 'B T N-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO nt_4 VALUES("new text 100", 100, f1());
+SET @commands= 'B T N-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO tt_3 VALUES("new text 200", 200, f2());
+SET @commands= 'B T-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO nt_4 VALUES ("new text 300", 300, '');
+SET @commands= 'B T-trig N-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO nt_4 VALUES ("new text 400", 400, f1());
+SET @commands= 'B T-trig N-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO nt_4 VALUES ("new text 500", 500, f2());
+SET @commands= 'B T-proc N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-CALL pc_i_tt_3(600, "Testing...");
+SET @commands= 'B T-proc N-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+SET @commands= 'B T-proc N-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #9.e) Generates in the binlog what follows if T* fails:
+--echo #       --> STMT  "N" entry, format S.
+--echo #       --> ROW   "N" entry, format R.
+--echo #       --> MIXED "N" entry, format R.
+--echo #     Otherwise, what follows if N* fails and a N-Table is changed:
+--echo #       --> STMT  "B T N R" entries, format S.
+--echo #       --> ROW   "N" entry, format R.
+--echo #       --> MIXED "N" entry, format R.
+--echo #
+SET @commands= 'B Te-begin N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B Te-end N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+SET @commands= 'B T Ne-begin R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T Ne-end R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
+
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #7.e) "M" with error in M generates in binglog the "B M R" entries.
+--echo #10) Generates in the binlog:
+--echo #     --> STMT  "N B T C" entries, format S.
+--echo #     --> ROW   "N B T C" entries, format R.
+--echo #     --> MIXED "N B T C" entries, format S.
 --echo #
+SET @commands= 'B N T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO nt_3 VALUES ("new text -26", -26, '');
-SELECT * FROM tt_3;
---error ER_DUP_ENTRY
-INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
-SELECT * FROM tt_3;
+SET @commands= 'B N T-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-INSERT INTO tt_4 VALUES ("new text -26", -26, '');
-SELECT * FROM nt_4;
---error ER_DUP_ENTRY
-INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
-SELECT * FROM nt_4;
+SET @commands= 'B N T-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B N-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig T-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig T-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc T-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc T-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #8) "B N N T C" generates in binglog the "N N B T C" entries.
+--echo #10.e) Check 8.e
 --echo #
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10");
-INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10");
-INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10");
-COMMIT;
 
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #11) Generates in the binlog what follows:
+--echo #     --> STMT  "N N" entries, format S.
+--echo #     --> ROW   "N N" entries, format R.
+--echo #     --> MIXED "N N" entries, format S.
+--echo #
+
+SET @commands= 'B N T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N T-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N T-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig T-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-trig T-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc T-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N-proc T-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
@@ -390,321 +821,583 @@ COMMIT;
 --echo
 --echo
 --echo #
---echo #8.e) "B N N T R" See 6.e and 9.e.
+--echo #11.e) Check 9.e
 --echo #
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #9) "B N N T R" generates in binlog the "N N B T R" entries.
+--echo #12) "B M T C" generates in the binlog what follows:
+--echo #      --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "B M T C" entries, format S.
+--echo #      --> ROW   "N B T T C" entries, format R.
+--echo #      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
 --echo #
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11");
-INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11");
-INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11");
-ROLLBACK;
+SET @commands= 'B Nt T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B nT T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NT T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NT-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B NT-proc T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TN T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TN-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TN-proc T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #9.e) "B N N T R" with error in N generates in binlog the "N N B T R" entries.
+--echo #12.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #        --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+--echo #        --> STMT  "B M T C" entries, format S.
+--echo #        --> ROW   "N B T T C" entries, format R.
+--echo #        --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+--echo #  
+SET @commands= 'B Nte T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B nTe T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NTe-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TNe-trig T C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25");
-INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25");
---error ER_DUP_ENTRY
-INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25");
-INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27");
-ROLLBACK;
+--echo #13) "B M T R" generates in the binlog:
+--echo #      --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "B M T R" entries, format S.
+--echo #      --> ROW   "N" entry, format R.
+--echo #      --> MIXED "N" entry, format R.
+--echo #
+SET @commands= 'B Nt T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B nT T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NT T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NT-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NT-proc T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TN T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TN-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TN-proc T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #10) "B N N C" generates in binglog the "N N" entries.
+--echo #13.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #        --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+--echo #        --> STMT  "B M T R" entries, format S.
+--echo #        --> ROW   "N" entry, format R.
+--echo #        --> MIXED "N" entry, format R.
 --echo #
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12");
-INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12");
-COMMIT;
+SET @commands= 'B Nte T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B nTe T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B NTe-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B TNe-trig T R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #10.e) "B N N C" See 6.e and 9.e.
+--echo #14) Generates in the binlog what follows if a N-Table is changed:
+--echo #      --> STMT  "B T M C" entries, format S.
+--echo #      --> ROW   "N B T T C" entries, format R.
+--echo #      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
 --echo #
+SET @commands= 'B T Nt C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T nT C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T NT C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T NT-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T NT-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TN C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TN-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TN-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #11) "B N N R" generates in binlog the "N N" entries.
+--echo #14.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #        --> STMT  "B T M C" entries, format S.
+--echo #        --> ROW   "N B T C" entry, format R.
+--echo #        --> MIXED "N B T C" entry, format R.
 --echo #
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13");
-INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13");
-ROLLBACK;
+SET @commands= 'B T Nte C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T nTe C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B T NTe-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TNe-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #11.e) "B N N R" See 6.e and 9.e.
+--echo #15) Generates in the binlog what follows if a N-Table is changed:
+--echo #        --> STMT  "B T M R" entries, format S.
+--echo #        --> ROW   "N" entry, format R.
+--echo #        --> MIXED "N" entry, format R.
 --echo #
+SET @commands= 'B T Nt R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T nT R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T NT R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T NT-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T NT-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TN R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TN-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B T TN-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #12) "B M T C" generates in the binlog the "B M T C" entries.
+--echo #15.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #        --> STMT  "B T M R" entries, format S.
+--echo #        --> ROW   "N" entry, format R.
+--echo #        --> MIXED "N" entry, format R.
 --echo #
-DELETE FROM nt_1;
-BEGIN;
-INSERT INTO nt_1 SELECT * FROM tt_1;
-INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14");
-COMMIT;
+SET @commands= 'B T Nte R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELETE FROM tt_1;
-BEGIN;
-INSERT INTO tt_1 SELECT * FROM nt_1;
-INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15");
-COMMIT;
+SET @commands= 'B T nTe R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_3 VALUES ("new text 700", 700, '');
-INSERT INTO tt_1 VALUES ("new text 800", 800, '');
-COMMIT;
+SET @commands= 'B T NTe-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_3 VALUES("new text 900", 900, f1());
-INSERT INTO tt_1 VALUES ("new text 1000", 1000, '');
-COMMIT;
+SET @commands= 'B T TNe-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_3 VALUES(1100, 1100, f2());
-INSERT INTO tt_1 VALUES ("new text 1200", 1200, '');
-COMMIT;
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
-BEGIN;
-INSERT INTO nt_4 VALUES ("new text 1300", 1300, '');
-INSERT INTO tt_1 VALUES ("new text 1400", 1400, '');
-COMMIT;
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #16) Generates in the binlog what follows if a N-Table is changed:
+--echo #      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "B M N C" entries, format S.
+--echo #      --> ROW   "N N B T C" entries, format R.
+--echo #      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+--echo #      --> MIXED "N N B T C" entries, format R.
+--echo #
+SET @commands= 'B Nt N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_4 VALUES("new text 1500", 1500, f1());
-INSERT INTO tt_1 VALUES ("new text 1600", 1600, '');
-COMMIT;
+SET @commands= 'B nT N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_4 VALUES("new text 1700", 1700, f2());
-INSERT INTO tt_1 VALUES ("new text 1800", 1800, '');
-COMMIT;
+SET @commands= 'B NT N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-CALL pc_i_tt_3(1900, "Testing...");
-INSERT INTO tt_1 VALUES ("new text 2000", 2000, '');
-COMMIT;
+SET @commands= 'B NT-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 2100", 2100, '');
-COMMIT;
+SET @commands= 'B NT-proc N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 2200", 2200, '');
-COMMIT;
+SET @commands= 'B TN N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 2300", 2300, '');
-COMMIT;
+SET @commands= 'B TN-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 2400", 2400, '');
-COMMIT;
+SET @commands= 'B TN-proc N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #12.e) "B M T C" with error in M generates in the binlog the "B M T C" entries.
---echo #  
+--echo #16.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "B M N C" entries, format S.
+--echo #      --> ROW   "N N B T C" entries, format R.
+--echo #      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+--echo #      --> MIXED "N N B T C" entries, format R.
+--echo #
+SET @commands= 'B Nte N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
---echo # There is a bug in the slave that needs to be fixed before enabling
---echo # this part of the test. A bug report will be filed referencing this
---echo # test case.
+SET @commands= 'B nTe N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_3 VALUES ("new text -28", -28, '');
---error ER_DUP_ENTRY
-INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
-INSERT INTO tt_1 VALUES ("new text -27", -27, '');
-COMMIT;
+SET @commands= 'B NTe-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_4 VALUES ("new text -28", -28, '');
---error ER_DUP_ENTRY
-INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
-INSERT INTO tt_1 VALUES ("new text -28", -28, '');
-COMMIT;
+SET @commands= 'B TNe-trig N C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #13) "B M T R" generates in the binlog the "B M T R" entries
+--echo #17) Generates in the binlog what follows if a N-Table is changed:
+--echo #    --> STMT  "M N" entries if in M only N-Table is changed, format S.
+--echo #    --> STMT  "B M N R" entries, format S.
+--echo #    --> ROW   "N N" entries, format R.
+--echo #    --> MIXED "M N" entries if in M only N-Table is changed, format S.
+--echo #    --> MIXED "N N" entries, format R.
 --echo #
+SET @commands= 'B Nt N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELETE FROM nt_1;
-BEGIN;
-INSERT INTO nt_1 SELECT * FROM tt_1;
-INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17");
-ROLLBACK;
+SET @commands= 'B nT N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-DELETE FROM tt_1;
-BEGIN;
-INSERT INTO tt_1 SELECT * FROM nt_1;
-INSERT INTO tt_2 VALUES ("new text 18", 18, "new text 18");
-ROLLBACK;
-INSERT INTO tt_1 SELECT * FROM nt_1;
+SET @commands= 'B NT N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_3 VALUES ("new text 2500", 2500, '');
-INSERT INTO tt_1 VALUES ("new text 2600", 2600, '');
-ROLLBACK;
+SET @commands= 'B NT-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_3 VALUES("new text 2700", 2700, f1());
-INSERT INTO tt_1 VALUES ("new text 2800", 2800, '');
-ROLLBACK;
+SET @commands= 'B NT-proc N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_3 VALUES(2900, 2900, f2());
-INSERT INTO tt_1 VALUES ("new text 3000", 3000, '');
-ROLLBACK;
+SET @commands= 'B TN N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_4 VALUES ("new text 3100", 3100, '');
-INSERT INTO tt_1 VALUES ("new text 3200", 3200, '');
-ROLLBACK;
+SET @commands= 'B TN-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_4 VALUES("new text 3300", 3300, f1());
-INSERT INTO tt_1 VALUES ("new text 3400", 3400, '');
-ROLLBACK;
+SET @commands= 'B TN-proc N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_4 VALUES("new text 3500", 3500, f2());
-INSERT INTO tt_1 VALUES ("new text 3600", 3600, '');
-ROLLBACK;
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
 
-BEGIN;
-CALL pc_i_tt_3(3700, "Testing...");
-INSERT INTO tt_1 VALUES ("new text 3700", 3700, '');
-ROLLBACK;
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #17.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "B M N R" entries, format S.
+--echo #      --> ROW   "N N" entries, format R.
+--echo #      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+--echo #      --> MIXED "N N" entries, format R.
+--echo #
+SET @commands= 'B Nte N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 3800", 3800, '');
-ROLLBACK;
+SET @commands= 'B nTe N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 3900", 3900, '');
-ROLLBACK;
+SET @commands= 'B NTe-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 4000", 4000, '');
-ROLLBACK;
+SET @commands= 'B TNe-trig N R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
-INSERT INTO tt_1 VALUES ("new text 4100", 4100, '');
-ROLLBACK;
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #18) Generates in the binlog what follows if a N-Table is changed:
+--echo #    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+--echo #    --> STMT  "N B M C" entries, format S.
+--echo #    --> ROW   "N N B T C" entries, format R.
+--echo #    --> MIXED "N N B T C" entries, format S in first N and format R in the other.
+--echo #
+
+SET @commands= 'B N Nt C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+SET @commands= 'B N nT C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NT C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NT-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NT-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TN C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TN-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TN-proc C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
+
 --echo
 --echo
 --echo
 --echo
-let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 --echo #
---echo #13.e) "B M T R" with error in M generates in the binlog the "B M T R" entries.
+--echo #18.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "N B M C" entries, format S.
+--echo #      --> ROW   "N N" entries, format R.
+--echo #      --> MIXED "N N" entries, format S in first N and format R in the other.
 --echo #
+SET @commands= 'B N Nte C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO nt_3 VALUES ("new text -30", -30, '');
---error ER_DUP_ENTRY
-INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
-INSERT INTO tt_1 VALUES ("new text -30", -30, '');
-ROLLBACK;
+SET @commands= 'B N nTe C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
-BEGIN;
-INSERT INTO tt_4 VALUES ("new text -30", -30, '');
---error ER_DUP_ENTRY
-INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
-INSERT INTO tt_1 VALUES ("new text -31", -31, '');
-ROLLBACK;
+SET @commands= 'B N NTe-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TNe-trig C';
+--source extra/rpl_tests/rpl_mixing_engines.inc
 
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #19) Generates in the binlog what follows if a N-Table is changed:
+--echo #    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+--echo #    --> STMT  "N B M R" entries, format S.
+--echo #    --> ROW   "N N" entries, format R.
+--echo #    --> MIXED "N N" entries, format S in first N and format R in the other.
+--echo #
+
+SET @commands= 'B N Nt R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N nT R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NT R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NT-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NT-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TN R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TN-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TN-proc R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo
+--echo
+--echo
+--echo
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+--echo #
+--echo #19.e) Generates in the binlog what follows if a N-Table is changed:
+--echo #      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+--echo #      --> STMT  "N B M R" entries, format S.
+--echo #      --> ROW   "N N" entries, format R.
+--echo #      --> MIXED "N N" entries, format S in first N and format R in the other.
+--echo #
+SET @commands= 'B N Nte R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N nTe R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N NTe-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+SET @commands= 'B N TNe-trig R';
+--source extra/rpl_tests/rpl_mixing_engines.inc
+
+let $binlog_start= $first_binlog_start;
 --source include/show_binlog_events.inc
 
 connection master;
 sync_slave_with_master;
 
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-master.sql
---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-slave.sql
---diff_files $MYSQLTEST_VARDIR/tmp/test-master.sql $MYSQLTEST_VARDIR/tmp/test-slave.sql
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
+--diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
 
 --echo ###################################################################################
---echo #                                        CLEAN
+--echo #                               2 - SAVEPOINT
 --echo ###################################################################################
+connection master;
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
+
+BEGIN;
+INSERT INTO tt_3 VALUES ("new text -34", -35, '');
+INSERT INTO tt_4 VALUES ("new text -35", -35, '');
+SAVEPOINT sv;
+INSERT INTO nt_3 VALUES ("new text -36", -36, '');
+INSERT INTO tt_3 VALUES ("new text -37", -37, '');
+ROLLBACK TO sv;
+COMMIT;
 
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo ###################################################################################
+--echo #                 3 - CREATE TABLE...SELECT and CREATE TABLE...LIKE
+--echo ###################################################################################
 connection master;
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE tt_3;
-DROP TABLE tt_4;
-DROP TABLE nt_1;
-DROP TABLE nt_2;
-DROP TABLE nt_3;
-DROP TABLE nt_4;
-DROP PROCEDURE pc_i_tt_3;
-DROP FUNCTION f1;
-DROP FUNCTION f2;
+let $first_binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 
-sync_slave_with_master;
+CREATE TABLE tt_xx10 engine=Innodb SELECT * FROM tt_2;
+DROP TABLE tt_xx10;
+CREATE TABLE nt_xx11 engine=MyIsam SELECT * FROM tt_2;
+DROP TABLE nt_xx11;
+CREATE TABLE nt_xx12 LIKE tt_2;
+DROP TABLE nt_xx12;
+
+let $binlog_start= $first_binlog_start;
+--source include/show_binlog_events.inc
+
+--echo ###################################################################################
+--echo #                                        CLEAN
+--echo ###################################################################################
+SET @commands= 'clean';
+--source extra/rpl_tests/rpl_mixing_engines.inc

=== added file 'mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result	2009-09-13 16:12:48 +0000
@@ -0,0 +1,3558 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+#########################################################################
+#                            CONFIGURATION
+#########################################################################
+SET @commands= 'configure';
+SET SQL_LOG_BIN=0;
+CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+SET SQL_LOG_BIN=1;
+INSERT INTO nt_1(b) VALUES(1);
+INSERT INTO nt_2(b) VALUES(1);
+INSERT INTO nt_3(b) VALUES(1);
+INSERT INTO nt_4(b) VALUES(1);
+INSERT INTO nt_5(b) VALUES(1);
+INSERT INTO nt_6(b) VALUES(1);
+INSERT INTO tt_1(b) VALUES(1);
+INSERT INTO tt_2(b) VALUES(1);
+INSERT INTO tt_3(b) VALUES(1);
+INSERT INTO tt_4(b) VALUES(1);
+INSERT INTO tt_5(b) VALUES(1);
+INSERT INTO tt_6(b) VALUES(1);
+CREATE PROCEDURE pc_i_tt_3_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO tt_3(a,c) VALUES (y, y);
+INSERT INTO tt_3(a,c) VALUES (y, y);
+END|
+CREATE PROCEDURE pc_i_nt_4_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO nt_4(a,c) VALUES (y, y);
+INSERT INTO nt_4(a,c) VALUES (y, y);
+END|
+CREATE PROCEDURE pc_i_tt_5_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO tt_5(a,c) VALUES (y, y);
+INSERT INTO tt_5(a,c) VALUES (y, y);
+END|
+CREATE PROCEDURE pc_i_nt_5_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO nt_5(a,c) VALUES (y, y);
+INSERT INTO nt_5(a,c) VALUES (y, y);
+END|
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+BEGIN
+INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+END|
+SET @commands='';
+#########################################################################
+#         1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
+#########################################################################
+
+
+
+
+#
+#1) Generates in the binlog what follows:
+#      --> STMT  "B T C" entries, format S.
+#      --> ROW   "B T C" entries, format R.
+#      --> MIXED "B T C" entries, format S.
+#
+SET @commands= 'T';
+INSERT INTO tt_1(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'T-trig';
+INSERT INTO tt_5(a,c) VALUES ("new text 2", "new text 2");
+SET @commands= 'T-proc';
+CALL pc_i_tt_5_suc ("new text 3");
+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	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 2", "new text 2")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#1.e) Generates in the binlog what follows:
+#        --> STMT  empty.
+#        --> ROW   empty.
+#        --> MIXED empty.
+#
+SET @commands= 'Te-begin';
+INSERT INTO tt_1(a, b, c) VALUES ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Te-end';
+INSERT INTO tt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Te-trig';
+INSERT INTO tt_5(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+
+
+
+
+#
+#2) Generates in the binlog what follows:
+#      --> STMT  "N" entry, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format S.
+#
+SET @commands= 'N';
+INSERT INTO nt_1(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'N-trig';
+INSERT INTO nt_5(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'N-proc';
+CALL pc_i_nt_5_suc ("new text 3");
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 2", "new text 2")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#2.e) Generates in the binglog what follows if a N-table is changed:
+#        --> STMT  "N" entry, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format S.
+#
+SET @commands= 'Ne-begin';
+INSERT INTO nt_1(a, b, c) VALUES ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Ne-end';
+INSERT INTO nt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Ne-trig';
+INSERT INTO nt_5(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#3) Generates in the binglog what follows:
+#      --> STMT  "M" entry if only N-Table is changed, format S.
+#      --> STMT  "B M C" entries, format S.
+#      --> ROW   "N B T C" entries, format R.
+#      --> MIXED "N B T C" entries, format R.
+#
+SET @commands= 'Nt';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'nT';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'NT';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'NT-trig';
+INSERT INTO nt_4(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'NT-proc';
+CALL pc_i_nt_4_suc ("new text 3");
+SET @commands= 'TN';
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'TN-trig';
+INSERT INTO tt_3(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'TN-proc';
+CALL pc_i_tt_3_suc ("new text 3");
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#3.e) Generates in the binglog what follows:
+#      --> STMT  "M" entry if only N-Table is changed, format S.
+#      --> STMT  "B M R" entries, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format R.
+SET @commands= 'Nte';
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+SET @commands= 'nTe';
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 8, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 7, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+SET @commands= 'NTe-trig';
+INSERT INTO nt_4(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+SET @commands= 'TNe-trig';
+INSERT INTO tt_3(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#4) Generates in the binlog what follows:
+#     --> STMT  "B T T C" entries, format S.
+#     --> ROW   "B T T C" entries, format R.
+#     --> MIXED "B T T C" entries, format S
+#
+SET @commands= 'B T T C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 7", "new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 9", "new text 9");
+COMMIT;
+SET @commands= 'B T T-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO tt_5(a,c) VALUES ("new text 5", "new text 5");
+COMMIT;
+SET @commands= 'B T T-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 11", "new text 11");
+CALL pc_i_tt_5_suc ("new text 7");
+COMMIT;
+SET @commands= 'B T-trig T C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 9", "new text 9");
+INSERT INTO tt_1(a, c) VALUES ("new text 12", "new text 12");
+COMMIT;
+SET @commands= 'B T-trig T-trig C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 10", "new text 10");
+INSERT INTO tt_5(a,c) VALUES ("new text 11", "new text 11");
+COMMIT;
+SET @commands= 'B T-trig T-proc C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 12", "new text 12");
+CALL pc_i_tt_5_suc ("new text 13");
+COMMIT;
+SET @commands= 'B T-proc T C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 15");
+INSERT INTO tt_1(a, c) VALUES ("new text 13", "new text 13");
+COMMIT;
+SET @commands= 'B T-proc T-trig C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 17");
+INSERT INTO tt_5(a,c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B T-proc T-proc C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 20");
+CALL pc_i_tt_5_suc ("new text 22");
+COMMIT;
+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	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 7", "new text 7")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 13", "new text 13")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#4.e) Generates in the binlog what follows:
+#       --> STMT  "B T C" entries, format S.
+#       --> ROW   "B T C" entries, format R.
+#       --> MIXED "B T C" entries, format S.
+#
+SET @commands= 'B T Te-begin C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 14", "new text 14");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 14", 14, "new text 14");
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Te-end C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 15", "new text 15");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Te-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B Te-begin T C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 17", 17, "new text 17");
+ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 18", "new text 18");
+COMMIT;
+SET @commands= 'B Te-end T C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 19", 19, "new text 19"), ("new text 18", 18, "new text 18");
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B Te-trig T C';
+BEGIN;
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 21", "new text 21");
+COMMIT;
+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	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 15", "new text 15")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=17
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 16", "new text 16")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 18", "new text 18")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=20
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 19", "new text 19")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 21", "new text 21")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#5) Generates in the binlog what follows:
+#     --> STMT  empty.
+#     --> ROW   empty.
+#     --> MIXED empty.
+#
+SET @commands= 'B T T R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, c) VALUES ("new text 23", "new text 23");
+ROLLBACK;
+SET @commands= 'B T T-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+ROLLBACK;
+SET @commands= 'B T T-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+CALL pc_i_tt_5_suc ("new text 24");
+ROLLBACK;
+SET @commands= 'B T-trig T R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-trig T-trig R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+INSERT INTO tt_5(a,c) VALUES ("new text 30", "new text 30");
+ROLLBACK;
+SET @commands= 'B T-trig T-proc R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+CALL pc_i_tt_5_suc ("new text 32");
+ROLLBACK;
+SET @commands= 'B T-proc T R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 24");
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-proc T-trig R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 24");
+INSERT INTO tt_5(a,c) VALUES ("new text 38", "new text 38");
+ROLLBACK;
+SET @commands= 'B T-proc T-proc R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 24");
+CALL pc_i_tt_5_suc ("new text 41");
+ROLLBACK;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+
+
+
+
+#
+#5.e) Generates in the binlog what follows:
+#       --> STMT  empty.
+#       --> ROW   empty.
+#       --> MIXED empty.
+#
+SET @commands= 'B T Te-begin R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 28", 28, "new text 28");
+ERROR 23000: Duplicate entry '28' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Te-end R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Te-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B Te-begin T R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 21", 21, "new text 21");
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B Te-end T R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 22", 22, "new text 22"), ("new text 21", 21, "new text 21");
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B Te-trig T R';
+BEGIN;
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+
+
+
+
+#
+#6) Generates in the binglog what follows:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N N C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10");
+COMMIT;
+SET @commands= 'B N N-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11");
+INSERT INTO nt_5(a, c) VALUES ("new text 6", "new text 6");
+COMMIT;
+SET @commands= 'B N N-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12");
+CALL pc_i_nt_5_suc ("new text 7");
+COMMIT;
+SET @commands= 'B N-trig N C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13");
+COMMIT;
+SET @commands= 'B N-trig N-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO nt_5(a, c) VALUES ("new text 11", "new text 11");
+COMMIT;
+SET @commands= 'B N-trig N-proc C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 12", "new text 12");
+CALL pc_i_nt_5_suc ("new text 13");
+COMMIT;
+SET @commands= 'B N-proc N C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 15");
+INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14");
+COMMIT;
+SET @commands= 'B N-proc N-trig C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 17");
+INSERT INTO nt_5(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B N-proc N-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 20");
+CALL pc_i_nt_5_suc ("new text 22");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#6.e) Generates in the binglog what follows if a N-Table is changed:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N Ne-begin C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 15", "new text 15");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N Ne-end C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16");
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N Ne-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 18", "new text 18");
+INSERT INTO nt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B Ne-begin N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 18", 18, "new text 18");
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B Ne-end N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 20", 20, "new text 20"), ("new text 19", 19, "new text 19");
+ERROR 23000: Duplicate entry '19' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 21", "new text 21");
+COMMIT;
+SET @commands= 'B Ne-trig N C';
+BEGIN;
+INSERT INTO nt_5(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24");
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 22", "new text 22");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 15", "new text 15")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 16", "new text 16")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 18", "new text 18")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=19
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 19", "new text 19")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 20", 20, "new text 20"), ("new text 19", 19, "new text 19")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 21", "new text 21")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=22
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 22", "new text 22")
+
+
+
+
+#
+#7) Generates in the binlog what follows:
+#      --> STMT  "N N" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N N R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N N-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25");
+INSERT INTO nt_5(a, c) VALUES ("new text 26", "new text 26");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N N-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26");
+CALL pc_i_nt_5_suc ("new text 27");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 29", "new text 29");
+INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 30", "new text 30");
+INSERT INTO nt_5(a, c) VALUES ("new text 31", "new text 31");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N-proc R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 32", "new text 32");
+CALL pc_i_nt_5_suc ("new text 33");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 35");
+INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N-trig R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 37");
+INSERT INTO nt_5(a, c) VALUES ("new text 39", "new text 39");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 40");
+CALL pc_i_nt_5_suc ("new text 42");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=25
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#7.e) Generates in the binglog what follows if a N-Table is changed:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N Ne-begin R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 29", "new text 29");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N Ne-end R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 30", "new text 30");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 31", 31, "new text 31"), ("new text 30", 30, "new text 30");
+ERROR 23000: Duplicate entry '30' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N Ne-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 32", "new text 32");
+INSERT INTO nt_5(a, b, c) VALUES ("new text 44", 44, "new text 44"), ("new text 43", 43, "new text 43");
+ERROR 23000: Duplicate entry '43' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-begin N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 32", 32, "new text 32");
+ERROR 23000: Duplicate entry '32' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 33", "new text 33");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-end N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 34", 34, "new text 34"), ("new text 33", 33, "new text 33");
+ERROR 23000: Duplicate entry '33' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 35", "new text 35");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-trig N R';
+BEGIN;
+INSERT INTO nt_5(a, b, c) VALUES ("new text 45", 45, "new text 45"), ("new text 44", 44, "new text 44");
+ERROR 23000: Duplicate entry '44' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 36", "new text 36");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=25
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=29
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 29", "new text 29")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=30
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 30", "new text 30")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 31", 31, "new text 31"), ("new text 30", 30, "new text 30")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 32", "new text 32")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=33
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 33", "new text 33")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 34", 34, "new text 34"), ("new text 33", 33, "new text 33")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 35", "new text 35")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 36", "new text 36")
+
+
+
+
+#
+#8) Generates in the binlog what follows:
+#       --> STMT  "B T N C" entries, format S.
+#       --> ROW   "N B T C" entries, format R.
+#       --> MIXED "N B T C" entries, format R in N and S in T.
+#
+SET @commands= 'B T N C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO nt_1(a, c) VALUES ("new text 37", "new text 37");
+COMMIT;
+SET @commands= 'B T N-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 36", "new text 36");
+INSERT INTO nt_5(a, c) VALUES ("new text 46", "new text 46");
+COMMIT;
+SET @commands= 'B T N-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 37", "new text 37");
+CALL pc_i_nt_5_suc ("new text 47");
+COMMIT;
+SET @commands= 'B T-trig N C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+INSERT INTO nt_1(a, c) VALUES ("new text 38", "new text 38");
+COMMIT;
+SET @commands= 'B T-trig N-trig C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 44", "new text 44");
+INSERT INTO nt_5(a, c) VALUES ("new text 49", "new text 49");
+COMMIT;
+SET @commands= 'B T-trig N-proc C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 45", "new text 45");
+CALL pc_i_nt_5_suc ("new text 50");
+COMMIT;
+SET @commands= 'B T-proc N C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 46");
+INSERT INTO nt_1(a, c) VALUES ("new text 39", "new text 39");
+COMMIT;
+SET @commands= 'B T-proc N-trig C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 48");
+INSERT INTO nt_5(a, c) VALUES ("new text 52", "new text 52");
+COMMIT;
+SET @commands= 'B T-proc N-proc C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 50");
+CALL pc_i_nt_5_suc ("new text 53");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 36", "new text 36")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=37
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 37", "new text 37")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#8.e) Generates in the binlog what follows if T-* fails:
+#       --> STMT  "N" entry, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#     Otherwise, what follows if N-* fails and a N-Table is changed:
+#       --> STMT  "B T N C" entries, format S.
+#       --> ROW   "N B T C" entries, format R.
+#       --> MIXED "N B T C" entries, format R in N and S in T.
+#
+SET @commands= 'B Te-begin N C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 37", 37, "new text 37");
+ERROR 23000: Duplicate entry '37' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 40", "new text 40");
+COMMIT;
+SET @commands= 'B Te-end N C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 38", 38, "new text 38"), ("new text 37", 37, "new text 37");
+ERROR 23000: Duplicate entry '37' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 41", "new text 41");
+COMMIT;
+SET @commands= 'B T Ne-begin C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 38", "new text 38");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 41", 41, "new text 41");
+ERROR 23000: Duplicate entry '41' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Ne-end C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 40", "new text 40");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 42", 42, "new text 42"), ("new text 41", 41, "new text 41");
+ERROR 23000: Duplicate entry '41' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 40", "new text 40")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=41
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=39
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 38", "new text 38")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 40", "new text 40")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#9) Generates in the binlog what follows:
+#     --> STMT  "B T N R" entries, format S.
+#     --> ROW   "N" entry, format R.
+#     --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T N R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, c) VALUES ("new text 43", "new text 43");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T N-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_5(a, c) VALUES ("new text 55", "new text 55");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T N-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+CALL pc_i_nt_5_suc ("new text 56");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+INSERT INTO nt_1(a, c) VALUES ("new text 44", "new text 44");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N-trig R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+INSERT INTO nt_5(a, c) VALUES ("new text 58", "new text 58");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N-proc R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+CALL pc_i_nt_5_suc ("new text 59");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 52");
+INSERT INTO nt_1(a, c) VALUES ("new text 45", "new text 45");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N-trig R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 52");
+INSERT INTO nt_5(a, c) VALUES ("new text 61", "new text 61");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N-proc R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 52");
+CALL pc_i_nt_5_suc ("new text 62");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#9.e) Generates in the binlog what follows if T* fails:
+#       --> STMT  "N" entry, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#     Otherwise, what follows if N* fails and a N-Table is changed:
+#       --> STMT  "B T N R" entries, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Te-begin N R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 40", 40, "new text 40");
+ERROR 23000: Duplicate entry '40' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 46", "new text 46");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Te-end N R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 41", 41, "new text 41"), ("new text 40", 40, "new text 40");
+ERROR 23000: Duplicate entry '40' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 47", "new text 47");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T Ne-begin R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 47", 47, "new text 47");
+ERROR 23000: Duplicate entry '47' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Ne-end R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 48", 48, "new text 48"), ("new text 47", 47, "new text 47");
+ERROR 23000: Duplicate entry '47' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=46
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 46", "new text 46")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=47
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 47", "new text 47")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#10) Generates in the binlog:
+#     --> STMT  "N B T C" entries, format S.
+#     --> ROW   "N B T C" entries, format R.
+#     --> MIXED "N B T C" entries, format S.
+#
+SET @commands= 'B N T C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 49", "new text 49");
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+COMMIT;
+SET @commands= 'B N T-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 50", "new text 50");
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+COMMIT;
+SET @commands= 'B N T-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 51", "new text 51");
+CALL pc_i_tt_5_suc ("new text 62");
+COMMIT;
+SET @commands= 'B N-trig T C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 64", "new text 64");
+INSERT INTO tt_1(a, c) VALUES ("new text 47", "new text 47");
+COMMIT;
+SET @commands= 'B N-trig T-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 65", "new text 65");
+INSERT INTO tt_5(a,c) VALUES ("new text 64", "new text 64");
+COMMIT;
+SET @commands= 'B N-trig T-proc C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 66", "new text 66");
+CALL pc_i_tt_5_suc ("new text 65");
+COMMIT;
+SET @commands= 'B N-proc T C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 67");
+INSERT INTO tt_1(a, c) VALUES ("new text 48", "new text 48");
+COMMIT;
+SET @commands= 'B N-proc T-trig C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 69");
+INSERT INTO tt_5(a,c) VALUES ("new text 67", "new text 67");
+COMMIT;
+SET @commands= 'B N-proc T-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 71");
+CALL pc_i_tt_5_suc ("new text 68");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=49
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 49", "new text 49")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=46
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=50
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 50", "new text 50")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=51
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 51", "new text 51")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=47
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 47", "new text 47")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=48
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 48", "new text 48")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#10.e) Check 8.e
+#
+
+
+
+
+#
+#11) Generates in the binlog what follows:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N T R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 52", "new text 52");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N T-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 53", "new text 53");
+CALL pc_i_tt_5_suc ("new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N T-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 54", "new text 54");
+INSERT INTO tt_5(a,c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 73", "new text 73");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 74", "new text 74");
+INSERT INTO tt_5(a,c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T-proc R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 75", "new text 75");
+CALL pc_i_tt_5_suc ("new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 76");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 78");
+CALL pc_i_tt_5_suc ("new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T-trig R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 80");
+INSERT INTO tt_5(a,c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=52
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 52", "new text 52")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=53
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 53", "new text 53")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=54
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 54", "new text 54")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#11.e) Check 9.e
+#
+
+
+
+
+#
+#12) "B M T C" generates in the binlog what follows:
+#      --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M T C" entries, format S.
+#      --> ROW   "N B T T C" entries, format R.
+#      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#
+SET @commands= 'B Nt T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 53", "new text 53");
+COMMIT;
+SET @commands= 'B nT T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 55", "new text 55");
+COMMIT;
+SET @commands= 'B NT T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 57", "new text 57");
+COMMIT;
+SET @commands= 'B NT-trig T C';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 6", "new text 6");
+INSERT INTO tt_1(a, c) VALUES ("new text 58", "new text 58");
+COMMIT;
+SET @commands= 'B NT-proc T C';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 59", "new text 59");
+COMMIT;
+SET @commands= 'B TN T C';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 5", tt_4.a= "new text 5", nt_3.a= "new text 5", nt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 60", "new text 60");
+COMMIT;
+SET @commands= 'B TN-trig T C';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 5", "new text 5");
+INSERT INTO tt_1(a, c) VALUES ("new text 61", "new text 61");
+COMMIT;
+SET @commands= 'B TN-proc T C';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 62", "new text 62");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=53
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 53", "new text 53")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Intvar	#	#	INSERT_ID=55
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 55", "new text 55")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Intvar	#	#	INSERT_ID=57
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 57", "new text 57")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=58
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 58", "new text 58")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=59
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 59", "new text 59")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=60
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 60", "new text 60")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=61
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 61", "new text 61")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=62
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 62", "new text 62")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#12.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+#        --> STMT  "B M T C" entries, format S.
+#        --> ROW   "N B T T C" entries, format R.
+#        --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#  
+SET @commands= 'B Nte T C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 58, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 57, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '57' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '62' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 63", "new text 63");
+COMMIT;
+SET @commands= 'B nTe T C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 59, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 58, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '58' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 65, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 64, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '64' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 65", "new text 65");
+COMMIT;
+SET @commands= 'B NTe-trig T C';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 67", "new text 67");
+COMMIT;
+SET @commands= 'B TNe-trig T C';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 68", "new text 68");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=64
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 63", "new text 63")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=66
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 65", "new text 65")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=67
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 67", "new text 67")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=68
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 68", "new text 68")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#13) "B M T R" generates in the binlog:
+#      --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M T R" entries, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Nt T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nT T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 72", "new text 72");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 74", "new text 74");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-trig T R';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-proc T R';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 11");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN T R';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-trig T R';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-proc T R';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 9");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#13.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+#        --> STMT  "B M T R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Nte T R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '62' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+SET @commands= 'B nTe T R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 64, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 63, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '63' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+SET @commands= 'B NTe-trig T R';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 13", 13, "new text 13"), ("new text 12", 12, "new text 12");
+ERROR 23000: Duplicate entry '12' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TNe-trig T R';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#14) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "B T M C" entries, format S.
+#      --> ROW   "N B T T C" entries, format R.
+#      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#
+SET @commands= 'B T Nt C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T nT C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 86", "new text 86");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T NT C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 88", "new text 88");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T NT-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 90", "new text 90");
+INSERT INTO nt_4(a, c) VALUES ("new text 14", "new text 14");
+COMMIT;
+SET @commands= 'B T NT-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 91", "new text 91");
+CALL pc_i_nt_4_suc ("new text 15");
+COMMIT;
+SET @commands= 'B T TN C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 92", "new text 92");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T TN-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 93", "new text 93");
+INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9");
+COMMIT;
+SET @commands= 'B T TN-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 94", "new text 94");
+CALL pc_i_tt_3_suc ("new text 14");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=84
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=86
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 86", "new text 86")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=88
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 88", "new text 88")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=90
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 90", "new text 90")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=91
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 91", "new text 91")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=92
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 92", "new text 92")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=93
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 93", "new text 93")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=94
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 94", "new text 94")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#14.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M C" entries, format S.
+#        --> ROW   "N B T C" entry, format R.
+#        --> MIXED "N B T C" entry, format R.
+#
+SET @commands= 'B T Nte C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 95", "new text 95");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 68, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 67, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '67' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 96, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 95, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '95' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T nTe C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 96", "new text 96");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 98, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 97, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '97' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T NTe-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 98", "new text 98");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16");
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T TNe-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 100", "new text 100");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=95
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 95", "new text 95")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=97
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 96", "new text 96")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=99
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 98", "new text 98")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=100
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 100", "new text 100")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#15) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T Nt R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T nT R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_4(a, c) VALUES ("new text 18", "new text 18");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+CALL pc_i_nt_4_suc ("new text 19");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+CALL pc_i_tt_3_suc ("new text 16");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#15.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T Nte R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 73, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 72, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '72' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 113, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 112, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '112' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T nTe R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 74, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 73, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '73' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 115, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 114, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '114' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T NTe-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 21", 21, "new text 21"), ("new text 20", 20, "new text 20");
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TNe-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#16) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N C" entries, format S.
+#      --> ROW   "N N B T C" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N B T C" entries, format R.
+#
+SET @commands= 'B Nt N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 76", "new text 76");
+COMMIT;
+SET @commands= 'B nT N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 78", "new text 78");
+COMMIT;
+SET @commands= 'B NT N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 80", "new text 80");
+COMMIT;
+SET @commands= 'B NT-trig N C';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO nt_1(a, c) VALUES ("new text 81", "new text 81");
+COMMIT;
+SET @commands= 'B NT-proc N C';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 82", "new text 82");
+COMMIT;
+SET @commands= 'B TN N C';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 83", "new text 83");
+COMMIT;
+SET @commands= 'B TN-trig N C';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO nt_1(a, c) VALUES ("new text 84", "new text 84");
+COMMIT;
+SET @commands= 'B TN-proc N C';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 21");
+INSERT INTO nt_1(a, c) VALUES ("new text 85", "new text 85");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#16.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N C" entries, format S.
+#      --> ROW   "N N B T C" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N B T C" entries, format R.
+#
+SET @commands= 'B Nte N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 86, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 85, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '85' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 87", "new text 87");
+COMMIT;
+SET @commands= 'B nTe N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 88, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 87, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '87' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 89", "new text 89");
+COMMIT;
+SET @commands= 'B NTe-trig N C';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24");
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 90", "new text 90");
+COMMIT;
+SET @commands= 'B TNe-trig N C';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22");
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 91", "new text 91");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=87
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 87", "new text 87")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=89
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 89", "new text 89")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=90
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 90", "new text 90")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=91
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 91", "new text 91")
+
+
+
+
+#
+#17) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#    --> STMT  "B M N R" entries, format S.
+#    --> ROW   "N N" entries, format R.
+#    --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#    --> MIXED "N N" entries, format R.
+#
+SET @commands= 'B Nt N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 93", "new text 93");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nT N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 95", "new text 95");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 97", "new text 97");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-trig N R';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 26", "new text 26");
+INSERT INTO nt_1(a, c) VALUES ("new text 98", "new text 98");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-proc N R';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 27");
+INSERT INTO nt_1(a, c) VALUES ("new text 99", "new text 99");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN N R';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 100", "new text 100");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-trig N R';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 101", "new text 101");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-proc N R';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 102", "new text 102");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#17.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N R" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N" entries, format R.
+#
+SET @commands= 'B Nte N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 103, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 102, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '102' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 104", "new text 104");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nTe N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 105, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 104, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '104' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 106", "new text 106");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NTe-trig N R';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 29", 29, "new text 29"), ("new text 28", 28, "new text 28");
+ERROR 23000: Duplicate entry '28' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 107", "new text 107");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TNe-trig N R';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22");
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 108", "new text 108");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=104
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 104", "new text 104")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=106
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 106", "new text 106")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=107
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 107", "new text 107")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=108
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 108", "new text 108")
+
+
+
+
+#
+#18) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#    --> STMT  "N B M C" entries, format S.
+#    --> ROW   "N N B T C" entries, format R.
+#    --> MIXED "N N B T C" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nt C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 109", "new text 109");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N nT C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 111", "new text 111");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N NT C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 113", "new text 113");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N NT-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 115", "new text 115");
+INSERT INTO nt_4(a, c) VALUES ("new text 30", "new text 30");
+COMMIT;
+SET @commands= 'B N NT-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 116", "new text 116");
+CALL pc_i_nt_4_suc ("new text 31");
+COMMIT;
+SET @commands= 'B N TN C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 117", "new text 117");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N TN-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 118", "new text 118");
+INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23");
+COMMIT;
+SET @commands= 'B N TN-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 119", "new text 119");
+CALL pc_i_tt_3_suc ("new text 28");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=109
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 109", "new text 109")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=111
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 111", "new text 111")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=113
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 113", "new text 113")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=115
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 115", "new text 115")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=116
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 116", "new text 116")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=117
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 117", "new text 117")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=118
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 118", "new text 118")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=119
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 119", "new text 119")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#18.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#      --> STMT  "N B M C" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nte C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 120", "new text 120");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N nTe C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 122", "new text 122");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 123, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 122, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '122' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N NTe-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 124", "new text 124");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 33", 33, "new text 33"), ("new text 32", 32, "new text 32");
+ERROR 23000: Duplicate entry '32' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N TNe-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 125", "new text 125");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=120
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 120", "new text 120")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=122
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 122", "new text 122")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=124
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 124", "new text 124")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=125
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 125", "new text 125")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#19) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#    --> STMT  "N B M R" entries, format S.
+#    --> ROW   "N N" entries, format R.
+#    --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nt R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 126", "new text 126");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N nT R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 128", "new text 128");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 130", "new text 130");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 132", "new text 132");
+INSERT INTO nt_4(a, c) VALUES ("new text 34", "new text 34");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 133", "new text 133");
+CALL pc_i_nt_4_suc ("new text 35");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 134", "new text 134");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 30", tt_4.a= "new text 30", nt_3.a= "new text 30", nt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 135", "new text 135");
+INSERT INTO tt_3(a, c) VALUES ("new text 30", "new text 30");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 136", "new text 136");
+CALL pc_i_tt_3_suc ("new text 30");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=126
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 126", "new text 126")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=128
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 128", "new text 128")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Intvar	#	#	INSERT_ID=130
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 130", "new text 130")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Intvar	#	#	INSERT_ID=132
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 132", "new text 132")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=133
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 133", "new text 133")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=134
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 134", "new text 134")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=135
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 135", "new text 135")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=136
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 136", "new text 136")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#19.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#      --> STMT  "N B M R" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nte R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 137", "new text 137");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 138, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 137, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '137' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N nTe R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 139", "new text 139");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 140, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 139, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '139' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NTe-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 141", "new text 141");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 37", 37, "new text 37"), ("new text 36", 36, "new text 36");
+ERROR 23000: Duplicate entry '36' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TNe-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 142", "new text 142");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=137
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 137", "new text 137")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=139
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 139", "new text 139")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=141
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 141", "new text 141")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	#	#	INSERT_ID=142
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 142", "new text 142")
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+###################################################################################
+#                               2 - SAVEPOINT
+###################################################################################
+BEGIN;
+INSERT INTO tt_3 VALUES ("new text -34", -35, '');
+INSERT INTO tt_4 VALUES ("new text -35", -35, '');
+SAVEPOINT sv;
+INSERT INTO nt_3 VALUES ("new text -36", -36, '');
+INSERT INTO tt_3 VALUES ("new text -37", -37, '');
+ROLLBACK TO sv;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_4 VALUES ("new text -35", -35, '')
+master-bin.000001	#	Query	#	#	use `test`; SAVEPOINT sv
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK TO sv
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+###################################################################################
+#                 3 - CREATE TABLE...SELECT and CREATE TABLE...LIKE
+###################################################################################
+CREATE TABLE tt_xx10 engine=Innodb SELECT * FROM tt_2;
+DROP TABLE tt_xx10;
+CREATE TABLE nt_xx11 engine=MyIsam SELECT * FROM tt_2;
+DROP TABLE nt_xx11;
+CREATE TABLE nt_xx12 LIKE tt_2;
+DROP TABLE nt_xx12;
+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`; CREATE TABLE tt_xx10 engine=Innodb SELECT * FROM tt_2
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE tt_xx10
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE `nt_xx11` (
+  `a` text,
+  `b` int(11) NOT NULL DEFAULT '0',
+  `c` text
+) ENGINE=MyISAM
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_xx11)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE nt_xx11
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE nt_xx12 LIKE tt_2
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE nt_xx12
+###################################################################################
+#                                        CLEAN
+###################################################################################
+SET @commands= 'clean';
+DROP TABLE tt_1;
+DROP TABLE tt_2;
+DROP TABLE tt_3;
+DROP TABLE tt_4;
+DROP TABLE tt_5;
+DROP TABLE tt_6;
+DROP TABLE nt_1;
+DROP TABLE nt_2;
+DROP TABLE nt_3;
+DROP TABLE nt_4;
+DROP TABLE nt_5;
+DROP TABLE nt_6;
+DROP PROCEDURE pc_i_tt_3_suc;
+DROP PROCEDURE pc_i_nt_4_suc;
+DROP PROCEDURE pc_i_tt_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+SET @commands='';

=== added file 'mysql-test/suite/rpl/r/rpl_row_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result	2009-09-13 16:12:48 +0000
@@ -0,0 +1,3570 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+#########################################################################
+#                            CONFIGURATION
+#########################################################################
+SET @commands= 'configure';
+SET SQL_LOG_BIN=0;
+CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+SET SQL_LOG_BIN=1;
+INSERT INTO nt_1(b) VALUES(1);
+INSERT INTO nt_2(b) VALUES(1);
+INSERT INTO nt_3(b) VALUES(1);
+INSERT INTO nt_4(b) VALUES(1);
+INSERT INTO nt_5(b) VALUES(1);
+INSERT INTO nt_6(b) VALUES(1);
+INSERT INTO tt_1(b) VALUES(1);
+INSERT INTO tt_2(b) VALUES(1);
+INSERT INTO tt_3(b) VALUES(1);
+INSERT INTO tt_4(b) VALUES(1);
+INSERT INTO tt_5(b) VALUES(1);
+INSERT INTO tt_6(b) VALUES(1);
+CREATE PROCEDURE pc_i_tt_3_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO tt_3(a,c) VALUES (y, y);
+INSERT INTO tt_3(a,c) VALUES (y, y);
+END|
+CREATE PROCEDURE pc_i_nt_4_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO nt_4(a,c) VALUES (y, y);
+INSERT INTO nt_4(a,c) VALUES (y, y);
+END|
+CREATE PROCEDURE pc_i_tt_5_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO tt_5(a,c) VALUES (y, y);
+INSERT INTO tt_5(a,c) VALUES (y, y);
+END|
+CREATE PROCEDURE pc_i_nt_5_suc (IN y VARCHAR(64))
+BEGIN
+INSERT INTO nt_5(a,c) VALUES (y, y);
+INSERT INTO nt_5(a,c) VALUES (y, y);
+END|
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+BEGIN
+INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+END|
+SET @commands='';
+#########################################################################
+#         1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
+#########################################################################
+
+
+
+
+#
+#1) Generates in the binlog what follows:
+#      --> STMT  "B T C" entries, format S.
+#      --> ROW   "B T C" entries, format R.
+#      --> MIXED "B T C" entries, format S.
+#
+SET @commands= 'T';
+INSERT INTO tt_1(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'T-trig';
+INSERT INTO tt_5(a,c) VALUES ("new text 2", "new text 2");
+SET @commands= 'T-proc';
+CALL pc_i_tt_5_suc ("new text 3");
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#1.e) Generates in the binlog what follows:
+#        --> STMT  empty.
+#        --> ROW   empty.
+#        --> MIXED empty.
+#
+SET @commands= 'Te-begin';
+INSERT INTO tt_1(a, b, c) VALUES ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Te-end';
+INSERT INTO tt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Te-trig';
+INSERT INTO tt_5(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+
+
+
+
+#
+#2) Generates in the binlog what follows:
+#      --> STMT  "N" entry, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format S.
+#
+SET @commands= 'N';
+INSERT INTO nt_1(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'N-trig';
+INSERT INTO nt_5(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'N-proc';
+CALL pc_i_nt_5_suc ("new text 3");
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#2.e) Generates in the binglog what follows if a N-table is changed:
+#        --> STMT  "N" entry, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format S.
+#
+SET @commands= 'Ne-begin';
+INSERT INTO nt_1(a, b, c) VALUES ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Ne-end';
+INSERT INTO nt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Ne-trig';
+INSERT INTO nt_5(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#3) Generates in the binglog what follows:
+#      --> STMT  "M" entry if only N-Table is changed, format S.
+#      --> STMT  "B M C" entries, format S.
+#      --> ROW   "N B T C" entries, format R.
+#      --> MIXED "N B T C" entries, format R.
+#
+SET @commands= 'Nt';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'nT';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'NT';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'NT-trig';
+INSERT INTO nt_4(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'NT-proc';
+CALL pc_i_nt_4_suc ("new text 3");
+SET @commands= 'TN';
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+SET @commands= 'TN-trig';
+INSERT INTO tt_3(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'TN-proc';
+CALL pc_i_tt_3_suc ("new text 3");
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#3.e) Generates in the binglog what follows:
+#      --> STMT  "M" entry if only N-Table is changed, format S.
+#      --> STMT  "B M R" entries, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format R.
+SET @commands= 'Nte';
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+SET @commands= 'nTe';
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 8, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 7, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+SET @commands= 'NTe-trig';
+INSERT INTO nt_4(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+SET @commands= 'TNe-trig';
+INSERT INTO tt_3(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#4) Generates in the binlog what follows:
+#     --> STMT  "B T T C" entries, format S.
+#     --> ROW   "B T T C" entries, format R.
+#     --> MIXED "B T T C" entries, format S
+#
+SET @commands= 'B T T C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 7", "new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 9", "new text 9");
+COMMIT;
+SET @commands= 'B T T-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO tt_5(a,c) VALUES ("new text 5", "new text 5");
+COMMIT;
+SET @commands= 'B T T-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 11", "new text 11");
+CALL pc_i_tt_5_suc ("new text 7");
+COMMIT;
+SET @commands= 'B T-trig T C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 9", "new text 9");
+INSERT INTO tt_1(a, c) VALUES ("new text 12", "new text 12");
+COMMIT;
+SET @commands= 'B T-trig T-trig C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 10", "new text 10");
+INSERT INTO tt_5(a,c) VALUES ("new text 11", "new text 11");
+COMMIT;
+SET @commands= 'B T-trig T-proc C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 12", "new text 12");
+CALL pc_i_tt_5_suc ("new text 13");
+COMMIT;
+SET @commands= 'B T-proc T C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 15");
+INSERT INTO tt_1(a, c) VALUES ("new text 13", "new text 13");
+COMMIT;
+SET @commands= 'B T-proc T-trig C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 17");
+INSERT INTO tt_5(a,c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B T-proc T-proc C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 20");
+CALL pc_i_tt_5_suc ("new text 22");
+COMMIT;
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+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	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+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	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#4.e) Generates in the binlog what follows:
+#       --> STMT  "B T C" entries, format S.
+#       --> ROW   "B T C" entries, format R.
+#       --> MIXED "B T C" entries, format S.
+#
+SET @commands= 'B T Te-begin C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 14", "new text 14");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 14", 14, "new text 14");
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Te-end C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 15", "new text 15");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Te-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B Te-begin T C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 17", 17, "new text 17");
+ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 18", "new text 18");
+COMMIT;
+SET @commands= 'B Te-end T C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 19", 19, "new text 19"), ("new text 18", 18, "new text 18");
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B Te-trig T C';
+BEGIN;
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 21", "new text 21");
+COMMIT;
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+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	#	Xid	#	#	COMMIT /* XID */
+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	#	Xid	#	#	COMMIT /* XID */
+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	#	Xid	#	#	COMMIT /* XID */
+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	#	Xid	#	#	COMMIT /* XID */
+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	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#5) Generates in the binlog what follows:
+#     --> STMT  empty.
+#     --> ROW   empty.
+#     --> MIXED empty.
+#
+SET @commands= 'B T T R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, c) VALUES ("new text 23", "new text 23");
+ROLLBACK;
+SET @commands= 'B T T-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+ROLLBACK;
+SET @commands= 'B T T-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+CALL pc_i_tt_5_suc ("new text 24");
+ROLLBACK;
+SET @commands= 'B T-trig T R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-trig T-trig R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+INSERT INTO tt_5(a,c) VALUES ("new text 30", "new text 30");
+ROLLBACK;
+SET @commands= 'B T-trig T-proc R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+CALL pc_i_tt_5_suc ("new text 32");
+ROLLBACK;
+SET @commands= 'B T-proc T R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 24");
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-proc T-trig R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 24");
+INSERT INTO tt_5(a,c) VALUES ("new text 38", "new text 38");
+ROLLBACK;
+SET @commands= 'B T-proc T-proc R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 24");
+CALL pc_i_tt_5_suc ("new text 41");
+ROLLBACK;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+
+
+
+
+#
+#5.e) Generates in the binlog what follows:
+#       --> STMT  empty.
+#       --> ROW   empty.
+#       --> MIXED empty.
+#
+SET @commands= 'B T Te-begin R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 28", 28, "new text 28");
+ERROR 23000: Duplicate entry '28' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Te-end R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Te-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B Te-begin T R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 21", 21, "new text 21");
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B Te-end T R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 22", 22, "new text 22"), ("new text 21", 21, "new text 21");
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B Te-trig T R';
+BEGIN;
+INSERT INTO tt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+
+
+
+
+#
+#6) Generates in the binglog what follows:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N N C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10");
+COMMIT;
+SET @commands= 'B N N-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11");
+INSERT INTO nt_5(a, c) VALUES ("new text 6", "new text 6");
+COMMIT;
+SET @commands= 'B N N-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12");
+CALL pc_i_nt_5_suc ("new text 7");
+COMMIT;
+SET @commands= 'B N-trig N C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13");
+COMMIT;
+SET @commands= 'B N-trig N-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO nt_5(a, c) VALUES ("new text 11", "new text 11");
+COMMIT;
+SET @commands= 'B N-trig N-proc C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 12", "new text 12");
+CALL pc_i_nt_5_suc ("new text 13");
+COMMIT;
+SET @commands= 'B N-proc N C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 15");
+INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14");
+COMMIT;
+SET @commands= 'B N-proc N-trig C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 17");
+INSERT INTO nt_5(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B N-proc N-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 20");
+CALL pc_i_nt_5_suc ("new text 22");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#6.e) Generates in the binglog what follows if a N-Table is changed:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N Ne-begin C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 15", "new text 15");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N Ne-end C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16");
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N Ne-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 18", "new text 18");
+INSERT INTO nt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B Ne-begin N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 18", 18, "new text 18");
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B Ne-end N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 20", 20, "new text 20"), ("new text 19", 19, "new text 19");
+ERROR 23000: Duplicate entry '19' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 21", "new text 21");
+COMMIT;
+SET @commands= 'B Ne-trig N C';
+BEGIN;
+INSERT INTO nt_5(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24");
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 22", "new text 22");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#7) Generates in the binlog what follows:
+#      --> STMT  "N N" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N N R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N N-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25");
+INSERT INTO nt_5(a, c) VALUES ("new text 26", "new text 26");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N N-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26");
+CALL pc_i_nt_5_suc ("new text 27");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 29", "new text 29");
+INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 30", "new text 30");
+INSERT INTO nt_5(a, c) VALUES ("new text 31", "new text 31");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N-proc R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 32", "new text 32");
+CALL pc_i_nt_5_suc ("new text 33");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 35");
+INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N-trig R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 37");
+INSERT INTO nt_5(a, c) VALUES ("new text 39", "new text 39");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 40");
+CALL pc_i_nt_5_suc ("new text 42");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#7.e) Generates in the binglog what follows if a N-Table is changed:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N Ne-begin R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 29", "new text 29");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N Ne-end R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 30", "new text 30");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 31", 31, "new text 31"), ("new text 30", 30, "new text 30");
+ERROR 23000: Duplicate entry '30' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N Ne-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 32", "new text 32");
+INSERT INTO nt_5(a, b, c) VALUES ("new text 44", 44, "new text 44"), ("new text 43", 43, "new text 43");
+ERROR 23000: Duplicate entry '43' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-begin N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 32", 32, "new text 32");
+ERROR 23000: Duplicate entry '32' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 33", "new text 33");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-end N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 34", 34, "new text 34"), ("new text 33", 33, "new text 33");
+ERROR 23000: Duplicate entry '33' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 35", "new text 35");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-trig N R';
+BEGIN;
+INSERT INTO nt_5(a, b, c) VALUES ("new text 45", 45, "new text 45"), ("new text 44", 44, "new text 44");
+ERROR 23000: Duplicate entry '44' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 36", "new text 36");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#8) Generates in the binlog what follows:
+#       --> STMT  "B T N C" entries, format S.
+#       --> ROW   "N B T C" entries, format R.
+#       --> MIXED "N B T C" entries, format R in N and S in T.
+#
+SET @commands= 'B T N C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO nt_1(a, c) VALUES ("new text 37", "new text 37");
+COMMIT;
+SET @commands= 'B T N-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 36", "new text 36");
+INSERT INTO nt_5(a, c) VALUES ("new text 46", "new text 46");
+COMMIT;
+SET @commands= 'B T N-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 37", "new text 37");
+CALL pc_i_nt_5_suc ("new text 47");
+COMMIT;
+SET @commands= 'B T-trig N C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 24", "new text 24");
+INSERT INTO nt_1(a, c) VALUES ("new text 38", "new text 38");
+COMMIT;
+SET @commands= 'B T-trig N-trig C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 44", "new text 44");
+INSERT INTO nt_5(a, c) VALUES ("new text 49", "new text 49");
+COMMIT;
+SET @commands= 'B T-trig N-proc C';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 45", "new text 45");
+CALL pc_i_nt_5_suc ("new text 50");
+COMMIT;
+SET @commands= 'B T-proc N C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 46");
+INSERT INTO nt_1(a, c) VALUES ("new text 39", "new text 39");
+COMMIT;
+SET @commands= 'B T-proc N-trig C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 48");
+INSERT INTO nt_5(a, c) VALUES ("new text 52", "new text 52");
+COMMIT;
+SET @commands= 'B T-proc N-proc C';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 50");
+CALL pc_i_nt_5_suc ("new text 53");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#8.e) Generates in the binlog what follows if T-* fails:
+#       --> STMT  "N" entry, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#     Otherwise, what follows if N-* fails and a N-Table is changed:
+#       --> STMT  "B T N C" entries, format S.
+#       --> ROW   "N B T C" entries, format R.
+#       --> MIXED "N B T C" entries, format R in N and S in T.
+#
+SET @commands= 'B Te-begin N C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 37", 37, "new text 37");
+ERROR 23000: Duplicate entry '37' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 40", "new text 40");
+COMMIT;
+SET @commands= 'B Te-end N C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 38", 38, "new text 38"), ("new text 37", 37, "new text 37");
+ERROR 23000: Duplicate entry '37' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 41", "new text 41");
+COMMIT;
+SET @commands= 'B T Ne-begin C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 38", "new text 38");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 41", 41, "new text 41");
+ERROR 23000: Duplicate entry '41' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Ne-end C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 40", "new text 40");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 42", 42, "new text 42"), ("new text 41", 41, "new text 41");
+ERROR 23000: Duplicate entry '41' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#9) Generates in the binlog what follows:
+#     --> STMT  "B T N R" entries, format S.
+#     --> ROW   "N" entry, format R.
+#     --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T N R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, c) VALUES ("new text 43", "new text 43");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T N-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_5(a, c) VALUES ("new text 55", "new text 55");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T N-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+CALL pc_i_nt_5_suc ("new text 56");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+INSERT INTO nt_1(a, c) VALUES ("new text 44", "new text 44");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N-trig R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+INSERT INTO nt_5(a, c) VALUES ("new text 58", "new text 58");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N-proc R';
+BEGIN;
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+CALL pc_i_nt_5_suc ("new text 59");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 52");
+INSERT INTO nt_1(a, c) VALUES ("new text 45", "new text 45");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N-trig R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 52");
+INSERT INTO nt_5(a, c) VALUES ("new text 61", "new text 61");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N-proc R';
+BEGIN;
+CALL pc_i_tt_5_suc ("new text 52");
+CALL pc_i_nt_5_suc ("new text 62");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#9.e) Generates in the binlog what follows if T* fails:
+#       --> STMT  "N" entry, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#     Otherwise, what follows if N* fails and a N-Table is changed:
+#       --> STMT  "B T N R" entries, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Te-begin N R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 40", 40, "new text 40");
+ERROR 23000: Duplicate entry '40' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 46", "new text 46");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Te-end N R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 41", 41, "new text 41"), ("new text 40", 40, "new text 40");
+ERROR 23000: Duplicate entry '40' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 47", "new text 47");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T Ne-begin R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 47", 47, "new text 47");
+ERROR 23000: Duplicate entry '47' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Ne-end R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 48", 48, "new text 48"), ("new text 47", 47, "new text 47");
+ERROR 23000: Duplicate entry '47' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#10) Generates in the binlog:
+#     --> STMT  "N B T C" entries, format S.
+#     --> ROW   "N B T C" entries, format R.
+#     --> MIXED "N B T C" entries, format S.
+#
+SET @commands= 'B N T C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 49", "new text 49");
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+COMMIT;
+SET @commands= 'B N T-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 50", "new text 50");
+INSERT INTO tt_5(a,c) VALUES ("new text 52", "new text 52");
+COMMIT;
+SET @commands= 'B N T-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 51", "new text 51");
+CALL pc_i_tt_5_suc ("new text 62");
+COMMIT;
+SET @commands= 'B N-trig T C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 64", "new text 64");
+INSERT INTO tt_1(a, c) VALUES ("new text 47", "new text 47");
+COMMIT;
+SET @commands= 'B N-trig T-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 65", "new text 65");
+INSERT INTO tt_5(a,c) VALUES ("new text 64", "new text 64");
+COMMIT;
+SET @commands= 'B N-trig T-proc C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 66", "new text 66");
+CALL pc_i_tt_5_suc ("new text 65");
+COMMIT;
+SET @commands= 'B N-proc T C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 67");
+INSERT INTO tt_1(a, c) VALUES ("new text 48", "new text 48");
+COMMIT;
+SET @commands= 'B N-proc T-trig C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 69");
+INSERT INTO tt_5(a,c) VALUES ("new text 67", "new text 67");
+COMMIT;
+SET @commands= 'B N-proc T-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 71");
+CALL pc_i_tt_5_suc ("new text 68");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#10.e) Check 8.e
+#
+
+
+
+
+#
+#11) Generates in the binlog what follows:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N T R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 52", "new text 52");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N T-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 53", "new text 53");
+CALL pc_i_tt_5_suc ("new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N T-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 54", "new text 54");
+INSERT INTO tt_5(a,c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 73", "new text 73");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 74", "new text 74");
+INSERT INTO tt_5(a,c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T-proc R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 75", "new text 75");
+CALL pc_i_tt_5_suc ("new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 76");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 78");
+CALL pc_i_tt_5_suc ("new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T-trig R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 80");
+INSERT INTO tt_5(a,c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_5)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_6)
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#11.e) Check 9.e
+#
+
+
+
+
+#
+#12) "B M T C" generates in the binlog what follows:
+#      --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M T C" entries, format S.
+#      --> ROW   "N B T T C" entries, format R.
+#      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#
+SET @commands= 'B Nt T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 53", "new text 53");
+COMMIT;
+SET @commands= 'B nT T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 55", "new text 55");
+COMMIT;
+SET @commands= 'B NT T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 57", "new text 57");
+COMMIT;
+SET @commands= 'B NT-trig T C';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 6", "new text 6");
+INSERT INTO tt_1(a, c) VALUES ("new text 58", "new text 58");
+COMMIT;
+SET @commands= 'B NT-proc T C';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 59", "new text 59");
+COMMIT;
+SET @commands= 'B TN T C';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 5", tt_4.a= "new text 5", nt_3.a= "new text 5", nt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 60", "new text 60");
+COMMIT;
+SET @commands= 'B TN-trig T C';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 5", "new text 5");
+INSERT INTO tt_1(a, c) VALUES ("new text 61", "new text 61");
+COMMIT;
+SET @commands= 'B TN-proc T C';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 62", "new text 62");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#12.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+#        --> STMT  "B M T C" entries, format S.
+#        --> ROW   "N B T T C" entries, format R.
+#        --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#  
+SET @commands= 'B Nte T C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 58, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 57, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '57' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '62' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 63", "new text 63");
+COMMIT;
+SET @commands= 'B nTe T C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 59, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 58, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '58' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 65, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 64, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '64' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 65", "new text 65");
+COMMIT;
+SET @commands= 'B NTe-trig T C';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 67", "new text 67");
+COMMIT;
+SET @commands= 'B TNe-trig T C';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 68", "new text 68");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#13) "B M T R" generates in the binlog:
+#      --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M T R" entries, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Nt T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nT T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 72", "new text 72");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 74", "new text 74");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-trig T R';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-proc T R';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 11");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN T R';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-trig T R';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-proc T R';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 9");
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#13.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+#        --> STMT  "B M T R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Nte T R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '62' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+SET @commands= 'B nTe T R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 64, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 63, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '63' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+SET @commands= 'B NTe-trig T R';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 13", 13, "new text 13"), ("new text 12", 12, "new text 12");
+ERROR 23000: Duplicate entry '12' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TNe-trig T R';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#14) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "B T M C" entries, format S.
+#      --> ROW   "N B T T C" entries, format R.
+#      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#
+SET @commands= 'B T Nt C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T nT C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 86", "new text 86");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T NT C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 88", "new text 88");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T NT-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 90", "new text 90");
+INSERT INTO nt_4(a, c) VALUES ("new text 14", "new text 14");
+COMMIT;
+SET @commands= 'B T NT-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 91", "new text 91");
+CALL pc_i_nt_4_suc ("new text 15");
+COMMIT;
+SET @commands= 'B T TN C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 92", "new text 92");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B T TN-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 93", "new text 93");
+INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9");
+COMMIT;
+SET @commands= 'B T TN-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 94", "new text 94");
+CALL pc_i_tt_3_suc ("new text 14");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#14.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M C" entries, format S.
+#        --> ROW   "N B T C" entry, format R.
+#        --> MIXED "N B T C" entry, format R.
+#
+SET @commands= 'B T Nte C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 95", "new text 95");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 68, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 67, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '67' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 96, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 95, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '95' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T nTe C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 96", "new text 96");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 98, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 97, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '97' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T NTe-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 98", "new text 98");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16");
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T TNe-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 100", "new text 100");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#15) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T Nt R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T nT R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_4(a, c) VALUES ("new text 18", "new text 18");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+CALL pc_i_nt_4_suc ("new text 19");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+CALL pc_i_tt_3_suc ("new text 16");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#15.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T Nte R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 73, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 72, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '72' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 113, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 112, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '112' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T nTe R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 74, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 73, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '73' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 115, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 114, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '114' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T NTe-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 21", 21, "new text 21"), ("new text 20", 20, "new text 20");
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TNe-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#16) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N C" entries, format S.
+#      --> ROW   "N N B T C" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N B T C" entries, format R.
+#
+SET @commands= 'B Nt N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 76", "new text 76");
+COMMIT;
+SET @commands= 'B nT N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 78", "new text 78");
+COMMIT;
+SET @commands= 'B NT N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 80", "new text 80");
+COMMIT;
+SET @commands= 'B NT-trig N C';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO nt_1(a, c) VALUES ("new text 81", "new text 81");
+COMMIT;
+SET @commands= 'B NT-proc N C';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 82", "new text 82");
+COMMIT;
+SET @commands= 'B TN N C';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 83", "new text 83");
+COMMIT;
+SET @commands= 'B TN-trig N C';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO nt_1(a, c) VALUES ("new text 84", "new text 84");
+COMMIT;
+SET @commands= 'B TN-proc N C';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 21");
+INSERT INTO nt_1(a, c) VALUES ("new text 85", "new text 85");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#16.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N C" entries, format S.
+#      --> ROW   "N N B T C" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N B T C" entries, format R.
+#
+SET @commands= 'B Nte N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 86, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 85, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '85' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 87", "new text 87");
+COMMIT;
+SET @commands= 'B nTe N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 88, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 87, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '87' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 89", "new text 89");
+COMMIT;
+SET @commands= 'B NTe-trig N C';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24");
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 90", "new text 90");
+COMMIT;
+SET @commands= 'B TNe-trig N C';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22");
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 91", "new text 91");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#17) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#    --> STMT  "B M N R" entries, format S.
+#    --> ROW   "N N" entries, format R.
+#    --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#    --> MIXED "N N" entries, format R.
+#
+SET @commands= 'B Nt N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 93", "new text 93");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nT N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 95", "new text 95");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 97", "new text 97");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-trig N R';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 26", "new text 26");
+INSERT INTO nt_1(a, c) VALUES ("new text 98", "new text 98");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-proc N R';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 27");
+INSERT INTO nt_1(a, c) VALUES ("new text 99", "new text 99");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN N R';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+INSERT INTO nt_1(a, c) VALUES ("new text 100", "new text 100");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-trig N R';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 101", "new text 101");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-proc N R';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 102", "new text 102");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#17.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N R" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N" entries, format R.
+#
+SET @commands= 'B Nte N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 103, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 102, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '102' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 104", "new text 104");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nTe N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 105, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 104, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '104' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 106", "new text 106");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NTe-trig N R';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 29", 29, "new text 29"), ("new text 28", 28, "new text 28");
+ERROR 23000: Duplicate entry '28' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 107", "new text 107");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TNe-trig N R';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22");
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 108", "new text 108");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#18) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#    --> STMT  "N B M C" entries, format S.
+#    --> ROW   "N N B T C" entries, format R.
+#    --> MIXED "N N B T C" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nt C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 109", "new text 109");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N nT C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 111", "new text 111");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N NT C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 113", "new text 113");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N NT-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 115", "new text 115");
+INSERT INTO nt_4(a, c) VALUES ("new text 30", "new text 30");
+COMMIT;
+SET @commands= 'B N NT-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 116", "new text 116");
+CALL pc_i_nt_4_suc ("new text 31");
+COMMIT;
+SET @commands= 'B N TN C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 117", "new text 117");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+COMMIT;
+SET @commands= 'B N TN-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 118", "new text 118");
+INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23");
+COMMIT;
+SET @commands= 'B N TN-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 119", "new text 119");
+CALL pc_i_tt_3_suc ("new text 28");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+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	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#18.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#      --> STMT  "N B M C" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nte C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 120", "new text 120");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N nTe C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 122", "new text 122");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 123, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 122, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '122' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N NTe-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 124", "new text 124");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 33", 33, "new text 33"), ("new text 32", 32, "new text 32");
+ERROR 23000: Duplicate entry '32' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N TNe-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 125", "new text 125");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#19) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#    --> STMT  "N B M R" entries, format S.
+#    --> ROW   "N N" entries, format R.
+#    --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nt R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 126", "new text 126");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N nT R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 128", "new text 128");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 130", "new text 130");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 132", "new text 132");
+INSERT INTO nt_4(a, c) VALUES ("new text 34", "new text 34");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 133", "new text 133");
+CALL pc_i_nt_4_suc ("new text 35");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 134", "new text 134");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 30", tt_4.a= "new text 30", nt_3.a= "new text 30", nt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 135", "new text 135");
+INSERT INTO tt_3(a, c) VALUES ("new text 30", "new text 30");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 136", "new text 136");
+CALL pc_i_tt_3_suc ("new text 30");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Update_rows	#	#	table_id: #
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+
+
+
+
+#
+#19.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#      --> STMT  "N B M R" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nte R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 137", "new text 137");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 138, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 137, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '137' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N nTe R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 139", "new text 139");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 140, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 139, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '139' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NTe-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 141", "new text 141");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 37", 37, "new text 37"), ("new text 36", 36, "new text 36");
+ERROR 23000: Duplicate entry '36' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TNe-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 142", "new text 142");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+###################################################################################
+#                               2 - SAVEPOINT
+###################################################################################
+BEGIN;
+INSERT INTO tt_3 VALUES ("new text -34", -35, '');
+INSERT INTO tt_4 VALUES ("new text -35", -35, '');
+SAVEPOINT sv;
+INSERT INTO nt_3 VALUES ("new text -36", -36, '');
+INSERT INTO tt_3 VALUES ("new text -37", -37, '');
+ROLLBACK TO sv;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; SAVEPOINT sv
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK TO sv
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+###################################################################################
+#                 3 - CREATE TABLE...SELECT and CREATE TABLE...LIKE
+###################################################################################
+CREATE TABLE tt_xx10 engine=Innodb SELECT * FROM tt_2;
+DROP TABLE tt_xx10;
+CREATE TABLE nt_xx11 engine=MyIsam SELECT * FROM tt_2;
+DROP TABLE nt_xx11;
+CREATE TABLE nt_xx12 LIKE tt_2;
+DROP TABLE nt_xx12;
+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`; CREATE TABLE `tt_xx10` (
+  `a` text,
+  `b` int(11) NOT NULL DEFAULT '0',
+  `c` text
+) ENGINE=InnoDB
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_xx10)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE tt_xx10
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE `nt_xx11` (
+  `a` text,
+  `b` int(11) NOT NULL DEFAULT '0',
+  `c` text
+) ENGINE=MyISAM
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_xx11)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE nt_xx11
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE nt_xx12 LIKE tt_2
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE nt_xx12
+###################################################################################
+#                                        CLEAN
+###################################################################################
+SET @commands= 'clean';
+DROP TABLE tt_1;
+DROP TABLE tt_2;
+DROP TABLE tt_3;
+DROP TABLE tt_4;
+DROP TABLE tt_5;
+DROP TABLE tt_6;
+DROP TABLE nt_1;
+DROP TABLE nt_2;
+DROP TABLE nt_3;
+DROP TABLE nt_4;
+DROP TABLE nt_5;
+DROP TABLE nt_6;
+DROP PROCEDURE pc_i_tt_3_suc;
+DROP PROCEDURE pc_i_nt_4_suc;
+DROP PROCEDURE pc_i_tt_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+SET @commands='';

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result	2009-09-13 14:58:28 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result	2009-09-13 16:12:48 +0000
@@ -4,957 +4,3448 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-###################################################################################
-#                                   CONFIGURATION
-###################################################################################
+#########################################################################
+#                            CONFIGURATION
+#########################################################################
+SET @commands= 'configure';
 SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
+CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
 SET SQL_LOG_BIN=1;
 SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
-CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
-CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
+CREATE TABLE nt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_2 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_3 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_4 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_5 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
+CREATE TABLE tt_6 (a text, b int AUTO_INCREMENT, c text, PRIMARY KEY(b)) ENGINE = Innodb;
 SET SQL_LOG_BIN=1;
-CREATE FUNCTION f1 () RETURNS VARCHAR(64)
+INSERT INTO nt_1(b) VALUES(1);
+INSERT INTO nt_2(b) VALUES(1);
+INSERT INTO nt_3(b) VALUES(1);
+INSERT INTO nt_4(b) VALUES(1);
+INSERT INTO nt_5(b) VALUES(1);
+INSERT INTO nt_6(b) VALUES(1);
+INSERT INTO tt_1(b) VALUES(1);
+INSERT INTO tt_2(b) VALUES(1);
+INSERT INTO tt_3(b) VALUES(1);
+INSERT INTO tt_4(b) VALUES(1);
+INSERT INTO tt_5(b) VALUES(1);
+INSERT INTO tt_6(b) VALUES(1);
+CREATE PROCEDURE pc_i_tt_3_suc (IN y VARCHAR(64))
 BEGIN
-RETURN "Testing...";
+INSERT INTO tt_3(a,c) VALUES (y, y);
+INSERT INTO tt_3(a,c) VALUES (y, y);
 END|
-CREATE FUNCTION f2 () RETURNS VARCHAR(64)
+CREATE PROCEDURE pc_i_nt_4_suc (IN y VARCHAR(64))
 BEGIN
-RETURN f1();
+INSERT INTO nt_4(a,c) VALUES (y, y);
+INSERT INTO nt_4(a,c) VALUES (y, y);
 END|
-CREATE PROCEDURE pc_i_tt_3 (IN x INT, IN y VARCHAR(64))
+CREATE PROCEDURE pc_i_tt_5_suc (IN y VARCHAR(64))
 BEGIN
-INSERT INTO tt_3 VALUES (y,x,x);
+INSERT INTO tt_5(a,c) VALUES (y, y);
+INSERT INTO tt_5(a,c) VALUES (y, y);
 END|
-CREATE TRIGGER tr_i_tt_3_to_nt_3 BEFORE INSERT ON tt_3 FOR EACH ROW
+CREATE PROCEDURE pc_i_nt_5_suc (IN y VARCHAR(64))
 BEGIN
-INSERT INTO nt_3 VALUES (NEW.a, NEW.b, NEW.c);
+INSERT INTO nt_5(a,c) VALUES (y, y);
+INSERT INTO nt_5(a,c) VALUES (y, y);
 END|
-CREATE TRIGGER tr_i_nt_4_to_tt_4 BEFORE INSERT ON nt_4 FOR EACH ROW
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
 BEGIN
-INSERT INTO tt_4 VALUES (NEW.a, NEW.b, NEW.c);
+INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO nt_3(a,c) VALUES (NEW.a, NEW.c);
 END|
-###################################################################################
-#                 MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
-###################################################################################
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO tt_4(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO tt_6(a,c) VALUES (NEW.a, NEW.c);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+INSERT INTO nt_6(a,c) VALUES (NEW.a, NEW.c);
+END|
+SET @commands='';
+#########################################################################
+#         1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
+#########################################################################
+
+
+
+
 #
-#1) "B T T C" generates in binlog the "B T T C" entries.
+#1) Generates in the binlog what follows:
+#      --> STMT  "B T C" entries, format S.
+#      --> ROW   "B T C" entries, format R.
+#      --> MIXED "B T C" entries, format S.
 #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4");
-INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4");
-COMMIT;
+SET @commands= 'T';
+INSERT INTO tt_1(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'T-trig';
+SET @commands= 'T-proc';
 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 tt_1 VALUES ("new text 4", 4, "new text 4")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 2", "new text 2")
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 
 
 
 
 #
-#1.e) "B T T C" with error in T generates in binlog the "B T T C" entries.
+#1.e) Generates in the binlog what follows:
+#        --> STMT  empty.
+#        --> ROW   empty.
+#        --> MIXED empty.
 #
-INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2");
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -2", -2, "new text -2");
-ERROR 23000: Duplicate entry '-2' for key 'PRIMARY'
-INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3");
-COMMIT;
-BEGIN;
-INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5");
-INSERT INTO tt_2 VALUES ("new text -4", -4, "new text -4"), ("new text -5", -5, "new text -5");
-ERROR 23000: Duplicate entry '-5' for key 'PRIMARY'
-COMMIT;
+SET @commands= 'Te-begin';
+INSERT INTO tt_1(a, b, c) VALUES ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Te-end';
+INSERT INTO tt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Te-trig';
+INSERT INTO tt_5(a, b, c) VALUES ("new text 2", 2, "new text 2"), ("new text 1", 1, "new text 1");
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
 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 tt_1 VALUES ("new text -2", -2, "new text -2")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 
 
 
 
 #
-#2) "B T T R"  generates in binlog an "empty" entry.
+#2) Generates in the binlog what follows:
+#      --> STMT  "N" entry, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format S.
 #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 5", 5, "new text 5");
-INSERT INTO tt_2 VALUES ("new text 5", 5, "new text 5");
-ROLLBACK;
+SET @commands= 'N';
+INSERT INTO nt_1(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'N-trig';
+INSERT INTO nt_5(a, c) VALUES ("new text 2", "new text 2");
+SET @commands= 'N-proc';
+CALL pc_i_nt_5_suc ("new text 3");
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 2", "new text 2")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 2", "new text 2")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=3
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=4
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'))
 
 
 
 
 #
-#2.e) "B T T R"  with error in T generates in binlog an "empty" entry.
+#2.e) Generates in the binglog what follows if a N-table is changed:
+#        --> STMT  "N" entry, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format S.
 #
-INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7");
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text -6", -6, "new text -6"), ("new text -7", -7, "new text -7");
-ERROR 23000: Duplicate entry '-7' for key 'PRIMARY'
-INSERT INTO tt_2 VALUES ("new text -8", -8, "new text -8");
-ROLLBACK;
-BEGIN;
-INSERT INTO tt_2 VALUES ("new text -10", -10, "new text -10");
-INSERT INTO tt_2 VALUES ("new text -9", -9, "new text -9"), ("new text -10", -10, "new text -10");
-ERROR 23000: Duplicate entry '-10' for key 'PRIMARY'
-ROLLBACK;
+SET @commands= 'Ne-begin';
+INSERT INTO nt_1(a, b, c) VALUES ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Ne-end';
+INSERT INTO nt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2");
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SET @commands= 'Ne-trig';
+INSERT INTO nt_5(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
 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 tt_1 VALUES ("new text -7", -7, "new text -7")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 3", 3, "new text 3"), ("new text 2", 2, "new text 2")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4")
 
 
 
 
 #
-#3) "B T N C" generates in binlog the "B T N C" entries.
+#3) Generates in the binglog what follows:
+#      --> STMT  "M" entry if only N-Table is changed, format S.
+#      --> STMT  "B M C" entries, format S.
+#      --> ROW   "N B T C" entries, format R.
+#      --> MIXED "N B T C" entries, format R.
 #
-BEGIN;
-INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6");
-INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6");
+SET @commands= 'Nt';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'nT';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'NT';
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'NT-trig';
+INSERT INTO nt_4(a, c) VALUES ("new text 2", "new text 2");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'NT-proc';
+CALL pc_i_nt_4_suc ("new text 3");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'TN';
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'TN-trig';
+INSERT INTO tt_3(a, c) VALUES ("new text 2", "new text 2");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+SET @commands= 'TN-proc';
+CALL pc_i_tt_3_suc ("new text 3");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-COMMIT;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=4
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=4
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6")
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=5
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=5
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=6
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=6
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 2", nt_4.a= "new text 2", tt_3.a= "new text 2", tt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 2", "new text 2")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=3
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=4
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a= "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=2
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 2", "new text 2")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=3
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=4
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 3' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#3.e) Generates in the binglog what follows:
+#      --> STMT  "M" entry if only N-Table is changed, format S.
+#      --> STMT  "B M R" entries, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format R.
+SET @commands= 'Nte';
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+SET @commands= 'nTe';
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 8, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 7, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+SET @commands= 'NTe-trig';
+INSERT INTO nt_4(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+SET @commands= 'TNe-trig';
+INSERT INTO tt_3(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4");
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 7, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 6, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 8, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 7, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 5", 5, "new text 5"), ("new text 4", 4, "new text 4")
+master-bin.000001	#	Query	#	#	ROLLBACK
 
 
 
 
 #
-#3.e) "B T N C" with error in either T or N generates in binlog the "B T N C" entries.
+#4) Generates in the binlog what follows:
+#     --> STMT  "B T T C" entries, format S.
+#     --> ROW   "B T T C" entries, format R.
+#     --> MIXED "B T T C" entries, format S
 #
-INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12");
+SET @commands= 'B T T C';
 BEGIN;
-INSERT INTO tt_1 VALUES ("new text -11", -11, "new text -11"), ("new text -12", -12, "new text -12");
-ERROR 23000: Duplicate entry '-12' for key 'PRIMARY'
-INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13");
+INSERT INTO tt_1(a, c) VALUES ("new text 7", "new text 7");
+INSERT INTO tt_1(a, c) VALUES ("new text 9", "new text 9");
 COMMIT;
+SET @commands= 'B T T-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 10", "new text 10");
+COMMIT;
+SET @commands= 'B T T-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 11", "new text 11");
+COMMIT;
+SET @commands= 'B T-trig T C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 12", "new text 12");
+COMMIT;
+SET @commands= 'B T-trig T-trig C';
+BEGIN;
+COMMIT;
+SET @commands= 'B T-trig T-proc C';
+BEGIN;
+COMMIT;
+SET @commands= 'B T-proc T C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 13", "new text 13");
+COMMIT;
+SET @commands= 'B T-proc T-trig C';
+BEGIN;
+COMMIT;
+SET @commands= 'B T-proc T-proc C';
 BEGIN;
-INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14");
-INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16");
-Warnings:
-Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16");
-ERROR 23000: Duplicate entry '-16' for key 'PRIMARY'
 COMMIT;
 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 tt_1 VALUES ("new text -12", -12, "new text -12")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 7", "new text 7")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 12", "new text 12")
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 13", "new text 13")
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 
 
 
 
 #
-#4) "B T N R" generates in binlog the "B T N R" entries.
+#4.e) Generates in the binlog what follows:
+#       --> STMT  "B T C" entries, format S.
+#       --> ROW   "B T C" entries, format R.
+#       --> MIXED "B T C" entries, format S.
 #
+SET @commands= 'B T Te-begin C';
 BEGIN;
-INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7");
-INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7");
-Warnings:
-Note	1592	Statement may not be safe to log in statement format.
-ROLLBACK;
-Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
+INSERT INTO tt_1(a, c) VALUES ("new text 14", "new text 14");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 14", 14, "new text 14");
+ERROR 23000: Duplicate entry '14' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Te-end C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 15", "new text 15");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Te-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO tt_5(a, b, c) VALUES ("new text 2", 2, "new text 2"), ("new text 1", 1, "new text 1");
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B Te-begin T C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 17", 17, "new text 17");
+ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 18", "new text 18");
+COMMIT;
+SET @commands= 'B Te-end T C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 19", 19, "new text 19"), ("new text 18", 18, "new text 18");
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B Te-trig T C';
+BEGIN;
+INSERT INTO tt_5(a, b, c) VALUES ("new text 2", 2, "new text 2"), ("new text 1", 1, "new text 1");
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 21", "new text 21");
+COMMIT;
 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 tt_1 VALUES ("new text 7", 7, "new text 7")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7")
-master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 15", "new text 15")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=17
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 16", "new text 16")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 18", "new text 18")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=20
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 19", "new text 19")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 21", "new text 21")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 
 
 
 
 #
-#4.e) "B T N R" with error in either T or N generates in binlog the "B T N R" entries.
+#5) Generates in the binlog what follows:
+#     --> STMT  empty.
+#     --> ROW   empty.
+#     --> MIXED empty.
 #
-INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17");
+SET @commands= 'B T T R';
 BEGIN;
-INSERT INTO tt_1 VALUES ("new text -16", -16, "new text -16"), ("new text -17", -17, "new text -17");
-ERROR 23000: Duplicate entry '-17' for key 'PRIMARY'
-INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18");
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, c) VALUES ("new text 23", "new text 23");
 ROLLBACK;
-Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T T-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T T-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-trig T R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-trig T-trig R';
+BEGIN;
+ROLLBACK;
+SET @commands= 'B T-trig T-proc R';
+BEGIN;
+ROLLBACK;
+SET @commands= 'B T-proc T R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B T-proc T-trig R';
+BEGIN;
+ROLLBACK;
+SET @commands= 'B T-proc T-proc R';
 BEGIN;
-INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19");
-INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21");
-Warnings:
-Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21");
-ERROR 23000: Duplicate entry '-21' for key 'PRIMARY'
 ROLLBACK;
-Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
 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 tt_1 VALUES ("new text -17", -17, "new text -17")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18")
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21")
-master-bin.000001	#	Query	#	#	ROLLBACK
 
 
 
 
 #
-#5) "T" generates in binlog the "B T C" entry.
+#5.e) Generates in the binlog what follows:
+#       --> STMT  empty.
+#       --> ROW   empty.
+#       --> MIXED empty.
 #
-INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8");
+SET @commands= 'B T Te-begin R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 28", 28, "new text 28");
+ERROR 23000: Duplicate entry '28' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Te-end R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_1(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Te-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO tt_5(a, b, c) VALUES ("new text 2", 2, "new text 2"), ("new text 1", 1, "new text 1");
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B Te-begin T R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 21", 21, "new text 21");
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B Te-end T R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 22", 22, "new text 22"), ("new text 21", 21, "new text 21");
+ERROR 23000: Duplicate entry '21' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
+SET @commands= 'B Te-trig T R';
+BEGIN;
+INSERT INTO tt_5(a, b, c) VALUES ("new text 2", 2, "new text 2"), ("new text 1", 1, "new text 1");
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+ROLLBACK;
 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 tt_1 VALUES ("new text 8", 8, "new text 8")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 
 
 
 
 #
-#5.e) "T" with error in T generates in binlog an "empty" entry.
+#6) Generates in the binglog what follows:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
 #
-INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1");
-INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -22", -22, "new text -22");
-ERROR 23000: Duplicate entry '-1' for key 'PRIMARY'
-INSERT INTO tt_1 VALUES ("new text -23", -23, "new text -23"), ("new text -1", -1, "new text -1");
-ERROR 23000: Duplicate entry '-1' for key 'PRIMARY'
+SET @commands= 'B N N C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10");
+COMMIT;
+SET @commands= 'B N N-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11");
+INSERT INTO nt_5(a, c) VALUES ("new text 6", "new text 6");
+COMMIT;
+SET @commands= 'B N N-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12");
+CALL pc_i_nt_5_suc ("new text 7");
+COMMIT;
+SET @commands= 'B N-trig N C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 9", "new text 9");
+INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13");
+COMMIT;
+SET @commands= 'B N-trig N-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 10", "new text 10");
+INSERT INTO nt_5(a, c) VALUES ("new text 11", "new text 11");
+COMMIT;
+SET @commands= 'B N-trig N-proc C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 12", "new text 12");
+CALL pc_i_nt_5_suc ("new text 13");
+COMMIT;
+SET @commands= 'B N-proc N C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 15");
+INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14");
+COMMIT;
+SET @commands= 'B N-proc N-trig C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 17");
+INSERT INTO nt_5(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B N-proc N-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 20");
+CALL pc_i_nt_5_suc ("new text 22");
+COMMIT;
 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 tt_1 VALUES ("new text -1", -1, "new text -1")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=6
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 6", "new text 6")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=7
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=17
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=19
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 19", "new text 19")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=20
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=22
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'))
 
 
 
 
 #
-#6) "N" generates in binlog the "N" entry.
+#6.e) Generates in the binglog what follows if a N-Table is changed:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
 #
-INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9");
+SET @commands= 'B N Ne-begin C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 15", "new text 15");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N Ne-end C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 16", "new text 16");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16");
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N Ne-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 18", "new text 18");
+INSERT INTO nt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23");
+ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B Ne-begin N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 18", 18, "new text 18");
+ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 19", "new text 19");
+COMMIT;
+SET @commands= 'B Ne-end N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 20", 20, "new text 20"), ("new text 19", 19, "new text 19");
+ERROR 23000: Duplicate entry '19' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 21", "new text 21");
+COMMIT;
+SET @commands= 'B Ne-trig N C';
+BEGIN;
+INSERT INTO nt_5(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24");
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 22", "new text 22");
+COMMIT;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=6
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 6", "new text 6")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=7
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=9
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 13", "new text 13")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 11", "new text 11")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 12", "new text 12")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 13' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=17
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 17' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=19
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 19", "new text 19")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=20
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 20' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=22
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 22' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 15", "new text 15")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 16", "new text 16")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 18", "new text 18")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=46
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, b, c) VALUES ("new text 24", 24, "new text 24"), ("new text 23", 23, "new text 23")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=19
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 19", "new text 19")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 20", 20, "new text 20"), ("new text 19", 19, "new text 19")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 21", "new text 21")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=48
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=22
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 22", "new text 22")
 
 
 
 
 #
-#6.e) "N" with error in N generates in binlog an empty entry if the error
-# happens in the first tuple. Otherwise, generates the "N" entry and
-# the error is appended.
+#7) Generates in the binlog what follows:
+#      --> STMT  "N N" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S.
 #
-INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
-INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
-ERROR 23000: Duplicate entry '-1' for key 'PRIMARY'
-INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1");
-ERROR 23000: Duplicate entry '-1' for key 'PRIMARY'
+SET @commands= 'B N N R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23");
+INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N N-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25");
+INSERT INTO nt_5(a, c) VALUES ("new text 26", "new text 26");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N N-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26");
+CALL pc_i_nt_5_suc ("new text 27");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 29", "new text 29");
+INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 30", "new text 30");
+INSERT INTO nt_5(a, c) VALUES ("new text 31", "new text 31");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig N-proc R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 32", "new text 32");
+CALL pc_i_nt_5_suc ("new text 33");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 35");
+INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N-trig R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 37");
+INSERT INTO nt_5(a, c) VALUES ("new text 39", "new text 39");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc N-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 40");
+CALL pc_i_nt_5_suc ("new text 42");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=25
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=29
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 29", "new text 29")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=30
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 30", "new text 30")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=31
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 31", "new text 31")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 32", "new text 32")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=33
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=34
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=37
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=38
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=39
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 39", "new text 39")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=41
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=42
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=43
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'))
+
+
+
+
+#
+#7.e) Generates in the binglog what follows if a N-Table is changed:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N Ne-begin R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 29", "new text 29");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N Ne-end R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 30", "new text 30");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 31", 31, "new text 31"), ("new text 30", 30, "new text 30");
+ERROR 23000: Duplicate entry '30' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N Ne-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 32", "new text 32");
+INSERT INTO nt_5(a, b, c) VALUES ("new text 44", 44, "new text 44"), ("new text 43", 43, "new text 43");
+ERROR 23000: Duplicate entry '43' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-begin N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 32", 32, "new text 32");
+ERROR 23000: Duplicate entry '32' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 33", "new text 33");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-end N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) VALUES ("new text 34", 34, "new text 34"), ("new text 33", 33, "new text 33");
+ERROR 23000: Duplicate entry '33' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 35", "new text 35");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Ne-trig N R';
+BEGIN;
+INSERT INTO nt_5(a, b, c) VALUES ("new text 45", 45, "new text 45"), ("new text 44", 44, "new text 44");
+ERROR 23000: Duplicate entry '44' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 36", "new text 36");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 23", "new text 23")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 24", "new text 24")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=25
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 25", "new text 25")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=29
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 29", "new text 29")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 27", "new text 27")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=30
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 30", "new text 30")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=31
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 31", "new text 31")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 32", "new text 32")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=33
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=34
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 33' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 28", "new text 28")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=37
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=38
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 37' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=39
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 39", "new text 39")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=41
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 40' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=42
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=43
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 42' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=29
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 29", "new text 29")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=30
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 30", "new text 30")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 31", 31, "new text 31"), ("new text 30", 30, "new text 30")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 32", "new text 32")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=86
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, b, c) VALUES ("new text 44", 44, "new text 44"), ("new text 43", 43, "new text 43")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=33
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 33", "new text 33")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 34", 34, "new text 34"), ("new text 33", 33, "new text 33")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 35", "new text 35")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=88
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, b, c) VALUES ("new text 45", 45, "new text 45"), ("new text 44", 44, "new text 44")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 36", "new text 36")
+
+
+
+
+#
+#8) Generates in the binlog what follows:
+#       --> STMT  "B T N C" entries, format S.
+#       --> ROW   "N B T C" entries, format R.
+#       --> MIXED "N B T C" entries, format R in N and S in T.
+#
+SET @commands= 'B T N C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22");
+INSERT INTO nt_1(a, c) VALUES ("new text 37", "new text 37");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T N-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 36", "new text 36");
+INSERT INTO nt_5(a, c) VALUES ("new text 46", "new text 46");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T N-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 37", "new text 37");
+CALL pc_i_nt_5_suc ("new text 47");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T-trig N C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 38", "new text 38");
+COMMIT;
+SET @commands= 'B T-trig N-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 49", "new text 49");
+COMMIT;
+SET @commands= 'B T-trig N-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 50");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T-proc N C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 39", "new text 39");
+COMMIT;
+SET @commands= 'B T-proc N-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 52", "new text 52");
+COMMIT;
+SET @commands= 'B T-proc N-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 53");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+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	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 22", "new text 22")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=37
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 37", "new text 37")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 36", "new text 36")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=46
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 46", "new text 46")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=37
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 37", "new text 37")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=47
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 47' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 47' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=48
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 47' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 47' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=38
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 38", "new text 38")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=49
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 49", "new text 49")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=50
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 50' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 50' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=51
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 50' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 50' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=39
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 39", "new text 39")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=52
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 52", "new text 52")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=53
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 53' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 53' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=54
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 53' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 53' COLLATE 'latin1_swedish_ci'))
+
+
+
+
+#
+#8.e) Generates in the binlog what follows if T-* fails:
+#       --> STMT  "N" entry, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#     Otherwise, what follows if N-* fails and a N-Table is changed:
+#       --> STMT  "B T N C" entries, format S.
+#       --> ROW   "N B T C" entries, format R.
+#       --> MIXED "N B T C" entries, format R in N and S in T.
+#
+SET @commands= 'B Te-begin N C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 37", 37, "new text 37");
+ERROR 23000: Duplicate entry '37' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 40", "new text 40");
+COMMIT;
+SET @commands= 'B Te-end N C';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 38", 38, "new text 38"), ("new text 37", 37, "new text 37");
+ERROR 23000: Duplicate entry '37' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 41", "new text 41");
+COMMIT;
+SET @commands= 'B T Ne-begin C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 38", "new text 38");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 41", 41, "new text 41");
+ERROR 23000: Duplicate entry '41' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T Ne-end C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 40", "new text 40");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 42", 42, "new text 42"), ("new text 41", 41, "new text 41");
+ERROR 23000: Duplicate entry '41' for key 'PRIMARY'
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 40", "new text 40")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=41
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=39
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 38", "new text 38")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 40", "new text 40")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 42", 42, "new text 42"), ("new text 41", 41, "new text 41")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#9) Generates in the binlog what follows:
+#     --> STMT  "B T N R" entries, format S.
+#     --> ROW   "N" entry, format R.
+#     --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T N R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, c) VALUES ("new text 43", "new text 43");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T N-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_5(a, c) VALUES ("new text 55", "new text 55");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T N-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+CALL pc_i_nt_5_suc ("new text 56");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 44", "new text 44");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 58", "new text 58");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-trig N-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 59");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 45", "new text 45");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 61", "new text 61");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T-proc N-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 62");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+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	#	Intvar	#	#	INSERT_ID=41
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=43
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 43", "new text 43")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=42
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=55
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 55", "new text 55")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=43
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=56
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 56' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 56' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=57
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 56' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 56' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=44
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 44", "new text 44")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=58
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 58", "new text 58")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=59
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 59' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 59' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=60
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 59' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 59' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=45
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 45", "new text 45")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=61
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 61", "new text 61")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=62
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 62' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 62' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=63
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 62' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 62' COLLATE 'latin1_swedish_ci'))
+
+
+
+
+#
+#9.e) Generates in the binlog what follows if T* fails:
+#       --> STMT  "N" entry, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#     Otherwise, what follows if N* fails and a N-Table is changed:
+#       --> STMT  "B T N R" entries, format S.
+#       --> ROW   "N" entry, format R.
+#       --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Te-begin N R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 40", 40, "new text 40");
+ERROR 23000: Duplicate entry '40' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 46", "new text 46");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B Te-end N R';
+BEGIN;
+INSERT INTO tt_1(a, b, c) VALUES ("new text 41", 41, "new text 41"), ("new text 40", 40, "new text 40");
+ERROR 23000: Duplicate entry '40' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 47", "new text 47");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T Ne-begin R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 47", 47, "new text 47");
+ERROR 23000: Duplicate entry '47' for key 'PRIMARY'
+ROLLBACK;
+SET @commands= 'B T Ne-end R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+INSERT INTO nt_1(a, b, c) VALUES ("new text 48", 48, "new text 48"), ("new text 47", 47, "new text 47");
+ERROR 23000: Duplicate entry '47' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=46
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 46", "new text 46")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=47
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 47", "new text 47")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=45
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) VALUES ("new text 48", 48, "new text 48"), ("new text 47", 47, "new text 47")
+master-bin.000001	#	Query	#	#	ROLLBACK
+
+
+
+
+#
+#10) Generates in the binlog:
+#     --> STMT  "N B T C" entries, format S.
+#     --> ROW   "N B T C" entries, format R.
+#     --> MIXED "N B T C" entries, format S.
+#
+SET @commands= 'B N T C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 49", "new text 49");
+INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41");
+COMMIT;
+SET @commands= 'B N T-trig C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 50", "new text 50");
+COMMIT;
+SET @commands= 'B N T-proc C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 51", "new text 51");
+COMMIT;
+SET @commands= 'B N-trig T C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 64", "new text 64");
+INSERT INTO tt_1(a, c) VALUES ("new text 47", "new text 47");
+COMMIT;
+SET @commands= 'B N-trig T-trig C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 65", "new text 65");
+COMMIT;
+SET @commands= 'B N-trig T-proc C';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 66", "new text 66");
+COMMIT;
+SET @commands= 'B N-proc T C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 67");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 48", "new text 48");
+COMMIT;
+SET @commands= 'B N-proc T-trig C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 69");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B N-proc T-proc C';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 71");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=49
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 49", "new text 49")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=46
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 41", "new text 41")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=50
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 50", "new text 50")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=51
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 51", "new text 51")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=64
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 64", "new text 64")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=47
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 47", "new text 47")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=65
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 65", "new text 65")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=66
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 66", "new text 66")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=67
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 67' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 67' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=68
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 67' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 67' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=48
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 48", "new text 48")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=69
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 69' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 69' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=70
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 69' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 69' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=71
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 71' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 71' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=72
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 71' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 71' COLLATE 'latin1_swedish_ci'))
+
+
+
+
+#
+#10.e) Check 8.e
+#
+
+
+
+
+#
+#11) Generates in the binlog what follows:
+#     --> STMT  "N N" entries, format S.
+#     --> ROW   "N N" entries, format R.
+#     --> MIXED "N N" entries, format S.
+#
+SET @commands= 'B N T R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 52", "new text 52");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N T-proc R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 53", "new text 53");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N T-trig R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 54", "new text 54");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 73", "new text 73");
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T-trig R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 74", "new text 74");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-trig T-proc R';
+BEGIN;
+INSERT INTO nt_5(a, c) VALUES ("new text 75", "new text 75");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 76");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T-proc R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 78");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N-proc T-trig R';
+BEGIN;
+CALL pc_i_nt_5_suc ("new text 80");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=52
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 52", "new text 52")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=49
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=53
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 53", "new text 53")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=54
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 54", "new text 54")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=73
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 73", "new text 73")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=50
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=74
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 74", "new text 74")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=75
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a, c) VALUES ("new text 75", "new text 75")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=76
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 76' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 76' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=77
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 76' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 76' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=51
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 49", "new text 49")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=78
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 78' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 78' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=79
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 78' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 78' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=80
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 80' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 80' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=81
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(a,c) VALUES ( NAME_CONST('y',_latin1'new text 80' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 80' COLLATE 'latin1_swedish_ci'))
+
+
+
+
+#
+#11.e) Check 9.e
+#
+
+
+
+
+#
+#12) "B M T C" generates in the binlog what follows:
+#      --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M T C" entries, format S.
+#      --> ROW   "N B T T C" entries, format R.
+#      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#
+SET @commands= 'B Nt T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 53", "new text 53");
+COMMIT;
+SET @commands= 'B nT T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 55", "new text 55");
+COMMIT;
+SET @commands= 'B NT T C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 57", "new text 57");
+COMMIT;
+SET @commands= 'B NT-trig T C';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 6", "new text 6");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 58", "new text 58");
+COMMIT;
+SET @commands= 'B NT-proc T C';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 7");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 59", "new text 59");
+COMMIT;
+SET @commands= 'B TN T C';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 5", tt_4.a= "new text 5", nt_3.a= "new text 5", nt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 60", "new text 60");
+COMMIT;
+SET @commands= 'B TN-trig T C';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 5", "new text 5");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 61", "new text 61");
+COMMIT;
+SET @commands= 'B TN-proc T C';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 7");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 62", "new text 62");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=55
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=52
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=53
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 53", "new text 53")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=56
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=54
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=55
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 55", "new text 55")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=57
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=56
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 6", nt_4.a= "new text 6", tt_3.a= "new text 6", tt_4.a= "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=57
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 57", "new text 57")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=6
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 6", "new text 6")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=58
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 58", "new text 58")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=7
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=59
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 59", "new text 59")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 5", tt_4.a= "new text 5", nt_3.a= "new text 5", nt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=60
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 60", "new text 60")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=6
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 5", "new text 5")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=61
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 61", "new text 61")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=7
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=8
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 7' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=62
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 62", "new text 62")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#12.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "M B T C" entries if in M only N-Table is changed, format S.
+#        --> STMT  "B M T C" entries, format S.
+#        --> ROW   "N B T T C" entries, format R.
+#        --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#  
+SET @commands= 'B Nte T C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 58, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 57, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '57' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '62' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 63", "new text 63");
+COMMIT;
+SET @commands= 'B nTe T C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 59, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 58, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '58' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 65, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 64, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '64' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 65", "new text 65");
+COMMIT;
+SET @commands= 'B NTe-trig T C';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 67", "new text 67");
+COMMIT;
+SET @commands= 'B TNe-trig T C';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 68", "new text 68");
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 58, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 57, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=64
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 63", "new text 63")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 59, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 58, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=66
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 65", "new text 65")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=67
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 67", "new text 67")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=68
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 68", "new text 68")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#13) "B M T R" generates in the binlog:
+#      --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M T R" entries, format S.
+#      --> ROW   "N" entry, format R.
+#      --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Nt T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 70", "new text 70");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nT T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 72", "new text 72");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT T R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 74", "new text 74");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-trig T R';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 10", "new text 10");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-proc T R';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 11");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN T R';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-trig T R';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-proc T R';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 9");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=60
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=69
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=70
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 70", "new text 70")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=61
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=71
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=72
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 72", "new text 72")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=62
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=73
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 10", nt_4.a= "new text 10", tt_3.a= "new text 10", tt_4.a= "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=74
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 74", "new text 74")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 10", "new text 10")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=75
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 11' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 11' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 11' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 11' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=76
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=77
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=10
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=78
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=11
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 9' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 9' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=12
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 9' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 9' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=79
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+
+
+
+
+#
+#13.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "M B T R" entries if in M only N-Table is changed, format S.
+#        --> STMT  "B M T R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B Nte T R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '62' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nTe T R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 64, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 63, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '63' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NTe-trig T R';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 13", 13, "new text 13"), ("new text 12", 12, "new text 12");
+ERROR 23000: Duplicate entry '12' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TNe-trig T R';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8");
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 63, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 62, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=80
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 64, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 63, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=81
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 13", 13, "new text 13"), ("new text 12", 12, "new text 12")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=82
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 9", 9, "new text 9"), ("new text 8", 8, "new text 8")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=83
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Query	#	#	ROLLBACK
+
+
+
+
+#
+#14) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "B T M C" entries, format S.
+#      --> ROW   "N B T T C" entries, format R.
+#      --> MIXED "N B T T C" entries, format R in N/T and format S in T.
+#
+SET @commands= 'B T Nt C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T nT C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 86", "new text 86");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T NT C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 88", "new text 88");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T NT-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 90", "new text 90");
+INSERT INTO nt_4(a, c) VALUES ("new text 14", "new text 14");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T NT-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 91", "new text 91");
+CALL pc_i_nt_4_suc ("new text 15");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T TN C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 92", "new text 92");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T TN-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 93", "new text 93");
+INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B T TN-proc C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 94", "new text 94");
+CALL pc_i_tt_3_suc ("new text 14");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+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	#	Intvar	#	#	INSERT_ID=84
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 69", "new text 69")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=65
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=85
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=86
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 86", "new text 86")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=66
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=87
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=88
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 88", "new text 88")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=67
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=89
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 14", nt_4.a= "new text 14", tt_3.a= "new text 14", tt_4.a= "new text 14" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=90
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 90", "new text 90")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 14", "new text 14")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=91
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 91", "new text 91")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=16
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 15' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=92
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 92", "new text 92")
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 9", tt_4.a= "new text 9", nt_3.a= "new text 9", nt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=93
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 93", "new text 93")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=13
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 9", "new text 9")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=94
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 94", "new text 94")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=14
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 14' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 14' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=15
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 14' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 14' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#14.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M C" entries, format S.
+#        --> ROW   "N B T C" entry, format R.
+#        --> MIXED "N B T C" entry, format R.
+#
+SET @commands= 'B T Nte C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 95", "new text 95");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 68, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 67, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '67' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 96, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 95, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '95' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T nTe C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 96", "new text 96");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '68' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 98, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 97, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '97' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T NTe-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 98", "new text 98");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16");
+ERROR 23000: Duplicate entry '16' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B T TNe-trig C';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 100", "new text 100");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+COMMIT;
+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	#	Intvar	#	#	INSERT_ID=95
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 95", "new text 95")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 68, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 67, COUNT(*) FROM tt_1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=97
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 96", "new text 96")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 69, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 68, COUNT(*) FROM tt_1
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=99
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 98", "new text 98")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 17", 17, "new text 17"), ("new text 16", 16, "new text 16")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=100
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 100", "new text 100")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#15) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T Nt R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T nT R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_4(a, c) VALUES ("new text 18", "new text 18");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NT-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+CALL pc_i_nt_4_suc ("new text 19");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TN-proc R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+CALL pc_i_tt_3_suc ("new text 16");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+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	#	Intvar	#	#	INSERT_ID=101
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=70
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=102
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=103
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=71
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=104
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=105
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=72
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=106
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 18", nt_4.a= "new text 18", tt_3.a= "new text 18", tt_4.a= "new text 18" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=107
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 18", "new text 18")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=108
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=19
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 19' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 19' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=20
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 19' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 19' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=109
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=110
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=17
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=111
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=18
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 16' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 16' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=19
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 16' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 16' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Query	#	#	ROLLBACK
+
+
+
+
+#
+#15.e) Generates in the binlog what follows if a N-Table is changed:
+#        --> STMT  "B T M R" entries, format S.
+#        --> ROW   "N" entry, format R.
+#        --> MIXED "N" entry, format R.
+#
+SET @commands= 'B T Nte R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 73, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 72, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '72' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 113, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 112, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '112' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T nTe R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 74, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 73, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '73' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 115, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 114, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '114' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T NTe-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 21", 21, "new text 21"), ("new text 20", 20, "new text 20");
+ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B T TNe-trig R';
+BEGIN;
+INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15");
+ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+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	#	Intvar	#	#	INSERT_ID=112
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 73, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 72, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=114
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 74, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 73, COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=116
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 21", 21, "new text 21"), ("new text 20", 20, "new text 20")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=117
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) VALUES ("new text 101", "new text 101")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=40
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 16", 16, "new text 16"), ("new text 15", 15, "new text 15")
+master-bin.000001	#	Query	#	#	ROLLBACK
+
+
+
+
+#
+#16) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N C" entries, format S.
+#      --> ROW   "N N B T C" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N B T C" entries, format R.
+#
+SET @commands= 'B Nt N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 76", "new text 76");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B nT N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 78", "new text 78");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B NT N C';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 80", "new text 80");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B NT-trig N C';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 22", "new text 22");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 81", "new text 81");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B NT-proc N C';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 23");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 82", "new text 82");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B TN N C';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 83", "new text 83");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B TN-trig N C';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 84", "new text 84");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B TN-proc N C';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 21");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 85", "new text 85");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Intvar	#	#	INSERT_ID=75
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=118
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=76
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 76", "new text 76")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=77
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=119
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=78
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 78", "new text 78")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=79
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=120
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 22", nt_4.a= "new text 22", tt_3.a= "new text 22", tt_4.a= "new text 22" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=80
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 80", "new text 80")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=22
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 22", "new text 22")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=81
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 81", "new text 81")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=23
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=82
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 82", "new text 82")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 16", tt_4.a= "new text 16", nt_3.a= "new text 16", nt_4.a= "new text 16" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=83
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 83", "new text 83")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=20
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 16", "new text 16")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=84
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 84", "new text 84")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=21
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 21' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 21' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=22
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 21' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 21' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=85
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 85", "new text 85")
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+
+
+
+
+#
+#16.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N C" entries, format S.
+#      --> ROW   "N N B T C" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N B T C" entries, format R.
+#
+SET @commands= 'B Nte N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 86, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 85, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '85' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 87", "new text 87");
+COMMIT;
+SET @commands= 'B nTe N C';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 88, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 87, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '87' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 89", "new text 89");
+COMMIT;
+SET @commands= 'B NTe-trig N C';
+BEGIN;
+INSERT INTO nt_4(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24");
+ERROR 23000: Duplicate entry '24' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 90", "new text 90");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+SET @commands= 'B TNe-trig N C';
+BEGIN;
+INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22");
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 91", "new text 91");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 86, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 85, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=87
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 87", "new text 87")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 88, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 87, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=89
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 89", "new text 89")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=48
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 25", 25, "new text 25"), ("new text 24", 24, "new text 24")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=90
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 90", "new text 90")
+master-bin.000001	#	Query	#	#	COMMIT
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=48
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=91
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 91", "new text 91")
+master-bin.000001	#	Query	#	#	COMMIT
 
 
 
 
 #
-#7) "M" generates in binglog the "B M C" entries.
+#17) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#    --> STMT  "B M N R" entries, format S.
+#    --> ROW   "N N" entries, format R.
+#    --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#    --> MIXED "N N" entries, format R.
 #
-DELETE FROM nt_1;
-INSERT INTO nt_1 SELECT * FROM tt_1;
+SET @commands= 'B Nt N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 93", "new text 93");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B nT N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO nt_1(a, c) VALUES ("new text 95", "new text 95");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT N R';
+BEGIN;
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-DELETE FROM tt_1;
-INSERT INTO tt_1 SELECT * FROM nt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_3 VALUES ("new text 000", 000, '');
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_3 VALUES("new text 100", 100, f1());
+INSERT INTO nt_1(a, c) VALUES ("new text 97", "new text 97");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO nt_4 VALUES("new text 100", 100, f1());
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-trig N R';
+BEGIN;
+INSERT INTO nt_4(a, c) VALUES ("new text 26", "new text 26");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_3 VALUES("new text 200", 200, f2());
+INSERT INTO nt_1(a, c) VALUES ("new text 98", "new text 98");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO nt_4 VALUES ("new text 300", 300, '');
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B NT-proc N R';
+BEGIN;
+CALL pc_i_nt_4_suc ("new text 27");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO nt_4 VALUES ("new text 400", 400, f1());
+INSERT INTO nt_1(a, c) VALUES ("new text 99", "new text 99");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO nt_4 VALUES ("new text 500", 500, f2());
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN N R';
+BEGIN;
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-CALL pc_i_tt_3(600, "Testing...");
+INSERT INTO nt_1(a, c) VALUES ("new text 100", "new text 100");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-trig N R';
+BEGIN;
+INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 101", "new text 101");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TN-proc N R';
+BEGIN;
+CALL pc_i_tt_3_suc ("new text 23");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 102", "new text 102");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; DELETE FROM nt_1
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 SELECT * FROM tt_1
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; DELETE FROM tt_1
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 SELECT * FROM nt_1
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text 000", 000, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES("new text 100", 100, f1())
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES("new text 100", 100, f1())
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES("new text 200", 200, f2())
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text 300", 300, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text 400", 400, f1())
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=92
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text 500", 500, f2())
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ( NAME_CONST('y',_latin1'Testing...' COLLATE 'latin1_swedish_ci'), NAME_CONST('x',600), NAME_CONST('x',600))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=122
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=93
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 93", "new text 93")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=94
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=123
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=95
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 95", "new text 95")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=96
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=124
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 26", nt_4.a= "new text 26", tt_3.a= "new text 26", tt_4.a= "new text 26" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=97
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 97", "new text 97")
+master-bin.000001	#	Query	#	#	ROLLBACK
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-
-
-
-
-#
-#7.e) "M" with error in M generates in binglog the "B M R" entries.
-#
-INSERT INTO nt_3 VALUES ("new text -26", -26, '');
-SELECT * FROM tt_3;
-a	b	c
-new text 000	0	
-new text 4	100	Testing...
-new text 200	200	Testing...
-Testing...	600	600
-INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
-ERROR 23000: Duplicate entry '-26' for key 'PRIMARY'
-SELECT * FROM tt_3;
-a	b	c
-new text 000	0	
-new text 4	100	Testing...
-new text 200	200	Testing...
-Testing...	600	600
-INSERT INTO tt_4 VALUES ("new text -26", -26, '');
-SELECT * FROM nt_4;
-a	b	c
-new text 4	100	Testing...
-new text 300	300	
-new text 400	400	Testing...
-new text 500	500	Testing...
-INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
-ERROR 23000: Duplicate entry '-26' for key 'PRIMARY'
-SELECT * FROM nt_4;
-a	b	c
-new text 4	100	Testing...
-new text 300	300	
-new text 400	400	Testing...
-new text 500	500	Testing...
-new text -25	-25	
-show binlog events from <binlog_start>;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_3 VALUES ("new text -26", -26, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 26", "new text 26")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=98
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 98", "new text 98")
+master-bin.000001	#	Query	#	#	ROLLBACK
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 27' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=99
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 99", "new text 99")
 master-bin.000001	#	Query	#	#	ROLLBACK
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_4 VALUES ("new text -26", -26, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=100
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 100", "new text 100")
+master-bin.000001	#	Query	#	#	ROLLBACK
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=24
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=101
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 101", "new text 101")
 master-bin.000001	#	Query	#	#	ROLLBACK
-
-
-
-
-#
-#8) "B N N T C" generates in binglog the "N N B T C" entries.
-#
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10");
-INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10");
-INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10");
-COMMIT;
-show binlog events from <binlog_start>;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-
-
-
-
-#
-#8.e) "B N N T R" See 6.e and 9.e.
-#
+master-bin.000001	#	Intvar	#	#	INSERT_ID=25
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=26
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 23' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=102
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 102", "new text 102")
+master-bin.000001	#	Query	#	#	ROLLBACK
 
 
 
 
 #
-#9) "B N N T R" generates in binlog the "N N B T R" entries.
-#
-BEGIN;
-INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11");
-INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11");
-INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11");
+#17.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "M N" entries if in M only N-Table is changed, format S.
+#      --> STMT  "B M N R" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "M N" entries if in M only N-Table is changed, format S.
+#      --> MIXED "N N" entries, format R.
+#
+SET @commands= 'B Nte N R';
+BEGIN;
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 103, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 102, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '102' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 104", "new text 104");
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
-show binlog events from <binlog_start>;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11")
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11")
-master-bin.000001	#	Query	#	#	ROLLBACK
-
-
-
-
-#
-#9.e) "B N N T R" with error in N generates in binlog the "N N B T R" entries.
-#
+SET @commands= 'B nTe N R';
 BEGIN;
-INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25");
-INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25");
-INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25");
-ERROR 23000: Duplicate entry '-25' for key 'PRIMARY'
-INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 105, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 104, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '104' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 106", "new text 106");
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
-show binlog events from <binlog_start>;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25")
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27")
-master-bin.000001	#	Query	#	#	ROLLBACK
-
-
-
-
-#
-#10) "B N N C" generates in binglog the "N N" entries.
-#
+SET @commands= 'B NTe-trig N R';
 BEGIN;
-INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12");
-INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12");
-COMMIT;
-show binlog events from <binlog_start>;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12")
-
-
-
-
-#
-#10.e) "B N N C" See 6.e and 9.e.
-#
-
-
-
-
-#
-#11) "B N N R" generates in binlog the "N N" entries.
-#
+INSERT INTO nt_4(a, b, c) VALUES ("new text 29", 29, "new text 29"), ("new text 28", 28, "new text 28");
+ERROR 23000: Duplicate entry '28' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 107", "new text 107");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B TNe-trig N R';
 BEGIN;
-INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13");
-INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22");
+ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
+INSERT INTO nt_1(a, c) VALUES ("new text 108", "new text 108");
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13")
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13")
-
-
-
-
-#
-#11.e) "B N N R" See 6.e and 9.e.
-#
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 103, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 102, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=104
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 104", "new text 104")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 105, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 104, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=106
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 106", "new text 106")
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=56
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 29", 29, "new text 29"), ("new text 28", 28, "new text 28")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=107
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 107", "new text 107")
+master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=56
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 23", 23, "new text 23"), ("new text 22", 22, "new text 22")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=108
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 108", "new text 108")
+master-bin.000001	#	Query	#	#	ROLLBACK
 
 
 
 
 #
-#12) "B M T C" generates in the binlog the "B M T C" entries.
+#18) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#    --> STMT  "N B M C" entries, format S.
+#    --> ROW   "N N B T C" entries, format R.
+#    --> MIXED "N N B T C" entries, format S in first N and format R in the other.
 #
-DELETE FROM nt_1;
+SET @commands= 'B N Nt C';
 BEGIN;
-INSERT INTO nt_1 SELECT * FROM tt_1;
+INSERT INTO nt_1(a, c) VALUES ("new text 109", "new text 109");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14");
-COMMIT;
-DELETE FROM tt_1;
-BEGIN;
-INSERT INTO tt_1 SELECT * FROM nt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15");
-COMMIT;
-BEGIN;
-INSERT INTO tt_3 VALUES ("new text 700", 700, '');
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 800", 800, '');
 COMMIT;
+SET @commands= 'B N nT C';
 BEGIN;
-INSERT INTO tt_3 VALUES("new text 900", 900, f1());
+INSERT INTO nt_1(a, c) VALUES ("new text 111", "new text 111");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 1000", 1000, '');
-COMMIT;
-BEGIN;
-INSERT INTO tt_3 VALUES(1100, 1100, f2());
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 1200", 1200, '');
-COMMIT;
-BEGIN;
-INSERT INTO nt_4 VALUES ("new text 1300", 1300, '');
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 1400", 1400, '');
 COMMIT;
+SET @commands= 'B N NT C';
 BEGIN;
-INSERT INTO nt_4 VALUES("new text 1500", 1500, f1());
+INSERT INTO nt_1(a, c) VALUES ("new text 113", "new text 113");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 1600", 1600, '');
-COMMIT;
-BEGIN;
-INSERT INTO nt_4 VALUES("new text 1700", 1700, f2());
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 1800", 1800, '');
 COMMIT;
+SET @commands= 'B N NT-trig C';
 BEGIN;
-CALL pc_i_tt_3(1900, "Testing...");
+INSERT INTO nt_1(a, c) VALUES ("new text 115", "new text 115");
+INSERT INTO nt_4(a, c) VALUES ("new text 30", "new text 30");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2000", 2000, '');
 COMMIT;
+SET @commands= 'B N NT-proc C';
 BEGIN;
-UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 116", "new text 116");
+CALL pc_i_nt_4_suc ("new text 31");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2100", 2100, '');
 COMMIT;
+SET @commands= 'B N TN C';
 BEGIN;
-UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 117", "new text 117");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2200", 2200, '');
 COMMIT;
+SET @commands= 'B N TN-trig C';
 BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 118", "new text 118");
+INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2300", 2300, '');
 COMMIT;
+SET @commands= 'B N TN-proc C';
 BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 119", "new text 119");
+CALL pc_i_tt_3_suc ("new text 28");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2400", 2400, '');
 COMMIT;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; DELETE FROM nt_1
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 SELECT * FROM tt_1
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; DELETE FROM tt_1
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 SELECT * FROM nt_1
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15")
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text 700", 700, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 800", 800, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES("new text 900", 900, f1())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 1000", 1000, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES(1100, 1100, f2())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 1200", 1200, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=109
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 109", "new text 109")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=110
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text 1300", 1300, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 1400", 1400, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=125
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=111
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 111", "new text 111")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=112
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES("new text 1500", 1500, f1())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 1600", 1600, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=126
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=113
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 113", "new text 113")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=114
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES("new text 1700", 1700, f2())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 1800", 1800, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=127
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 30", nt_4.a= "new text 30", tt_3.a= "new text 30", tt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=115
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 115", "new text 115")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ( NAME_CONST('y',_latin1'Testing...' COLLATE 'latin1_swedish_ci'), NAME_CONST('x',1900), NAME_CONST('x',1900))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2000", 2000, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=30
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 30", "new text 30")
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=116
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 116", "new text 116")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2100", 2100, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=31
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 31' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 31' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 31' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 31' COLLATE 'latin1_swedish_ci'))
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=117
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 117", "new text 117")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2200", 2200, '')
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 23", tt_4.a= "new text 23", nt_3.a= "new text 23", nt_4.a= "new text 23" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=118
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 118", "new text 118")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2300", 2300, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=27
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 23", "new text 23")
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=119
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 119", "new text 119")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2400", 2400, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=28
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 28' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 28' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=29
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 28' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 28' COLLATE 'latin1_swedish_ci'))
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 
 
 
 
 #
-#12.e) "B M T C" with error in M generates in the binlog the "B M T C" entries.
-#  
-# There is a bug in the slave that needs to be fixed before enabling
-# this part of the test. A bug report will be filed referencing this
-# test case.
+#18.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#      --> STMT  "N B M C" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nte C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 120", "new text 120");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '120' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N nTe C';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 122", "new text 122");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 123, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 122, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '122' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+COMMIT;
+SET @commands= 'B N NTe-trig C';
 BEGIN;
-INSERT INTO nt_3 VALUES ("new text -28", -28, '');
-INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
-ERROR 23000: Duplicate entry '-28' for key 'PRIMARY'
-INSERT INTO tt_1 VALUES ("new text -27", -27, '');
+INSERT INTO nt_1(a, c) VALUES ("new text 124", "new text 124");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 33", 33, "new text 33"), ("new text 32", 32, "new text 32");
+ERROR 23000: Duplicate entry '32' for key 'PRIMARY'
 COMMIT;
+SET @commands= 'B N TNe-trig C';
 BEGIN;
-INSERT INTO tt_4 VALUES ("new text -28", -28, '');
-INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
-ERROR 23000: Duplicate entry '-28' for key 'PRIMARY'
-INSERT INTO tt_1 VALUES ("new text -28", -28, '');
+INSERT INTO nt_1(a, c) VALUES ("new text 125", "new text 125");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
 COMMIT;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_3 VALUES ("new text -28", -28, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=120
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 120", "new text 120")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 121, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 120, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=122
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 122", "new text 122")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 123, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 122, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=124
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 124", "new text 124")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -27", -27, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=64
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 33", 33, "new text 33"), ("new text 32", 32, "new text 32")
+master-bin.000001	#	Query	#	#	COMMIT
+master-bin.000001	#	Intvar	#	#	INSERT_ID=125
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 125", "new text 125")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_4 VALUES ("new text -28", -28, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -28", -28, '')
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Intvar	#	#	INSERT_ID=64
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29")
+master-bin.000001	#	Query	#	#	COMMIT
 
 
 
 
 #
-#13) "B M T R" generates in the binlog the "B M T R" entries
+#19) Generates in the binlog what follows if a N-Table is changed:
+#    --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#    --> STMT  "N B M R" entries, format S.
+#    --> ROW   "N N" entries, format R.
+#    --> MIXED "N N" entries, format S in first N and format R in the other.
 #
-DELETE FROM nt_1;
-BEGIN;
-INSERT INTO nt_1 SELECT * FROM tt_1;
-Warnings:
-Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17");
-ROLLBACK;
-Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
-DELETE FROM tt_1;
+SET @commands= 'B N Nt R';
 BEGIN;
-INSERT INTO tt_1 SELECT * FROM nt_1;
+INSERT INTO nt_1(a, c) VALUES ("new text 126", "new text 126");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_2 VALUES ("new text 18", 18, "new text 18");
-ROLLBACK;
-INSERT INTO tt_1 SELECT * FROM nt_1;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-BEGIN;
-INSERT INTO tt_3 VALUES ("new text 2500", 2500, '');
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2600", 2600, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N nT R';
 BEGIN;
-INSERT INTO tt_3 VALUES("new text 2700", 2700, f1());
+INSERT INTO nt_1(a, c) VALUES ("new text 128", "new text 128");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 2800", 2800, '');
-ROLLBACK;
-Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tt_3 VALUES(2900, 2900, f2());
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3000", 3000, '');
-ROLLBACK;
-Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO nt_4 VALUES ("new text 3100", 3100, '');
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3200", 3200, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT R';
 BEGIN;
-INSERT INTO nt_4 VALUES("new text 3300", 3300, f1());
+INSERT INTO nt_1(a, c) VALUES ("new text 130", "new text 130");
+INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3400", 3400, '');
-ROLLBACK;
+INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1;
 Warnings:
-Warning	1196	Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO nt_4 VALUES("new text 3500", 3500, f2());
+Note	1592	Statement may not be safe to log in statement format.
+UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3600", 3600, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT-trig R';
 BEGIN;
-CALL pc_i_tt_3(3700, "Testing...");
+INSERT INTO nt_1(a, c) VALUES ("new text 132", "new text 132");
+INSERT INTO nt_4(a, c) VALUES ("new text 34", "new text 34");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3700", 3700, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NT-proc R';
 BEGIN;
-UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 133", "new text 133");
+CALL pc_i_nt_4_suc ("new text 35");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3800", 3800, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN R';
 BEGIN;
-UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 134", "new text 134");
+UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 30", tt_4.a= "new text 30", nt_3.a= "new text 30", nt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1;
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 3900", 3900, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN-trig R';
 BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 135", "new text 135");
+INSERT INTO tt_3(a, c) VALUES ("new text 30", "new text 30");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 4000", 4000, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TN-proc R';
 BEGIN;
-UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
+INSERT INTO nt_1(a, c) VALUES ("new text 136", "new text 136");
+CALL pc_i_tt_3_suc ("new text 30");
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
-INSERT INTO tt_1 VALUES ("new text 4100", 4100, '');
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; DELETE FROM nt_1
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1 SELECT * FROM tt_1
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17")
-master-bin.000001	#	Query	#	#	ROLLBACK
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; DELETE FROM tt_1
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 SELECT * FROM nt_1
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text 2500", 2500, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2600", 2600, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=126
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 126", "new text 126")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=127
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=129
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Query	#	#	ROLLBACK
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES("new text 2700", 2700, f1())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 2800", 2800, '')
-master-bin.000001	#	Query	#	#	ROLLBACK
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES(2900, 2900, f2())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3000", 3000, '')
-master-bin.000001	#	Query	#	#	ROLLBACK
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text 3100", 3100, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3200", 3200, '')
-master-bin.000001	#	Query	#	#	ROLLBACK
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES("new text 3300", 3300, f1())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3400", 3400, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=128
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 128", "new text 128")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=129
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=130
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Query	#	#	ROLLBACK
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES("new text 3500", 3500, f2())
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3600", 3600, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=130
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 130", "new text 130")
+master-bin.000001	#	Intvar	#	#	INSERT_ID=131
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) SELECT COUNT(*), COUNT(*) FROM tt_1
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Intvar	#	#	INSERT_ID=131
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(a, c) SELECT COUNT(*), COUNT(*) FROM nt_1
+master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 34", nt_4.a= "new text 34", tt_3.a= "new text 34", tt_4.a= "new text 34" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=132
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 132", "new text 132")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ( NAME_CONST('y',_latin1'Testing...' COLLATE 'latin1_swedish_ci'), NAME_CONST('x',3700), NAME_CONST('x',3700))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3700", 3700, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=34
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, c) VALUES ("new text 34", "new text 34")
 master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=133
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 133", "new text 133")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3800", 3800, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=35
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=36
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a,c) VALUES ( NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 35' COLLATE 'latin1_swedish_ci'))
 master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=134
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 134", "new text 134")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 3900", 3900, '')
+master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 30", tt_4.a= "new text 30", nt_3.a= "new text 30", nt_4.a= "new text 30" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 1
 master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=135
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 135", "new text 135")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 4000", 4000, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=31
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, c) VALUES ("new text 30", "new text 30")
 master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=136
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 136", "new text 136")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text 4100", 4100, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=32
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 30' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 30' COLLATE 'latin1_swedish_ci'))
+master-bin.000001	#	Intvar	#	#	INSERT_ID=33
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a,c) VALUES ( NAME_CONST('y',_latin1'new text 30' COLLATE 'latin1_swedish_ci'),  NAME_CONST('y',_latin1'new text 30' COLLATE 'latin1_swedish_ci'))
 master-bin.000001	#	Query	#	#	ROLLBACK
 
 
 
 
 #
-#13.e) "B M T R" with error in M generates in the binlog the "B M T R" entries.
-#
+#19.e) Generates in the binlog what follows if a N-Table is changed:
+#      --> STMT  "N M" entries if in M only N-Table is changed, format S.
+#      --> STMT  "N B M R" entries, format S.
+#      --> ROW   "N N" entries, format R.
+#      --> MIXED "N N" entries, format S in first N and format R in the other.
+#
+SET @commands= 'B N Nte R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 137", "new text 137");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 138, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 137, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '137' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N nTe R';
+BEGIN;
+INSERT INTO nt_1(a, c) VALUES ("new text 139", "new text 139");
+INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 140, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 139, COUNT(*) FROM tt_1;
+ERROR 23000: Duplicate entry '139' for key 'PRIMARY'
+INSERT INTO tt_1(a, b, c) SELECT COUNT(*), 128, COUNT(*) FROM nt_1 UNION SELECT COUNT(*), 127, COUNT(*) FROM nt_1;
+ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N NTe-trig R';
 BEGIN;
-INSERT INTO nt_3 VALUES ("new text -30", -30, '');
-INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
-ERROR 23000: Duplicate entry '-30' for key 'PRIMARY'
-INSERT INTO tt_1 VALUES ("new text -30", -30, '');
+INSERT INTO nt_1(a, c) VALUES ("new text 141", "new text 141");
+INSERT INTO nt_4(a, b, c) VALUES ("new text 37", 37, "new text 37"), ("new text 36", 36, "new text 36");
+ERROR 23000: Duplicate entry '36' for key 'PRIMARY'
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SET @commands= 'B N TNe-trig R';
 BEGIN;
-INSERT INTO tt_4 VALUES ("new text -30", -30, '');
-INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
-ERROR 23000: Duplicate entry '-30' for key 'PRIMARY'
-INSERT INTO tt_1 VALUES ("new text -31", -31, '');
+INSERT INTO nt_1(a, c) VALUES ("new text 142", "new text 142");
+INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29");
+ERROR 23000: Duplicate entry '29' for key 'PRIMARY'
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_3 VALUES ("new text -30", -30, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=137
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 137", "new text 137")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 138, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 137, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=139
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 139", "new text 139")
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, b, c) SELECT COUNT(*), 140, COUNT(*) FROM tt_1 UNION SELECT COUNT(*), 139, COUNT(*) FROM tt_1
+master-bin.000001	#	Intvar	#	#	INSERT_ID=141
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 141", "new text 141")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -30", -30, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=72
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4(a, b, c) VALUES ("new text 37", 37, "new text 37"), ("new text 36", 36, "new text 36")
 master-bin.000001	#	Query	#	#	ROLLBACK
+master-bin.000001	#	Intvar	#	#	INSERT_ID=142
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(a, c) VALUES ("new text 142", "new text 142")
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_4 VALUES ("new text -30", -30, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, '')
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1 VALUES ("new text -31", -31, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=72
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3(a, b, c) VALUES ("new text 30", 30, "new text 30"), ("new text 29", 29, "new text 29")
 master-bin.000001	#	Query	#	#	ROLLBACK
 ###################################################################################
+#                               2 - SAVEPOINT
+###################################################################################
+BEGIN;
+INSERT INTO tt_3 VALUES ("new text -34", -35, '');
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_4 VALUES ("new text -35", -35, '');
+SAVEPOINT sv;
+INSERT INTO nt_3 VALUES ("new text -36", -36, '');
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+INSERT INTO tt_3 VALUES ("new text -37", -37, '');
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROLLBACK TO sv;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+COMMIT;
+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	#	Intvar	#	#	INSERT_ID=74
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text -34", -35, '')
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_4 VALUES ("new text -35", -35, '')
+master-bin.000001	#	Query	#	#	use `test`; SAVEPOINT sv
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_3 VALUES ("new text -36", -36, '')
+master-bin.000001	#	Intvar	#	#	INSERT_ID=76
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_3 VALUES ("new text -37", -37, '')
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK TO sv
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+###################################################################################
+#                 3 - CREATE TABLE...SELECT and CREATE TABLE...LIKE
+###################################################################################
+CREATE TABLE tt_xx10 engine=Innodb SELECT * FROM tt_2;
+DROP TABLE tt_xx10;
+CREATE TABLE nt_xx11 engine=MyIsam SELECT * FROM tt_2;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+DROP TABLE nt_xx11;
+CREATE TABLE nt_xx12 LIKE tt_2;
+DROP TABLE nt_xx12;
+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`; CREATE TABLE tt_xx10 engine=Innodb SELECT * FROM tt_2
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE tt_xx10
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE nt_xx11 engine=MyIsam SELECT * FROM tt_2
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE nt_xx11
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE nt_xx12 LIKE tt_2
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE nt_xx12
+###################################################################################
 #                                        CLEAN
 ###################################################################################
+SET @commands= 'clean';
 DROP TABLE tt_1;
 DROP TABLE tt_2;
 DROP TABLE tt_3;
 DROP TABLE tt_4;
+DROP TABLE tt_5;
+DROP TABLE tt_6;
 DROP TABLE nt_1;
 DROP TABLE nt_2;
 DROP TABLE nt_3;
 DROP TABLE nt_4;
-DROP PROCEDURE pc_i_tt_3;
-DROP FUNCTION f1;
-DROP FUNCTION f2;
+DROP TABLE nt_5;
+DROP TABLE nt_6;
+DROP PROCEDURE pc_i_tt_3_suc;
+DROP PROCEDURE pc_i_nt_4_suc;
+DROP PROCEDURE pc_i_tt_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+SET @commands='';

=== added file 'mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test'
--- a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test	2009-09-13 16:12:48 +0000
@@ -0,0 +1,9 @@
+###################################################################################
+# This test cases evaluates the mixture of non-transactional and transcational
+# tables. For further details, please, read WL#2687 and WL#5072.
+###################################################################################
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+--source extra/rpl_tests/rpl_mixing_engines.test

=== added file 'mysql-test/suite/rpl/t/rpl_row_mixing_engines.test'
--- a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test	2009-09-13 16:12:48 +0000
@@ -0,0 +1,10 @@
+###################################################################################
+# This test cases evaluates the mixture of non-transactional and transcational
+# tables. For further details, please, read WL#2687 and WL#5072.
+###################################################################################
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+--source extra/rpl_tests/rpl_mixing_engines.test
+

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test	2009-08-26 23:13:03 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test	2009-09-13 16:12:48 +0000
@@ -1,3 +1,7 @@
+###################################################################################
+# This test cases evaluates the mixture of non-transactional and transcational
+# tables. For further details, please, read WL#2687 and WL#5072.
+###################################################################################
 --source include/have_binlog_format_statement.inc
 --source include/master-slave.inc
 --source include/have_innodb.inc


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687 WL#5072Alfranio Correia13 Sep
Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Sven Sandberg16 Sep
  • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Alfranio Correia17 Sep
  • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Alfranio Correia20 Sep
    • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Sven Sandberg21 Sep
      • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Alfranio Correia21 Sep
        • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Sven Sandberg23 Sep
          • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Alfranio Correia25 Sep
            • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Alfranio Correia28 Sep
              • Re: bzr commit into mysql-pe branch (alfranio.correia:3514) WL#2687WL#5072Sven Sandberg28 Sep