List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:May 18 2011 5:12pm
Subject:bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3487) WL#5569
WL#5754
View as plain text  
#At file:///home/andrei/MySQL/BZR/2a-23May/MERGE/mysql-trunk-wl5569/ based on revid:dmitry.shulga@stripped

 3487 Andrei Elkin	2011-05-18 [merge]
      wl#5569 MTS
      wl#5754 Query event parallel applying
      
      Patch #2 contains changes that are beyond sql/ dir.
      Mostly tests/results.
      
      This is the full patch also containing refactoring C-W interfaces to make strict correspondence
      of the execution context to the executing actor should it be Coordinator or Worker.

    added:
      mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test
      mysql-test/extra/rpl_tests/rpl_parallel_load.test
      mysql-test/include/not_mts_slave_parallel_workers.inc
      mysql-test/include/not_worker_info_table.inc
      mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS
      mysql-test/suite/rpl/r/rpl_mixed_parallel_crash_safe.result
      mysql-test/suite/rpl/r/rpl_parallel.result
      mysql-test/suite/rpl/r/rpl_parallel_benchmark.result
      mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result
      mysql-test/suite/rpl/r/rpl_parallel_conflicts.result
      mysql-test/suite/rpl/r/rpl_parallel_ddl.result
      mysql-test/suite/rpl/r/rpl_parallel_fallback.result
      mysql-test/suite/rpl/r/rpl_parallel_multi_db.result
      mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
      mysql-test/suite/rpl/r/rpl_parallel_temp_query.result
      mysql-test/suite/rpl/r/rpl_row_parallel_crash_safe.result
      mysql-test/suite/rpl/r/rpl_sequential.result
      mysql-test/suite/rpl/r/rpl_stm_parallel_crash_safe.result
      mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt.THIS
      mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS
      mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe.test
      mysql-test/suite/rpl/t/rpl_parallel-master.opt
      mysql-test/suite/rpl/t/rpl_parallel-slave.opt
      mysql-test/suite/rpl/t/rpl_parallel.test
      mysql-test/suite/rpl/t/rpl_parallel_benchmark-master.opt
      mysql-test/suite/rpl/t/rpl_parallel_benchmark-slave.opt
      mysql-test/suite/rpl/t/rpl_parallel_benchmark.test
      mysql-test/suite/rpl/t/rpl_parallel_conf_limits-slave.opt
      mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test
      mysql-test/suite/rpl/t/rpl_parallel_conflicts-slave.opt
      mysql-test/suite/rpl/t/rpl_parallel_conflicts.test
      mysql-test/suite/rpl/t/rpl_parallel_ddl.test
      mysql-test/suite/rpl/t/rpl_parallel_fallback.test
      mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt
      mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt
      mysql-test/suite/rpl/t/rpl_parallel_multi_db.test
      mysql-test/suite/rpl/t/rpl_parallel_start_stop-slave.opt
      mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
      mysql-test/suite/rpl/t/rpl_parallel_temp_query.test
      mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe.test
      mysql-test/suite/rpl/t/rpl_sequential-master.opt
      mysql-test/suite/rpl/t/rpl_sequential-slave.opt
      mysql-test/suite/rpl/t/rpl_sequential.test
      mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe.test
      mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result
      mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result
      mysql-test/suite/sys_vars/r/worker_info_repository_basic.result
      mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test
      mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test
      mysql-test/suite/sys_vars/t/worker_info_repository_basic.test
    modified:
      .bzr-mysql/default.conf
      client/mysqldump.c
      include/my_pthread.h
      mysql-test/extra/rpl_tests/rpl_crash_safe.inc
      mysql-test/extra/rpl_tests/rpl_mixing_engines.inc
      mysql-test/r/1st.result
      mysql-test/r/connect.result
      mysql-test/r/information_schema.result
      mysql-test/r/log_tables_upgrade.result
      mysql-test/r/mysql_upgrade.result
      mysql-test/r/mysql_upgrade_ssl.result
      mysql-test/r/mysqlcheck.result
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/r/plugin_auth.result
      mysql-test/r/system_mysql_db.result
      mysql-test/suite/funcs_1/r/is_columns_mysql.result
      mysql-test/suite/funcs_1/r/is_key_column_usage.result
      mysql-test/suite/funcs_1/r/is_statistics.result
      mysql-test/suite/funcs_1/r/is_statistics_mysql.result
      mysql-test/suite/funcs_1/r/is_table_constraints.result
      mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
      mysql-test/suite/funcs_1/r/is_tables_mysql.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_packet.result
      mysql-test/suite/rpl/r/rpl_row_crash_safe.result
      mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
      mysql-test/suite/rpl/t/rpl_migration_crash_safe.test
      mysql-test/suite/rpl/t/rpl_packet.test
      mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_row_crash_safe.test
      mysql-test/suite/rpl/t/rpl_row_until.test
      mysql-test/suite/rpl/t/rpl_server_id2.test
      mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt
      mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test
      mysql-test/suite/rpl/t/rpl_stm_until.test
      mysql-test/suite/rpl/t/rpl_temporary_errors.test
      mysql-test/suite/sys_vars/r/all_vars.result
      mysql-test/t/system_mysql_db_fix40123.test
      mysql-test/t/system_mysql_db_fix50030.test
      mysql-test/t/system_mysql_db_fix50117.test
      scripts/mysql_install_db.pl.in
      scripts/mysql_install_db.sh
      scripts/mysql_system_tables.sql
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf	2011-01-08 15:07:32 +0000
+++ b/.bzr-mysql/default.conf	2011-01-11 23:01:02 +0000
@@ -1,4 +1,4 @@
 [MYSQL]
 post_commit_to = "commits@stripped"
 post_push_to = "commits@stripped"
-tree_name = "mysql-trunk"
+tree_name = "mysql-next-mr-wl5569"

=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2010-12-07 12:11:26 +0000
+++ b/client/mysqldump.c	2010-12-27 18:54:41 +0000
@@ -914,7 +914,9 @@ static int get_options(int *argc, char *
       my_hash_insert(&ignore_table,
                      (uchar*) my_strdup("mysql.slave_master_info", MYF(MY_WME))) ||
       my_hash_insert(&ignore_table,
-                     (uchar*) my_strdup("mysql.slave_relay_log_info", MYF(MY_WME))))
+                     (uchar*) my_strdup("mysql.slave_relay_log_info", MYF(MY_WME))) ||
+      my_hash_insert(&ignore_table,
+                     (uchar*) my_strdup("mysql.slave_worker_info", MYF(MY_WME))))
     return(EX_EOM);
 
   if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))

=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h	2011-01-11 09:09:21 +0000
+++ b/include/my_pthread.h	2011-01-11 23:01:02 +0000
@@ -128,6 +128,8 @@ struct timespec {
   ((TS1.tv.i64 > TS2.tv.i64) ? 1 : \
    ((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0))
 
+#define diff_timespec(TS1, TS2) \
+  (TS1.tv.i64 - TS2.tv.i64)
 
 int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
 int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
@@ -457,6 +459,20 @@ int my_pthread_mutex_trylock(pthread_mut
 #endif /* !cmp_timespec */
 #endif /* HAVE_TIMESPEC_TS_SEC */
 
+#ifdef HAVE_TIMESPEC_TS_SEC
+#ifndef diff_timespec
+#define diff_timespec(TS1, TS2) \
+  (((TS1.ts_sec * 1000000000) + TS1.ts_nsec) - \
+   ((TS2.ts_sec * 1000000000) + TS2.ts_nsec))
+#endif /* !diff_timespec */
+#else
+#ifndef diff_timespec
+#define diff_timespec(TS1, TS2) \
+  (((TS1.tv_sec * 1000000000) + TS1.tv_nsec) - \
+   ((TS2.tv_sec * 1000000000) + TS2.tv_nsec))
+#endif /* !diff_timespec */
+#endif /* HAVE_TIMESPEC_TS_SEC */
+
 	/* safe_mutex adds checking to mutex for easier debugging */
 
 typedef struct st_safe_mutex_t

=== modified file 'mysql-test/extra/rpl_tests/rpl_crash_safe.inc'
--- a/mysql-test/extra/rpl_tests/rpl_crash_safe.inc	2010-12-20 14:27:17 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_crash_safe.inc	2010-12-27 18:54:41 +0000
@@ -11,8 +11,6 @@ if (`SELECT HEX(@commands) = HEX('config
 {
   --sync_slave_with_master
   SHOW CREATE TABLE mysql.slave_relay_log_info;
-  ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
-  SHOW CREATE TABLE mysql.slave_relay_log_info;
 
   connection master;
   --source extra/rpl_tests/rpl_mixing_engines.inc
@@ -103,11 +101,11 @@ if (`SELECT HEX(@commands) != HEX('')`)
   connection master;
   sync_slave_with_master;
   --let $slave_after= `SELECT master_log_pos FROM mysql.slave_relay_log_info`
-  connection master;
-  if ($slave_after != $master_after)
+  if (`SELECT $slave_after != $master_after && @@GLOBAL.mts_slave_parallel_workers = 0`)
   {
     --echo Slave is out of sync.
     --echo MASTER_BEFORE $master_before MASTER_AFTER $master_after SLAVE_BEFORE $slave_before SLAVE_AFTER $slave_after
+    connection slave;
     --source include/show_rpl_debug_info.inc
     --die
   }

=== modified file 'mysql-test/extra/rpl_tests/rpl_mixing_engines.inc'
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc	2010-09-24 11:34:21 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc	2010-12-22 19:19:17 +0000
@@ -9,7 +9,6 @@ if (`SELECT HEX(@commands) = HEX('config
 {
   connection master;
 
-  SET SQL_LOG_BIN=0;
   eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
   eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
   eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -22,26 +21,6 @@ if (`SELECT HEX(@commands) = HEX('config
   eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
   eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
   eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  eval SET SQL_LOG_BIN=1;
-
-  connection slave;
-
-  SET SQL_LOG_BIN=0;
-  eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-  eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-  eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-  eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-  eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-  eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-  eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type;
-  SET SQL_LOG_BIN=1;
-
-  connection master;
 
   INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
   INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);

=== added file 'mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test'
--- a/mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_parallel_benchmark_load.test	2011-05-06 18:33:32 +0000
@@ -0,0 +1,303 @@
+#
+# This is a load generator to call from rpl_parallel and rpl_sequential tests
+#
+
+#
+# load volume parameter
+#
+
+let $iter= 16;
+let $tables= 4;
+let $wk_i_queries= 4;
+let $wk_m_queries= 0;
+let $nk_i_queries= 0;
+let $nk_m_queries= 0;
+let $pre_inserted_rows= 200;
+
+connection slave;
+
+call mtr.add_suppression('Slave: Error dropping database'); ## todo: fix
+
+source include/stop_slave.inc;
+start slave;
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+use test;
+delimiter |;
+create procedure one_session(k int)
+begin
+  while k > 0 do
+    insert into tm_nk values(k, 0);
+    insert into tm_wk values(null, 0);
+    insert into ti_nk values(k, 0);
+    insert into ti_wk values(null, 0);
+    set k = k - 1;
+  end while;
+end|
+delimiter ;|
+
+## let $i = $workers + 1;
+##eval 
+# delimiter |;
+# create procedure p1(i int)
+# begin
+#     while i > 0
+#       ##while ($i)
+#       ##{
+#       ## let $i1=$i;
+#       ## dec $i1;
+#       ## use test$i1;
+#       ## call on_session();
+#       ## dec $i;
+#       ##}
+#       use test0;
+#       call one_session();
+#       use test1;
+#       call one_session();
+#       use test2;
+#       call one_session();
+#       use test3;
+#       call one_session();
+#       i= i-1;
+#     end while;
+# end|
+# delimiter ;|
+
+
+let $i = $databases;
+while($i)
+{
+  eval create database test$i;
+
+  let $m= $tables;
+  while ($m)
+  {
+  eval create table test$i.tm_nk_$m (a int, b int, c text) engine=myisam;
+  eval create table test$i.tm_wk_$m (a int auto_increment primary key, b int, c text) engine=myisam;
+  eval create table test$i.ti_nk_$m (a int, b int, c text) engine=innodb;
+  eval create table test$i.ti_wk_$m (a int auto_increment primary key, b int, c text) engine=innodb;
+  let $k= $pre_inserted_rows;
+  while ($k)
+  {
+   eval insert into test$i.ti_wk_$m values(null,  $i, uuid());
+   eval insert into test$i.ti_nk_$m values(null,  $i, uuid());
+   eval insert into test$i.tm_wk_$m values(null,  $i, uuid());
+   eval insert into test$i.tm_nk_$m values(null,  $i, uuid());
+
+   dec $k;
+  }
+  dec $m;
+  }
+
+
+  # this table is special - just for timing. It's more special on test1 db
+  # where it contains master timing of the load as well.
+  eval create table test$i.benchmark (state text) engine=myisam; # timestamp keep on the slave side
+
+  dec $i;
+}
+
+--enable_result_log
+--enable_query_log
+
+
+sync_slave_with_master;
+#connection slave;
+
+--disable_query_log
+--disable_result_log
+
+let $i = $databases;
+while($i)
+{
+  eval alter table test$i.benchmark add ts timestamp not null default current_timestamp;
+
+  dec $i;
+}
+--enable_result_log
+--enable_query_log
+
+
+# not gather events into relay log w/o executing yet
+stop slave sql_thread;
+
+##call p1(1);
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+#
+# Load producer
+#
+
+# initial timestamp to record
+
+# the extra ts col on slave is effective only with the STMT format (todo: bug-report)
+set @save.binlog_format= @@session.binlog_format;
+set @@session.binlog_format=STATEMENT;
+let $i = $databases;
+while($i)
+{
+  eval insert into test$i.benchmark set state='slave takes on load';
+
+  dec $i;
+}
+set @@session.binlog_format= @save.binlog_format;
+
+connection slave;
+
+insert into test1.benchmark set state='master started load';
+
+
+connection master;
+
+while ($iter)
+{
+    let $i = $databases;
+
+    while ($i)
+    {
+
+	begin;
+   	   ###eval insert into tm_nk values($iter, $i1, repeat('a', round(rand()*10)));
+
+    	   let $q= $wk_m_queries;
+	   while ($q)
+	   {
+	       let $m= `select 1 + floor(rand() * $tables)`;
+	       eval update      test$i.tm_wk_$m set c= uuid();
+	       eval insert into test$i.tm_wk_$m values(null,  $i, uuid());
+
+	       dec $q;
+	   }
+
+    	   let $q= $wk_i_queries;
+	   while ($q)
+	   {
+	       let $m= `select 1 + floor(rand() * $tables)`;
+	       eval update      test$i.ti_wk_$m set c= uuid();
+	       
+	       eval insert into test$i.ti_wk_$m values(null,  $i, uuid());
+
+	       dec $q;
+	   }
+            
+	   # NK
+
+    	   let $q= $nk_m_queries;
+	   while ($q)
+	   {
+	       let $m= `select 1 + floor(rand() * $tables)`;
+	       eval update test$i.tm_nk_$m set c= uuid();
+	       eval insert into test$i.tm_nk_$m values(null,  $i, uuid());
+
+	       dec $q;
+	   }
+
+    	   let $q= $nk_i_queries;
+	   while ($q)
+	   {
+	       let $m= `select 1 + floor(rand() * $tables)`;
+	       eval update test$i.ti_nk_$m set c= uuid();
+	       eval insert into test$i.ti_nk_$m values(null,  $i, uuid());
+
+	       dec $q;
+	   }
+	commit;
+
+	dec $i;
+    }
+
+    dec $iter;
+}
+
+connection slave;
+
+##use test1;
+insert into test1.benchmark set state='master ends load';
+
+connection master;
+
+# terminal timestamp to record
+
+let $i = $databases;
+set @save.binlog_format= @@session.binlog_format;
+set @@session.binlog_format=STATEMENT;
+while($i)
+{
+  eval insert into test$i.benchmark set state='slave ends load';
+
+  dec $i;
+}
+set @@session.binlog_format= @save.binlog_format;
+
+--enable_result_log
+--enable_query_log
+
+connection slave;
+
+## todo: record start and end time of appying to compare times of
+#  parallel and sequential execution.
+
+--disable_query_log
+--disable_result_log
+
+insert into test1.benchmark set state='slave is processing load';
+
+# To force filling timestamp cols with the slave local clock values
+# to implement benchmarking.
+
+set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
+set @@global.mts_exp_slave_local_timestamp=1;
+
+--sleep 1
+
+start slave sql_thread;
+
+let $wait_timeout= 600;
+let $wait_condition= SELECT count(*)+sleep(1) = 5 FROM test1.benchmark;
+source include/wait_condition.inc;
+
+use test;
+select * from test1.benchmark into outfile 'benchmark.out';
+select ts from test1.benchmark where state like 'master started load' into @m_0;
+select ts from test1.benchmark where state like 'master ends load' into @m_1;
+select ts from test1.benchmark where state like 'slave takes on load' into @s_0;
+select ts from test1.benchmark where state like 'slave ends load' into @s_1;
+select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m', 
+       time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s' into outfile 'delta.out';
+
+--enable_result_log
+--enable_query_log
+
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+let $i = $databases;
+while($i)
+{
+  eval drop database test$i;
+
+  dec $i;
+}
+
+use test;
+drop procedure one_session;
+
+--enable_result_log
+--enable_query_log
+
+sync_slave_with_master;
+#connection slave;
+set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
+
+# End of the tests

=== added file 'mysql-test/extra/rpl_tests/rpl_parallel_load.test'
--- a/mysql-test/extra/rpl_tests/rpl_parallel_load.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_parallel_load.test	2011-05-06 18:33:32 +0000
@@ -0,0 +1,312 @@
+#
+# This is a load generator to call from rpl_parallel and rpl_sequential tests
+
+#
+#
+# load volume parameter
+#
+
+let $iter = 50;
+
+# windows run on PB2 is too slow to time out
+disable_query_log;
+if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE"`)
+{
+  let $iter = 100;
+}
+enable_query_log;
+
+let $databases = 16;
+
+connection slave;
+
+call mtr.add_suppression('Slave: Error dropping database'); ## todo: fix
+
+source include/stop_slave.inc;
+start slave;
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+use test;
+delimiter |;
+create procedure one_session(k int)
+begin
+  while k > 0 do
+    insert into tm_nk values(k, 0);
+    insert into tm_wk values(null, 0);
+    insert into ti_nk values(k, 0);
+    insert into ti_wk values(null, 0);
+    set k = k - 1;
+  end while;
+end|
+delimiter ;|
+
+## let $i = $workers + 1;
+##eval 
+# delimiter |;
+# create procedure p1(i int)
+# begin
+#     while i > 0
+#       ##while ($i)
+#       ##{
+#       ## let $i1=$i;
+#       ## dec $i1;
+#       ## use test$i1;
+#       ## call on_session();
+#       ## dec $i;
+#       ##}
+#       use test0;
+#       call one_session();
+#       use test1;
+#       call one_session();
+#       use test2;
+#       call one_session();
+#       use test3;
+#       call one_session();
+#       i= i-1;
+#     end while;
+# end|
+# delimiter ;|
+
+
+let $i = $databases + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+  
+  eval create database test$i1;
+  eval use test$i1;
+  create table tm_nk (a int, b int, c text) engine=myisam;
+  create table tm_wk (a int auto_increment primary key, b int, c text) engine=myisam;
+  create table ti_nk (a int, b int, c text) engine=innodb;
+  create table ti_wk (a int auto_increment primary key, b int, c text) engine=innodb;
+  
+  if (`select @@global.binlog_format like 'statement'`)
+  {
+     create view v_tm_nk as select a,b from tm_nk;
+     create view v_tm_wk as select a,b from tm_wk;
+     create view v_ti_nk as select a,b from ti_nk;
+     create view v_ti_wk as select a,b from ti_wk;
+  }
+  
+  if (`select @@global.binlog_format not like 'statement'`)
+  {
+     create view v_tm_nk as select a,b,c from tm_nk;
+     create view v_tm_wk as select a,b,c from tm_wk;
+     create view v_ti_nk as select a,b,c from ti_nk;
+     create view v_ti_wk as select a,b,c from ti_wk;
+  }
+
+  # this table is special - just for timing. It's more special on test0 db
+  # where it contains master timing of the load as well.
+  create table benchmark (state text) engine=myisam; # timestamp keep on the slave side
+
+  dec $i;
+}
+
+--enable_result_log
+--enable_query_log
+
+
+sync_slave_with_master;
+#connection slave;
+
+--disable_query_log
+--disable_result_log
+
+let $i = $databases + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+  eval use test$i1;
+  alter table benchmark add ts timestamp not null default current_timestamp;
+
+  dec $i;
+}
+--enable_result_log
+--enable_query_log
+
+
+# not gather events into relay log w/o executing yet
+stop slave sql_thread;
+
+##call p1(1);
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+#
+# Load producer
+#
+
+# initial timestamp to record
+
+# the extra ts col on slave is effective only with the STMT format (todo: bug-report)
+set @save.binlog_format= @@session.binlog_format;
+set @@session.binlog_format=STATEMENT;
+let $i = $databases + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+  eval use test$i1;
+
+  insert into benchmark set state='slave takes on load';
+
+  dec $i;
+}
+set @@session.binlog_format= @save.binlog_format;
+
+connection slave;
+
+use test0;
+insert into benchmark set state='master started load';
+
+
+connection master;
+
+while ($iter)
+{
+    let $i = $databases + 1;
+
+    while ($i)
+    {
+	let $i1 = $i;
+	dec $i1;
+
+	eval use test$i1;
+	##call test.one_session(1);
+	eval insert into tm_nk values($iter, $i1, uuid());
+	eval insert into tm_wk values(null,  $i1, uuid());
+	eval insert into ti_nk values($iter, $i1, uuid());
+	eval insert into ti_wk values(null,  $i1, uuid());
+
+	begin;
+  	eval insert into tm_nk values($iter, $i1, repeat('a', round(rand()*10)));
+	eval insert into tm_wk values(null,  $i1, uuid());
+	commit;
+	begin;
+	eval insert into ti_nk values($iter, $i1, uuid());
+	eval insert into ti_wk values(null,  $i1, repeat('a', round(rand()*10)));
+	commit;
+	dec $i;
+    }
+
+    dec $iter;
+}
+
+connection slave;
+
+use test0;
+insert into benchmark set state='master ends load';
+
+connection master;
+
+# terminal timestamp to record
+
+let $i = $databases + 1;
+set @save.binlog_format= @@session.binlog_format;
+set @@session.binlog_format=STATEMENT;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+  eval use test$i1;
+
+  insert into benchmark set state='slave ends load';
+
+  dec $i;
+}
+set @@session.binlog_format= @save.binlog_format;
+
+--enable_result_log
+--enable_query_log
+
+connection slave;
+
+## todo: record start and end time of appying to compare times of
+#  parallel and sequential execution.
+
+--disable_query_log
+--disable_result_log
+
+insert into test0.benchmark set state='slave is processing load';
+
+# To force filling timestamp cols with the slave local clock values
+# to implement benchmarking.
+
+set @save.mts_exp_slave_local_timestamp=@@global.mts_exp_slave_local_timestamp;
+set @@global.mts_exp_slave_local_timestamp=1;
+start slave sql_thread;
+
+let $wait_timeout= 600;
+let $wait_condition= SELECT count(*)+sleep(1) = 5 FROM test0.benchmark;
+source include/wait_condition.inc;
+
+use test;
+select * from test0.benchmark into outfile 'benchmark.out';
+select ts from test0.benchmark where state like 'master started load' into @m_0;
+select ts from test0.benchmark where state like 'master ends load' into @m_1;
+select ts from test0.benchmark where state like 'slave takes on load' into @s_0;
+select ts from test0.benchmark where state like 'slave ends load' into @s_1;
+select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m', 
+       time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s' into outfile 'delta.out';
+
+
+let $i = $databases + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+
+  let $diff_tables=master:test$i1.v_tm_nk, slave:test$i1.v_tm_nk;
+  source include/diff_tables.inc;
+
+  let $diff_tables=master:test$i1.v_ti_nk, slave:test$i1.v_ti_nk;
+  source include/diff_tables.inc;
+
+  let $diff_tables=master:test$i1.v_tm_wk, slave:test$i1.v_tm_wk;
+  source include/diff_tables.inc;
+
+  let $diff_tables=master:test$i1.v_ti_wk, slave:test$i1.v_ti_wk;
+  source include/diff_tables.inc;
+
+  dec $i;
+}
+--enable_result_log
+--enable_query_log
+
+
+connection master;
+
+--disable_query_log
+--disable_result_log
+
+let $i = $databases + 1;
+while($i)
+{
+  let $i1 = $i;
+  dec $i1;
+
+  eval drop database test$i1;
+  dec $i;
+}
+
+use test;
+drop procedure one_session;
+
+--enable_result_log
+--enable_query_log
+
+sync_slave_with_master;
+#connection slave;
+set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
+
+# End of the tests

=== added file 'mysql-test/include/not_mts_slave_parallel_workers.inc'
--- a/mysql-test/include/not_mts_slave_parallel_workers.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/not_mts_slave_parallel_workers.inc	2010-12-22 15:01:47 +0000
@@ -0,0 +1,4 @@
+if (`SELECT @@GLOBAL.mts_slave_parallel_workers != 0`)
+{
+     skip Test cannot run with MTS;
+}

=== added file 'mysql-test/include/not_worker_info_table.inc'
--- a/mysql-test/include/not_worker_info_table.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/not_worker_info_table.inc	2010-12-09 13:23:19 +0000
@@ -0,0 +1,4 @@
+if (`SELECT @@GLOBAL.worker_info_repository = 'TABLE'`)
+{
+     skip Test cannot run with worker.info repository table;
+}

=== modified file 'mysql-test/r/1st.result'
--- a/mysql-test/r/1st.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/1st.result	2010-12-27 18:54:41 +0000
@@ -25,6 +25,7 @@ proxies_priv
 servers
 slave_master_info
 slave_relay_log_info
+slave_worker_info
 slow_log
 tables_priv
 time_zone

=== modified file 'mysql-test/r/connect.result'
--- a/mysql-test/r/connect.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/connect.result	2010-12-27 18:54:41 +0000
@@ -19,6 +19,7 @@ proxies_priv
 servers
 slave_master_info
 slave_relay_log_info
+slave_worker_info
 slow_log
 tables_priv
 time_zone
@@ -55,6 +56,7 @@ proxies_priv
 servers
 slave_master_info
 slave_relay_log_info
+slave_worker_info
 slow_log
 tables_priv
 time_zone
@@ -99,6 +101,7 @@ proxies_priv
 servers
 slave_master_info
 slave_relay_log_info
+slave_worker_info
 slow_log
 tables_priv
 time_zone

=== modified file 'mysql-test/r/information_schema.result'
--- a/mysql-test/r/information_schema.result	2010-12-17 18:43:38 +0000
+++ b/mysql-test/r/information_schema.result	2010-12-27 18:54:41 +0000
@@ -92,6 +92,7 @@ proxies_priv
 servers
 slave_master_info
 slave_relay_log_info
+slave_worker_info
 slow_log
 tables_priv
 time_zone
@@ -878,7 +879,7 @@ AND table_name not like 'ndb%' AND table
 GROUP BY TABLE_SCHEMA;
 table_schema	count(*)
 information_schema	30
-mysql	25
+mysql	26
 create table t1 (i int, j int);
 create trigger trg1 before insert on t1 for each row
 begin

=== modified file 'mysql-test/r/log_tables_upgrade.result'
--- a/mysql-test/r/log_tables_upgrade.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/log_tables_upgrade.result	2010-12-27 18:54:41 +0000
@@ -32,6 +32,7 @@ mysql.renamed_general_log               
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK

=== modified file 'mysql-test/r/mysql_upgrade.result'
--- a/mysql-test/r/mysql_upgrade.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/mysql_upgrade.result	2010-12-27 18:54:41 +0000
@@ -19,6 +19,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK
@@ -50,6 +51,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK
@@ -81,6 +83,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK
@@ -114,6 +117,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK
@@ -151,6 +155,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK
@@ -191,6 +196,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK

=== modified file 'mysql-test/r/mysql_upgrade_ssl.result'
--- a/mysql-test/r/mysql_upgrade_ssl.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/mysql_upgrade_ssl.result	2010-12-27 18:54:41 +0000
@@ -21,6 +21,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK

=== modified file 'mysql-test/r/mysqlcheck.result'
--- a/mysql-test/r/mysqlcheck.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/mysqlcheck.result	2010-12-27 18:54:41 +0000
@@ -22,6 +22,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log
 note     : The storage engine for the table doesn't support analyze
 mysql.tables_priv                                  OK
@@ -52,6 +53,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log
 note     : The storage engine for the table doesn't support optimize
 mysql.tables_priv                                  OK
@@ -80,6 +82,7 @@ mysql.proxies_priv                      
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log
 note     : The storage engine for the table doesn't support analyze
 mysql.tables_priv                                  OK
@@ -108,6 +111,7 @@ mysql.proxies_priv                      
 mysql.servers                                      Table is already up to date
 mysql.slave_master_info                            Table is already up to date
 mysql.slave_relay_log_info                         Table is already up to date
+mysql.slave_worker_info                            Table is already up to date
 mysql.slow_log
 note     : The storage engine for the table doesn't support optimize
 mysql.tables_priv                                  Table is already up to date

=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	2011-01-03 14:50:58 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2011-02-27 17:35:25 +0000
@@ -276,6 +276,8 @@ The following options may be given as th
  If set to 1 table names are stored in lowercase on disk
  and table names will be case-insensitive.  Should be set
  to 2 if you are using a case insensitive file system
+ --master-info-engine=name 
+ The storage engine for the master info repository
  --master-info-file=name 
  The location and name of the file that remembers the
  master and where the I/O replication thread is in the
@@ -345,6 +347,41 @@ The following options may be given as th
  --min-examined-row-limit=# 
  Don't write queries to slow log that examine fewer rows
  than that
+ --mts-checkpoint-group=# 
+ Define the number of transactions before a checkpoint
+ operation is called.
+ --mts-checkpoint-period=# 
+ Gather workers' activities to flush the relay log info to
+ disk after every #th milli-seconds. The zero value
+ disables the checkpoint routine (makes sense for
+ debugging).
+ --mts-coordinator-basic-nap=# 
+ Time in msec to sleep by MTS Coordinator to avoid the
+ Worker queues room overrun
+ --mts-exp-slave-local-timestamp 
+ If enabled slave itself computes the event appying time
+ value to implicitly affected timestamp columms. Otherwise
+ (default) it installs prescribed by the master value
+ --mts-partition-hash-soft-max=# 
+ Number of records in the mts partition hash below which
+ entries with zero usage are tolerated
+ --mts-pending-jobs-size-max=# 
+ Max size of Slave Worker queues holding yet not applied
+ events.The least possible value must be not less than the
+ master size max_allowed_packet.
+ --mts-slave-parallel-workers=# 
+ Number of worker threads for executing events in parallel
+ --mts-slave-worker-queue-len-max=# 
+ Max length of one MTS Worker queue. Presence in the queue
+ indicates a replication event was read out of Relay log
+ and not yet applied. Notice the max size of event data in
+ all queues are governed by mts_pending_jobs_size_max.
+ Whichever limit is reached Coordinator threadsuspends
+ further jobs assigning until conditions have been
+ improved.
+ --mts-worker-underrun-level=# 
+ percent of Worker queue size at which Worker is
+ considered to become hungry
  --multi-range-count=# 
  Number of key ranges to request at once
  --myisam-block-size=# 
@@ -509,6 +546,8 @@ The following options may be given as th
  --relay-log=name    The location and name to use for relay logs
  --relay-log-index=name 
  File that holds the names for relay log files.
+ --relay-log-info-engine=name 
+ The storage engine for the relay info repository
  --relay-log-info-file=name 
  The location and name of the file that remembers where
  the SQL replication thread is in the relay logs
@@ -743,6 +782,11 @@ The following options may be given as th
  -V, --version       Output version information and exit.
  --wait-timeout=#    The number of seconds the server waits for activity on a
  connection before closing it
+ --worker-info-engine=name 
+ The storage engine for the worker info repository
+ --worker-info-repository=name 
+ Defines the type of the repository for the worker
+ information.
 
 Variables (--variable-name=value)
 abort-slave-event-count 0
@@ -832,6 +876,7 @@ log-warnings 1
 long-query-time 10
 low-priority-updates FALSE
 lower-case-table-names 1
+master-info-engine (No default value)
 master-info-file master.info
 master-info-repository FILE
 master-retry-count 86400
@@ -858,6 +903,15 @@ max-user-connections 0
 max-write-lock-count 18446744073709551615
 memlock FALSE
 min-examined-row-limit 0
+mts-checkpoint-group 512
+mts-checkpoint-period 300
+mts-coordinator-basic-nap 5
+mts-exp-slave-local-timestamp FALSE
+mts-partition-hash-soft-max 16
+mts-pending-jobs-size-max 16777216
+mts-slave-parallel-workers 0
+mts-slave-worker-queue-len-max 40000
+mts-worker-underrun-level 0
 multi-range-count 256
 myisam-block-size 1024
 myisam-data-pointer-size 6
@@ -917,6 +971,7 @@ read-only FALSE
 read-rnd-buffer-size 262144
 relay-log (No default value)
 relay-log-index (No default value)
+relay-log-info-engine (No default value)
 relay-log-info-file relay-log.info
 relay-log-info-repository FILE
 relay-log-purge TRUE
@@ -972,6 +1027,8 @@ transaction-prealloc-size 4096
 updatable-views-with-limit YES
 verbose TRUE
 wait-timeout 28800
+worker-info-engine (No default value)
+worker-info-repository FILE
 
 To see what values a running MySQL server is using, type
 'mysqladmin variables' instead of 'mysqld --verbose --help'.

=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	2011-01-03 14:50:58 +0000
+++ b/mysql-test/r/mysqld--help-win.result	2011-01-11 23:01:02 +0000
@@ -275,6 +275,8 @@ The following options may be given as th
  If set to 1 table names are stored in lowercase on disk
  and table names will be case-insensitive.  Should be set
  to 2 if you are using a case insensitive file system
+ --master-info-engine=name 
+ The storage engine for the master info repository
  --master-info-file=name 
  The location and name of the file that remembers the
  master and where the I/O replication thread is in the
@@ -344,6 +346,44 @@ The following options may be given as th
  --min-examined-row-limit=# 
  Don't write queries to slow log that examine fewer rows
  than that
+ --mts-checkpoint-group=# 
+ Define the number of transactions before a checkpoint
+ operation is called.
+ --mts-checkpoint-period=# 
+ Gather workers' activities to flush the relay log info to
+ disk after every #th milli-seconds. The zero value
+ disables the checkpoint routine (makes sense for
+ debugging).
+ --mts-coordinator-basic-nap=# 
+ Time in msec to sleep by MTS Coordinator to avoid the
+ Worker queues room overrun
+ --mts-exp-slave-local-timestamp 
+ If enabled slave itself computes the event appying time
+ value to implicitly affected timestamp columms. Otherwise
+ (default) it installs prescribed by the master value
+ --mts-exp-slave-run-query-in-parallel 
+ The default not an actual database name is used as
+ partition info for parallel execution of Query_log_event 
+ --mts-partition-hash-soft-max=# 
+ Number of records in the mts partition hash below which
+ entries with zero usage are tolerated
+ --mts-pending-jobs-size-max=# 
+ Max size of Slave Worker queues holding yet not applied
+ events.The least possible value must be not less than the
+ master size max_allowed_packet.
+ --mts-slave-parallel-workers=# 
+ Number of worker threads for executing events in parallel
+ --mts-slave-worker-queue-len-max=# 
+ Max length of one MTS Worker queue. Presence in the queue
+ indicates a replication event was read out of Relay log
+ and not yet applied. Notice the max size of event data in
+ all queues are governed by mts_pending_jobs_size_max.
+ Whichever limit is reached Coordinator threadsuspends
+ further jobs assigning until conditions have been
+ improved.
+ --mts-worker-underrun-level=# 
+ percent of Worker queue size at which Worker is
+ considered to become hungry
  --multi-range-count=# 
  Number of key ranges to request at once
  --myisam-block-size=# 
@@ -509,6 +549,8 @@ The following options may be given as th
  --relay-log=name    The location and name to use for relay logs
  --relay-log-index=name 
  File that holds the names for relay log files.
+ --relay-log-info-engine=name 
+ The storage engine for the relay info repository
  --relay-log-info-file=name 
  The location and name of the file that remembers where
  the SQL replication thread is in the relay logs
@@ -747,6 +789,11 @@ The following options may be given as th
  -V, --version       Output version information and exit.
  --wait-timeout=#    The number of seconds the server waits for activity on a
  connection before closing it
+ --worker-info-engine=name 
+ The storage engine for the worker info repository
+ --worker-info-repository=name 
+ Defines the type of the repository for the worker
+ information.
 
 Variables (--variable-name=value)
 abort-slave-event-count 0
@@ -835,6 +882,7 @@ log-warnings 1
 long-query-time 10
 low-priority-updates FALSE
 lower-case-table-names 1
+master-info-engine (No default value)
 master-info-file master.info
 master-info-repository FILE
 master-retry-count 86400
@@ -861,6 +909,16 @@ max-user-connections 0
 max-write-lock-count 18446744073709551615
 memlock FALSE
 min-examined-row-limit 0
+mts-checkpoint-group 512
+mts-checkpoint-period 300
+mts-coordinator-basic-nap 5
+mts-exp-slave-local-timestamp FALSE
+mts-exp-slave-run-query-in-parallel FALSE
+mts-partition-hash-soft-max 16
+mts-pending-jobs-size-max 16777216
+mts-slave-parallel-workers 0
+mts-slave-worker-queue-len-max 40000
+mts-worker-underrun-level 0
 multi-range-count 256
 myisam-block-size 1024
 myisam-data-pointer-size 6
@@ -921,6 +979,7 @@ read-only FALSE
 read-rnd-buffer-size 262144
 relay-log (No default value)
 relay-log-index (No default value)
+relay-log-info-engine (No default value)
 relay-log-info-file relay-log.info
 relay-log-info-repository FILE
 relay-log-purge TRUE
@@ -978,6 +1037,8 @@ transaction-prealloc-size 4096
 updatable-views-with-limit YES
 verbose TRUE
 wait-timeout 28800
+worker-info-engine (No default value)
+worker-info-repository FILE
 
 To see what values a running MySQL server is using, type
 'mysqladmin variables' instead of 'mysqld --verbose --help'.

=== modified file 'mysql-test/r/plugin_auth.result'
--- a/mysql-test/r/plugin_auth.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/plugin_auth.result	2010-12-27 18:54:41 +0000
@@ -305,6 +305,7 @@ mysql.procs_priv                        
 mysql.servers                                      OK
 mysql.slave_master_info                            OK
 mysql.slave_relay_log_info                         OK
+mysql.slave_worker_info                            OK
 mysql.slow_log                                     OK
 mysql.tables_priv                                  OK
 mysql.time_zone                                    OK

=== modified file 'mysql-test/r/system_mysql_db.result'
--- a/mysql-test/r/system_mysql_db.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/r/system_mysql_db.result	2010-12-27 18:54:41 +0000
@@ -18,6 +18,7 @@ proxies_priv
 servers
 slave_master_info
 slave_relay_log_info
+slave_worker_info
 slow_log
 tables_priv
 time_zone

=== modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result	2010-12-27 18:54:41 +0000
@@ -175,9 +175,23 @@ def	mysql	slave_relay_log_info	Master_id
 def	mysql	slave_relay_log_info	Master_log_name	5	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
 def	mysql	slave_relay_log_info	Master_log_pos	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	mysql	slave_relay_log_info	Number_of_lines	2	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	mysql	slave_relay_log_info	Number_of_workers	8	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	mysql	slave_relay_log_info	Relay_log_name	3	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
 def	mysql	slave_relay_log_info	Relay_log_pos	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	mysql	slave_relay_log_info	Sql_delay	7	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_group_bitmap	13	NULL	NO	blob	65535	65535	NULL	NULL	NULL	NULL	blob			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_group_size	12	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_master_log_name	9	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_master_log_pos	10	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_relay_log_name	7	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_relay_log_pos	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	slave_worker_info	Checkpoint_seqno	11	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	mysql	slave_worker_info	Master_id	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned	PRI		select,insert,update,references	
+def	mysql	slave_worker_info	Master_log_name	5	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
+def	mysql	slave_worker_info	Master_log_pos	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	slave_worker_info	Relay_log_name	3	NULL	NO	text	65535	65535	NULL	NULL	utf8	utf8_bin	text			select,insert,update,references	
+def	mysql	slave_worker_info	Relay_log_pos	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	slave_worker_info	Worker_id	2	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned	PRI		select,insert,update,references	
 def	mysql	slow_log	db	7	NULL	NO	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
 def	mysql	slow_log	insert_id	9	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	mysql	slow_log	last_insert_id	8	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
@@ -500,6 +514,20 @@ NULL	mysql	slave_relay_log_info	Relay_lo
 1.0000	mysql	slave_relay_log_info	Master_log_name	text	65535	65535	utf8	utf8_bin	text
 NULL	mysql	slave_relay_log_info	Master_log_pos	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 NULL	mysql	slave_relay_log_info	Sql_delay	int	NULL	NULL	NULL	NULL	int(11)
+NULL	mysql	slave_relay_log_info	Number_of_workers	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	slave_worker_info	Master_id	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	slave_worker_info	Worker_id	int	NULL	NULL	NULL	NULL	int(10) unsigned
+1.0000	mysql	slave_worker_info	Relay_log_name	text	65535	65535	utf8	utf8_bin	text
+NULL	mysql	slave_worker_info	Relay_log_pos	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+1.0000	mysql	slave_worker_info	Master_log_name	text	65535	65535	utf8	utf8_bin	text
+NULL	mysql	slave_worker_info	Master_log_pos	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+1.0000	mysql	slave_worker_info	Checkpoint_relay_log_name	text	65535	65535	utf8	utf8_bin	text
+NULL	mysql	slave_worker_info	Checkpoint_relay_log_pos	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+1.0000	mysql	slave_worker_info	Checkpoint_master_log_name	text	65535	65535	utf8	utf8_bin	text
+NULL	mysql	slave_worker_info	Checkpoint_master_log_pos	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	slave_worker_info	Checkpoint_seqno	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	slave_worker_info	Checkpoint_group_size	int	NULL	NULL	NULL	NULL	int(10) unsigned
+1.0000	mysql	slave_worker_info	Checkpoint_group_bitmap	blob	65535	65535	NULL	NULL	blob
 NULL	mysql	slow_log	start_time	timestamp	NULL	NULL	NULL	NULL	timestamp
 1.0000	mysql	slow_log	user_host	mediumtext	16777215	16777215	utf8	utf8_general_ci	mediumtext
 NULL	mysql	slow_log	query_time	time	NULL	NULL	NULL	NULL	time

=== modified file 'mysql-test/suite/funcs_1/r/is_key_column_usage.result'
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result	2010-12-27 18:54:41 +0000
@@ -113,6 +113,8 @@ def	mysql	PRIMARY	def	mysql	proxies_priv
 def	mysql	PRIMARY	def	mysql	servers	Server_name
 def	mysql	PRIMARY	def	mysql	slave_master_info	Master_id
 def	mysql	PRIMARY	def	mysql	slave_relay_log_info	Master_id
+def	mysql	PRIMARY	def	mysql	slave_worker_info	Master_id
+def	mysql	PRIMARY	def	mysql	slave_worker_info	Worker_id
 def	mysql	PRIMARY	def	mysql	tables_priv	Host
 def	mysql	PRIMARY	def	mysql	tables_priv	Db
 def	mysql	PRIMARY	def	mysql	tables_priv	User

=== modified file 'mysql-test/suite/funcs_1/r/is_statistics.result'
--- a/mysql-test/suite/funcs_1/r/is_statistics.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result	2010-12-27 18:54:41 +0000
@@ -126,6 +126,8 @@ def	mysql	proxies_priv	mysql	Grantor
 def	mysql	servers	mysql	PRIMARY
 def	mysql	slave_master_info	mysql	PRIMARY
 def	mysql	slave_relay_log_info	mysql	PRIMARY
+def	mysql	slave_worker_info	mysql	PRIMARY
+def	mysql	slave_worker_info	mysql	PRIMARY
 def	mysql	tables_priv	mysql	PRIMARY
 def	mysql	tables_priv	mysql	PRIMARY
 def	mysql	tables_priv	mysql	PRIMARY

=== modified file 'mysql-test/suite/funcs_1/r/is_statistics_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result	2010-12-27 18:54:41 +0000
@@ -48,6 +48,8 @@ def	mysql	proxies_priv	0	mysql	PRIMARY	4
 def	mysql	servers	0	mysql	PRIMARY	1	Server_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	slave_master_info	0	mysql	PRIMARY	1	Master_id	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	slave_relay_log_info	0	mysql	PRIMARY	1	Master_id	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	slave_worker_info	0	mysql	PRIMARY	1	Master_id	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	slave_worker_info	0	mysql	PRIMARY	2	Worker_id	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	tables_priv	1	mysql	Grantor	1	Grantor	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	tables_priv	0	mysql	PRIMARY	1	Host	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	tables_priv	0	mysql	PRIMARY	2	Db	A	#CARD#	NULL	NULL		BTREE		

=== modified file 'mysql-test/suite/funcs_1/r/is_table_constraints.result'
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result	2010-12-27 18:54:41 +0000
@@ -77,6 +77,7 @@ def	mysql	PRIMARY	mysql	proxies_priv
 def	mysql	PRIMARY	mysql	servers
 def	mysql	PRIMARY	mysql	slave_master_info
 def	mysql	PRIMARY	mysql	slave_relay_log_info
+def	mysql	PRIMARY	mysql	slave_worker_info
 def	mysql	PRIMARY	mysql	tables_priv
 def	mysql	PRIMARY	mysql	time_zone
 def	mysql	PRIMARY	mysql	time_zone_leap_second

=== modified file 'mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result	2010-12-27 18:54:41 +0000
@@ -27,6 +27,7 @@ def	mysql	PRIMARY	mysql	proxies_priv	PRI
 def	mysql	PRIMARY	mysql	servers	PRIMARY KEY
 def	mysql	PRIMARY	mysql	slave_master_info	PRIMARY KEY
 def	mysql	PRIMARY	mysql	slave_relay_log_info	PRIMARY KEY
+def	mysql	PRIMARY	mysql	slave_worker_info	PRIMARY KEY
 def	mysql	PRIMARY	mysql	tables_priv	PRIMARY KEY
 def	mysql	PRIMARY	mysql	time_zone	PRIMARY KEY
 def	mysql	PRIMARY	mysql	time_zone_leap_second	PRIMARY KEY

=== modified file 'mysql-test/suite/funcs_1/r/is_tables_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result	2010-12-17 11:28:59 +0000
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result	2010-12-27 18:54:41 +0000
@@ -428,6 +428,29 @@ user_comment	Relay Log Information
 Separator	-----------------------------------------------------
 TABLE_CATALOG	def
 TABLE_SCHEMA	mysql
+TABLE_NAME	slave_worker_info
+TABLE_TYPE	BASE TABLE
+ENGINE	MyISAM
+VERSION	10
+ROW_FORMAT	Dynamic
+TABLE_ROWS	#TBLR#
+AVG_ROW_LENGTH	#ARL#
+DATA_LENGTH	#DL#
+MAX_DATA_LENGTH	#MDL#
+INDEX_LENGTH	#IL#
+DATA_FREE	#DF#
+AUTO_INCREMENT	NULL
+CREATE_TIME	#CRT#
+UPDATE_TIME	#UT#
+CHECK_TIME	#CT#
+TABLE_COLLATION	utf8_general_ci
+CHECKSUM	NULL
+CREATE_OPTIONS	#CO#
+TABLE_COMMENT	#TC#
+user_comment	Worker Information
+Separator	-----------------------------------------------------
+TABLE_CATALOG	def
+TABLE_SCHEMA	mysql
 TABLE_NAME	slow_log
 TABLE_TYPE	BASE TABLE
 ENGINE	CSV

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2010-11-24 08:34:13 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2010-12-08 00:33:48 +0000
@@ -8,27 +8,27 @@ use performance_schema;
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -41,27 +41,27 @@ use performance_schema;
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -72,27 +72,27 @@ drop view test.user_view;
 create procedure test.user_proc()
 select "Not supposed to be here";
 update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -103,27 +103,27 @@ drop procedure test.user_proc;
 create function test.user_func() returns integer
 return 0;
 update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -134,27 +134,27 @@ drop function test.user_func;
 create event test.user_event on schedule every 1 day do
 select "not supposed to be here";
 update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2010-11-24 08:34:13 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2010-12-08 00:33:48 +0000
@@ -8,27 +8,27 @@ use performance_schema;
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -41,27 +41,27 @@ use performance_schema;
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -72,27 +72,27 @@ drop view test.user_view;
 create procedure test.user_proc()
 select "Not supposed to be here";
 update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -103,27 +103,27 @@ drop procedure test.user_proc;
 create function test.user_func() returns integer
 return 0;
 update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -134,27 +134,27 @@ drop function test.user_func;
 create event test.user_event on schedule every 1 day do
 select "not supposed to be here";
 update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line 70: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 92: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 114: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 136: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 149: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 162: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 174: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 183: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 194: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 206: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 215: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 229: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 239: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 249: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 258: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 266: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 275: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 285: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 293: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 313: Table 'threads' already exists
-ERROR 1644 (HY000) at line 731: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 71: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 93: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 115: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 137: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 163: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 184: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 195: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 207: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 216: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 230: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 240: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 250: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 259: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 267: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 276: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 286: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 294: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 314: Table 'threads' already exists
+ERROR 1644 (HY000) at line 732: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== added file 'mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS'
--- a/mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS	2010-12-27 18:54:41 +0000
@@ -0,0 +1,1180 @@
+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;
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+###################################################################################
+#                               PREPARE EXECUTION
+###################################################################################
+SET @verbose= 'Y';
+SET @commands= 'configure';
+SHOW CREATE TABLE mysql.slave_relay_log_info;
+Table	Create Table
+slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
+  `Master_id` int(10) unsigned NOT NULL,
+  `Number_of_lines` int(10) unsigned NOT NULL,
+  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Relay_log_pos` bigint(20) unsigned NOT NULL,
+  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Master_log_pos` bigint(20) unsigned NOT NULL,
+  `Sql_delay` int(11) NOT NULL,
+  `Number_of_workers` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`Master_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
+CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
+CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_tt_5_suc";
+END|
+CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_nt_5_suc";
+END|
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+SET @commands= '';
+###################################################################################
+#                         EXECUTE CASES CRASHING THE XID
+###################################################################################
+SET @failures= 'd,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply';
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1);
+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_5(trans_id, stmt_id) VALUES (8, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (9, 1);
+fc_i_tt_5_suc (9, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (10, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (12, 4);
+fc_i_tt_5_suc (12, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (13, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (15, 2);
+fc_i_tt_5_suc (15, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (16, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1);
+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_5(trans_id, stmt_id) VALUES (18, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (19, 1);
+fc_i_tt_5_suc (19, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (20, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (22, 4);
+fc_i_tt_5_suc (22, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (23, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (25, 2);
+fc_i_tt_5_suc (25, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (26, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1);
+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_5(trans_id, stmt_id) VALUES (28, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (29, 1);
+fc_i_tt_5_suc (29, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (30, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (32, 4);
+fc_i_tt_5_suc (32, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (33, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (35, 2);
+fc_i_tt_5_suc (35, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (36, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+###################################################################################
+#                      EXECUTE CASES CRASHING THE BEGIN/COMMIT
+###################################################################################
+SET @failures= 'd,crash_after_commit_and_update_pos';
+
+
+
+SET @commands= 'N';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'N-trig';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+
+
+
+SET @commands= 'N-func';
+STOP SLAVE SQL_THREAD;
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_nt_5_suc (39, 1);
+fc_i_nt_5_suc (39, 1)
+fc_i_nt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+START SLAVE;
+###################################################################################
+#                               CHECK CONSISTENCY
+###################################################################################
+###################################################################################
+#                                        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_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+DROP FUNCTION fc_i_tt_5_suc;
+DROP FUNCTION fc_i_nt_5_suc;
+SET @commands= '';

=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result	2010-12-27 18:54:41 +0000
@@ -6,7 +6,6 @@ include/master-slave.inc
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 SET @verbose= 'Y';
 SET @commands= 'configure';
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -19,21 +18,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== added file 'mysql-test/suite/rpl/r/rpl_mixed_parallel_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_parallel_crash_safe.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_parallel_crash_safe.result	2010-12-27 18:54:41 +0000
@@ -0,0 +1,1276 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+###################################################################################
+#                               PREPARE EXECUTION
+###################################################################################
+SET @verbose= 'Y';
+SET @commands= 'configure';
+SHOW CREATE TABLE mysql.slave_relay_log_info;
+Table	Create Table
+slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
+  `Master_id` int(10) unsigned NOT NULL,
+  `Number_of_lines` int(10) unsigned NOT NULL,
+  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Relay_log_pos` bigint(20) unsigned NOT NULL,
+  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Master_log_pos` bigint(20) unsigned NOT NULL,
+  `Sql_delay` int(11) NOT NULL,
+  `Number_of_workers` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`Master_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
+CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
+CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_tt_5_suc";
+END|
+CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_nt_5_suc";
+END|
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+SET @commands= '';
+###################################################################################
+#                         EXECUTE CASES CRASHING THE XID
+###################################################################################
+SET @failures= 'd,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply';
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1);
+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_5(trans_id, stmt_id) VALUES (8, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (9, 1);
+fc_i_tt_5_suc (9, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (10, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (12, 4);
+fc_i_tt_5_suc (12, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (13, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (15, 2);
+fc_i_tt_5_suc (15, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (16, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1);
+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_5(trans_id, stmt_id) VALUES (18, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (19, 1);
+fc_i_tt_5_suc (19, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (20, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (22, 4);
+fc_i_tt_5_suc (22, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (23, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (25, 2);
+fc_i_tt_5_suc (25, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (26, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1);
+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_5(trans_id, stmt_id) VALUES (28, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (29, 1);
+fc_i_tt_5_suc (29, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (30, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (32, 4);
+fc_i_tt_5_suc (32, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (33, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (35, 2);
+fc_i_tt_5_suc (35, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (36, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+###################################################################################
+#                      EXECUTE CASES CRASHING THE BEGIN/COMMIT
+###################################################################################
+SET @failures= 'd,crash_after_commit_and_update_pos';
+
+
+
+SET @commands= 'N';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'N-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'N-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_nt_5_suc (39, 1);
+fc_i_nt_5_suc (39, 1)
+fc_i_nt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+###################################################################################
+#                               CHECK CONSISTENCY
+###################################################################################
+###################################################################################
+#                                        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_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+DROP FUNCTION fc_i_tt_5_suc;
+DROP FUNCTION fc_i_nt_5_suc;
+SET @commands= '';
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result	2010-12-27 18:54:41 +0000
@@ -6,7 +6,6 @@ include/master-slave.inc
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 SET @verbose= 'Y';
 SET @commands= 'configure';
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -19,21 +18,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result	2010-12-27 18:54:41 +0000
@@ -6,7 +6,6 @@ include/master-slave.inc
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 SET @verbose= 'Y';
 SET @commands= 'configure';
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -19,21 +18,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== modified file 'mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result	2010-12-27 18:54:41 +0000
@@ -6,7 +6,6 @@ include/master-slave.inc
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 SET @verbose= 'Y';
 SET @commands= 'configure';
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -19,21 +18,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== modified file 'mysql-test/suite/rpl/r/rpl_packet.result'
--- a/mysql-test/suite/rpl/r/rpl_packet.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_packet.result	2011-02-27 17:35:25 +0000
@@ -23,12 +23,12 @@ select * from information_schema.session
 VARIABLE_NAME	VARIABLE_VALUE
 SLAVE_RUNNING	ON
 drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-SET @@global.max_allowed_packet=4096;
-SET @@global.net_buffer_length=4096;
+SET @@global.max_allowed_packet=4096 + (floor(64 * 3 * 254 / 1024) + 1) * 1024;
+SET @@global.net_buffer_length=@@global.max_allowed_packet;
 include/stop_slave.inc
 include/start_slave.inc
 CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+INSERT INTO t1 VALUES (REPEAT('a', @@global.max_allowed_packet));
 include/wait_for_slave_io_error.inc [errno=1153]
 Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes'
 include/stop_slave_sql.inc
@@ -51,10 +51,10 @@ include/wait_for_slave_to_start.inc
 DROP TABLE t1;
 select @@global.max_allowed_packet;
 @@global.max_allowed_packet
-4096
+53248
 select @@global.net_buffer_length;
 @@global.net_buffer_length
-4096
+53248
 select @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
@@ -62,7 +62,7 @@ select @@global.net_buffer_length;
 @@global.net_buffer_length
 1024
 CREATE TABLE t1 (a TEXT) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (REPEAT('a', 2048));
+INSERT INTO t1 VALUES (REPEAT('a', @@global.max_allowed_packet));
 # 1153 = ER_NET_PACKET_TOO_LARGE
 include/wait_for_slave_io_error.inc [errno=1153]
 Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes'

=== added file 'mysql-test/suite/rpl/r/rpl_parallel.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result	2011-04-05 16:26:37 +0000
@@ -0,0 +1,80 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Slave: Error dropping database');
+include/stop_slave.inc
+start slave;
+stop slave sql_thread;
+use test;
+select * from test0.benchmark into outfile 'benchmark.out';
+select ts from test0.benchmark where state like 'master started load' into @m_0;
+select ts from test0.benchmark where state like 'master ends load' into @m_1;
+select ts from test0.benchmark where state like 'slave takes on load' into @s_0;
+select ts from test0.benchmark where state like 'slave ends load' into @s_1;
+select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m', 
+time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s' into outfile 'delta.out';
+include/diff_tables.inc [master:test15.v_tm_nk, slave:test15.v_tm_nk]
+include/diff_tables.inc [master:test15.v_ti_nk, slave:test15.v_ti_nk]
+include/diff_tables.inc [master:test15.v_tm_wk, slave:test15.v_tm_wk]
+include/diff_tables.inc [master:test15.v_ti_wk, slave:test15.v_ti_wk]
+include/diff_tables.inc [master:test14.v_tm_nk, slave:test14.v_tm_nk]
+include/diff_tables.inc [master:test14.v_ti_nk, slave:test14.v_ti_nk]
+include/diff_tables.inc [master:test14.v_tm_wk, slave:test14.v_tm_wk]
+include/diff_tables.inc [master:test14.v_ti_wk, slave:test14.v_ti_wk]
+include/diff_tables.inc [master:test13.v_tm_nk, slave:test13.v_tm_nk]
+include/diff_tables.inc [master:test13.v_ti_nk, slave:test13.v_ti_nk]
+include/diff_tables.inc [master:test13.v_tm_wk, slave:test13.v_tm_wk]
+include/diff_tables.inc [master:test13.v_ti_wk, slave:test13.v_ti_wk]
+include/diff_tables.inc [master:test12.v_tm_nk, slave:test12.v_tm_nk]
+include/diff_tables.inc [master:test12.v_ti_nk, slave:test12.v_ti_nk]
+include/diff_tables.inc [master:test12.v_tm_wk, slave:test12.v_tm_wk]
+include/diff_tables.inc [master:test12.v_ti_wk, slave:test12.v_ti_wk]
+include/diff_tables.inc [master:test11.v_tm_nk, slave:test11.v_tm_nk]
+include/diff_tables.inc [master:test11.v_ti_nk, slave:test11.v_ti_nk]
+include/diff_tables.inc [master:test11.v_tm_wk, slave:test11.v_tm_wk]
+include/diff_tables.inc [master:test11.v_ti_wk, slave:test11.v_ti_wk]
+include/diff_tables.inc [master:test10.v_tm_nk, slave:test10.v_tm_nk]
+include/diff_tables.inc [master:test10.v_ti_nk, slave:test10.v_ti_nk]
+include/diff_tables.inc [master:test10.v_tm_wk, slave:test10.v_tm_wk]
+include/diff_tables.inc [master:test10.v_ti_wk, slave:test10.v_ti_wk]
+include/diff_tables.inc [master:test9.v_tm_nk, slave:test9.v_tm_nk]
+include/diff_tables.inc [master:test9.v_ti_nk, slave:test9.v_ti_nk]
+include/diff_tables.inc [master:test9.v_tm_wk, slave:test9.v_tm_wk]
+include/diff_tables.inc [master:test9.v_ti_wk, slave:test9.v_ti_wk]
+include/diff_tables.inc [master:test8.v_tm_nk, slave:test8.v_tm_nk]
+include/diff_tables.inc [master:test8.v_ti_nk, slave:test8.v_ti_nk]
+include/diff_tables.inc [master:test8.v_tm_wk, slave:test8.v_tm_wk]
+include/diff_tables.inc [master:test8.v_ti_wk, slave:test8.v_ti_wk]
+include/diff_tables.inc [master:test7.v_tm_nk, slave:test7.v_tm_nk]
+include/diff_tables.inc [master:test7.v_ti_nk, slave:test7.v_ti_nk]
+include/diff_tables.inc [master:test7.v_tm_wk, slave:test7.v_tm_wk]
+include/diff_tables.inc [master:test7.v_ti_wk, slave:test7.v_ti_wk]
+include/diff_tables.inc [master:test6.v_tm_nk, slave:test6.v_tm_nk]
+include/diff_tables.inc [master:test6.v_ti_nk, slave:test6.v_ti_nk]
+include/diff_tables.inc [master:test6.v_tm_wk, slave:test6.v_tm_wk]
+include/diff_tables.inc [master:test6.v_ti_wk, slave:test6.v_ti_wk]
+include/diff_tables.inc [master:test5.v_tm_nk, slave:test5.v_tm_nk]
+include/diff_tables.inc [master:test5.v_ti_nk, slave:test5.v_ti_nk]
+include/diff_tables.inc [master:test5.v_tm_wk, slave:test5.v_tm_wk]
+include/diff_tables.inc [master:test5.v_ti_wk, slave:test5.v_ti_wk]
+include/diff_tables.inc [master:test4.v_tm_nk, slave:test4.v_tm_nk]
+include/diff_tables.inc [master:test4.v_ti_nk, slave:test4.v_ti_nk]
+include/diff_tables.inc [master:test4.v_tm_wk, slave:test4.v_tm_wk]
+include/diff_tables.inc [master:test4.v_ti_wk, slave:test4.v_ti_wk]
+include/diff_tables.inc [master:test3.v_tm_nk, slave:test3.v_tm_nk]
+include/diff_tables.inc [master:test3.v_ti_nk, slave:test3.v_ti_nk]
+include/diff_tables.inc [master:test3.v_tm_wk, slave:test3.v_tm_wk]
+include/diff_tables.inc [master:test3.v_ti_wk, slave:test3.v_ti_wk]
+include/diff_tables.inc [master:test2.v_tm_nk, slave:test2.v_tm_nk]
+include/diff_tables.inc [master:test2.v_ti_nk, slave:test2.v_ti_nk]
+include/diff_tables.inc [master:test2.v_tm_wk, slave:test2.v_tm_wk]
+include/diff_tables.inc [master:test2.v_ti_wk, slave:test2.v_ti_wk]
+include/diff_tables.inc [master:test1.v_tm_nk, slave:test1.v_tm_nk]
+include/diff_tables.inc [master:test1.v_ti_nk, slave:test1.v_ti_nk]
+include/diff_tables.inc [master:test1.v_tm_wk, slave:test1.v_tm_wk]
+include/diff_tables.inc [master:test1.v_ti_wk, slave:test1.v_ti_wk]
+include/diff_tables.inc [master:test0.v_tm_nk, slave:test0.v_tm_nk]
+include/diff_tables.inc [master:test0.v_ti_nk, slave:test0.v_ti_nk]
+include/diff_tables.inc [master:test0.v_tm_wk, slave:test0.v_tm_wk]
+include/diff_tables.inc [master:test0.v_ti_wk, slave:test0.v_ti_wk]
+set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_benchmark.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_benchmark.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_benchmark.result	2011-04-02 11:32:02 +0000
@@ -0,0 +1,17 @@
+include/master-slave.inc
+[connection master]
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+call mtr.add_suppression('Slave: Error dropping database');
+include/stop_slave.inc
+start slave;
+stop slave sql_thread;
+use test;
+select * from test1.benchmark into outfile 'benchmark.out';
+select ts from test1.benchmark where state like 'master started load' into @m_0;
+select ts from test1.benchmark where state like 'master ends load' into @m_1;
+select ts from test1.benchmark where state like 'slave takes on load' into @s_0;
+select ts from test1.benchmark where state like 'slave ends load' into @s_1;
+select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m', 
+time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s' into outfile 'delta.out';
+set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result	2010-12-27 18:54:41 +0000
@@ -0,0 +1,190 @@
+include/master-slave.inc
+[connection master]
+create view coord_wait_list as
+SELECT id from Information_Schema.processlist
+where state like 'Waiting for Slave Worker%';
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+set @save_mts_slave_worker_queue_len_max= @@global.mts_slave_worker_queue_len_max;
+set @@global.mts_slave_worker_queue_len_max= 5;
+include/start_slave.inc
+create database d0;
+create table d0.t1 (a int auto_increment primary key) engine=innodb;
+begin;
+insert into d0.t1 set a=null;
+begin;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+commit;
+*** Coordinator must be waiting a for Worker to process its queue ***
+rollback;
+set @@global.mts_slave_worker_queue_len_max= @save_mts_slave_worker_queue_len_max;
+include/stop_slave.inc
+set @save_mts_pending_jobs_size_max = @@global.mts_pending_jobs_size_max;
+set @@global.mts_pending_jobs_size_max= 1024;
+include/start_slave.inc
+create table d0.t2 (a int auto_increment primary key, b text null) engine=innodb;
+begin;
+insert into d0.t2 set a= 1;
+begin;
+commit;
+*** Coordinator must be waiting for Workers have released pending events mem ***
+rollback;
+set @@global.mts_pending_jobs_size_max= @save_mts_pending_jobs_size_max;
+set @save.mts_partition_hash_soft_max= @@global.mts_partition_hash_soft_max;
+set @@global.mts_partition_hash_soft_max= 0;
+create database d16;
+create table d16.t1 (a int auto_increment primary key) engine=innodb;
+create database d15;
+create table d15.t1 (a int auto_increment primary key) engine=innodb;
+create database d14;
+create table d14.t1 (a int auto_increment primary key) engine=innodb;
+create database d13;
+create table d13.t1 (a int auto_increment primary key) engine=innodb;
+create database d12;
+create table d12.t1 (a int auto_increment primary key) engine=innodb;
+create database d11;
+create table d11.t1 (a int auto_increment primary key) engine=innodb;
+create database d10;
+create table d10.t1 (a int auto_increment primary key) engine=innodb;
+create database d9;
+create table d9.t1 (a int auto_increment primary key) engine=innodb;
+create database d8;
+create table d8.t1 (a int auto_increment primary key) engine=innodb;
+create database d7;
+create table d7.t1 (a int auto_increment primary key) engine=innodb;
+create database d6;
+create table d6.t1 (a int auto_increment primary key) engine=innodb;
+create database d5;
+create table d5.t1 (a int auto_increment primary key) engine=innodb;
+create database d4;
+create table d4.t1 (a int auto_increment primary key) engine=innodb;
+create database d3;
+create table d3.t1 (a int auto_increment primary key) engine=innodb;
+create database d2;
+create table d2.t1 (a int auto_increment primary key) engine=innodb;
+create database d1;
+create table d1.t1 (a int auto_increment primary key) engine=innodb;
+begin;
+insert into d16.t1 set a=null;
+insert into d16.t1 set a=null;
+insert into d16.t1 set a=null;
+insert into d16.t1 set a=null;
+commit;
+begin;
+insert into d15.t1 set a=null;
+insert into d15.t1 set a=null;
+insert into d15.t1 set a=null;
+insert into d15.t1 set a=null;
+commit;
+begin;
+insert into d14.t1 set a=null;
+insert into d14.t1 set a=null;
+insert into d14.t1 set a=null;
+insert into d14.t1 set a=null;
+commit;
+begin;
+insert into d13.t1 set a=null;
+insert into d13.t1 set a=null;
+insert into d13.t1 set a=null;
+insert into d13.t1 set a=null;
+commit;
+begin;
+insert into d12.t1 set a=null;
+insert into d12.t1 set a=null;
+insert into d12.t1 set a=null;
+insert into d12.t1 set a=null;
+commit;
+begin;
+insert into d11.t1 set a=null;
+insert into d11.t1 set a=null;
+insert into d11.t1 set a=null;
+insert into d11.t1 set a=null;
+commit;
+begin;
+insert into d10.t1 set a=null;
+insert into d10.t1 set a=null;
+insert into d10.t1 set a=null;
+insert into d10.t1 set a=null;
+commit;
+begin;
+insert into d9.t1 set a=null;
+insert into d9.t1 set a=null;
+insert into d9.t1 set a=null;
+insert into d9.t1 set a=null;
+commit;
+begin;
+insert into d8.t1 set a=null;
+insert into d8.t1 set a=null;
+insert into d8.t1 set a=null;
+insert into d8.t1 set a=null;
+commit;
+begin;
+insert into d7.t1 set a=null;
+insert into d7.t1 set a=null;
+insert into d7.t1 set a=null;
+insert into d7.t1 set a=null;
+commit;
+begin;
+insert into d6.t1 set a=null;
+insert into d6.t1 set a=null;
+insert into d6.t1 set a=null;
+insert into d6.t1 set a=null;
+commit;
+begin;
+insert into d5.t1 set a=null;
+insert into d5.t1 set a=null;
+insert into d5.t1 set a=null;
+insert into d5.t1 set a=null;
+commit;
+begin;
+insert into d4.t1 set a=null;
+insert into d4.t1 set a=null;
+insert into d4.t1 set a=null;
+insert into d4.t1 set a=null;
+commit;
+begin;
+insert into d3.t1 set a=null;
+insert into d3.t1 set a=null;
+insert into d3.t1 set a=null;
+insert into d3.t1 set a=null;
+commit;
+begin;
+insert into d2.t1 set a=null;
+insert into d2.t1 set a=null;
+insert into d2.t1 set a=null;
+insert into d2.t1 set a=null;
+commit;
+begin;
+insert into d1.t1 set a=null;
+insert into d1.t1 set a=null;
+insert into d1.t1 set a=null;
+insert into d1.t1 set a=null;
+commit;
+set @@global.mts_partition_hash_soft_max= @save.mts_partition_hash_soft_max;
+drop database d16;
+drop database d15;
+drop database d14;
+drop database d13;
+drop database d12;
+drop database d11;
+drop database d10;
+drop database d9;
+drop database d8;
+drop database d7;
+drop database d6;
+drop database d5;
+drop database d4;
+drop database d3;
+drop database d2;
+drop database d1;
+drop database d0;
+drop view coord_wait_list;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_conflicts.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result	2010-12-27 18:54:41 +0000
@@ -0,0 +1,76 @@
+include/master-slave.inc
+[connection master]
+create view coord_wait_list  as SELECT id from Information_Schema.processlist where state like 'Waiting for Slave Worker%';
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+include/start_slave.inc
+create database d1;
+create database d2;
+create database d3;
+create table d1.t1 (a int auto_increment primary key) engine=innodb;
+create table d2.t1 (a int auto_increment primary key) engine=innodb;
+create table d3.t1 (a int auto_increment primary key) engine=innodb;
+begin;
+insert into d2.t1 values (1);
+begin;
+use d1;
+insert into d1.t1 values (null);
+use d2;
+insert into d2.t1 values (1);
+commit;
+begin;
+use d3;
+insert into d3.t1 values (null);
+use d1;
+insert into d1.t1 values (null);
+commit;
+*** Coordinator must be in waiting for a Worker to unassign from a partition ***
+rollback;
+select count(*) from d1.t1 into @d1;
+select count(*) from d2.t1 into @d2;
+select count(*) from d3.t1 into @d3;
+use d1;
+create table `exists_only_on_slave` (a int);
+begin;
+insert into d1.t1 values (null);
+insert into d2.t1 values (null);
+insert into d3.t1 values (null);
+begin;
+use d1;
+insert into d1.t1 values (null);
+commit;
+begin;
+use d2;
+insert into d2.t1 values (null);
+commit;
+begin;
+use d3;
+insert into d3.t1 values (null);
+commit;
+use d1;
+drop table if exists `exists_only_on_slave`;
+select sleep(1);
+sleep(1)
+0
+select count(*) - @d1 as 'zero' from d1.t1;
+zero
+0
+select count(*) - @d2 as 'zero' from d2.t1;
+zero
+0
+select count(*) - @d3 as 'zero' from d3.t1;
+zero
+0
+use d1;
+select count(*) as 'zero' from `exists_only_on_slave`;
+zero
+0
+rollback;
+drop database d1;
+drop database d2;
+drop database d3;
+drop view coord_wait_list;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+*** End of the tests ***
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_ddl.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_ddl.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_ddl.result	2011-02-27 17:35:25 +0000
@@ -0,0 +1,265 @@
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+include/start_slave.inc
+Warnings:
+Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+include/diff_tables.inc [master:d32.t8, slave:d32.t8]
+include/diff_tables.inc [master:d32.t7, slave:d32.t7]
+include/diff_tables.inc [master:d32.t6, slave:d32.t6]
+include/diff_tables.inc [master:d32.t5, slave:d32.t5]
+include/diff_tables.inc [master:d32.t4, slave:d32.t4]
+include/diff_tables.inc [master:d32.t3, slave:d32.t3]
+include/diff_tables.inc [master:d32.t2, slave:d32.t2]
+include/diff_tables.inc [master:d32.t1, slave:d32.t1]
+include/diff_tables.inc [master:d31.t8, slave:d31.t8]
+include/diff_tables.inc [master:d31.t7, slave:d31.t7]
+include/diff_tables.inc [master:d31.t6, slave:d31.t6]
+include/diff_tables.inc [master:d31.t5, slave:d31.t5]
+include/diff_tables.inc [master:d31.t4, slave:d31.t4]
+include/diff_tables.inc [master:d31.t3, slave:d31.t3]
+include/diff_tables.inc [master:d31.t2, slave:d31.t2]
+include/diff_tables.inc [master:d31.t1, slave:d31.t1]
+include/diff_tables.inc [master:d30.t8, slave:d30.t8]
+include/diff_tables.inc [master:d30.t7, slave:d30.t7]
+include/diff_tables.inc [master:d30.t6, slave:d30.t6]
+include/diff_tables.inc [master:d30.t5, slave:d30.t5]
+include/diff_tables.inc [master:d30.t4, slave:d30.t4]
+include/diff_tables.inc [master:d30.t3, slave:d30.t3]
+include/diff_tables.inc [master:d30.t2, slave:d30.t2]
+include/diff_tables.inc [master:d30.t1, slave:d30.t1]
+include/diff_tables.inc [master:d29.t8, slave:d29.t8]
+include/diff_tables.inc [master:d29.t7, slave:d29.t7]
+include/diff_tables.inc [master:d29.t6, slave:d29.t6]
+include/diff_tables.inc [master:d29.t5, slave:d29.t5]
+include/diff_tables.inc [master:d29.t4, slave:d29.t4]
+include/diff_tables.inc [master:d29.t3, slave:d29.t3]
+include/diff_tables.inc [master:d29.t2, slave:d29.t2]
+include/diff_tables.inc [master:d29.t1, slave:d29.t1]
+include/diff_tables.inc [master:d28.t8, slave:d28.t8]
+include/diff_tables.inc [master:d28.t7, slave:d28.t7]
+include/diff_tables.inc [master:d28.t6, slave:d28.t6]
+include/diff_tables.inc [master:d28.t5, slave:d28.t5]
+include/diff_tables.inc [master:d28.t4, slave:d28.t4]
+include/diff_tables.inc [master:d28.t3, slave:d28.t3]
+include/diff_tables.inc [master:d28.t2, slave:d28.t2]
+include/diff_tables.inc [master:d28.t1, slave:d28.t1]
+include/diff_tables.inc [master:d27.t8, slave:d27.t8]
+include/diff_tables.inc [master:d27.t7, slave:d27.t7]
+include/diff_tables.inc [master:d27.t6, slave:d27.t6]
+include/diff_tables.inc [master:d27.t5, slave:d27.t5]
+include/diff_tables.inc [master:d27.t4, slave:d27.t4]
+include/diff_tables.inc [master:d27.t3, slave:d27.t3]
+include/diff_tables.inc [master:d27.t2, slave:d27.t2]
+include/diff_tables.inc [master:d27.t1, slave:d27.t1]
+include/diff_tables.inc [master:d26.t8, slave:d26.t8]
+include/diff_tables.inc [master:d26.t7, slave:d26.t7]
+include/diff_tables.inc [master:d26.t6, slave:d26.t6]
+include/diff_tables.inc [master:d26.t5, slave:d26.t5]
+include/diff_tables.inc [master:d26.t4, slave:d26.t4]
+include/diff_tables.inc [master:d26.t3, slave:d26.t3]
+include/diff_tables.inc [master:d26.t2, slave:d26.t2]
+include/diff_tables.inc [master:d26.t1, slave:d26.t1]
+include/diff_tables.inc [master:d25.t8, slave:d25.t8]
+include/diff_tables.inc [master:d25.t7, slave:d25.t7]
+include/diff_tables.inc [master:d25.t6, slave:d25.t6]
+include/diff_tables.inc [master:d25.t5, slave:d25.t5]
+include/diff_tables.inc [master:d25.t4, slave:d25.t4]
+include/diff_tables.inc [master:d25.t3, slave:d25.t3]
+include/diff_tables.inc [master:d25.t2, slave:d25.t2]
+include/diff_tables.inc [master:d25.t1, slave:d25.t1]
+include/diff_tables.inc [master:d24.t8, slave:d24.t8]
+include/diff_tables.inc [master:d24.t7, slave:d24.t7]
+include/diff_tables.inc [master:d24.t6, slave:d24.t6]
+include/diff_tables.inc [master:d24.t5, slave:d24.t5]
+include/diff_tables.inc [master:d24.t4, slave:d24.t4]
+include/diff_tables.inc [master:d24.t3, slave:d24.t3]
+include/diff_tables.inc [master:d24.t2, slave:d24.t2]
+include/diff_tables.inc [master:d24.t1, slave:d24.t1]
+include/diff_tables.inc [master:d23.t8, slave:d23.t8]
+include/diff_tables.inc [master:d23.t7, slave:d23.t7]
+include/diff_tables.inc [master:d23.t6, slave:d23.t6]
+include/diff_tables.inc [master:d23.t5, slave:d23.t5]
+include/diff_tables.inc [master:d23.t4, slave:d23.t4]
+include/diff_tables.inc [master:d23.t3, slave:d23.t3]
+include/diff_tables.inc [master:d23.t2, slave:d23.t2]
+include/diff_tables.inc [master:d23.t1, slave:d23.t1]
+include/diff_tables.inc [master:d22.t8, slave:d22.t8]
+include/diff_tables.inc [master:d22.t7, slave:d22.t7]
+include/diff_tables.inc [master:d22.t6, slave:d22.t6]
+include/diff_tables.inc [master:d22.t5, slave:d22.t5]
+include/diff_tables.inc [master:d22.t4, slave:d22.t4]
+include/diff_tables.inc [master:d22.t3, slave:d22.t3]
+include/diff_tables.inc [master:d22.t2, slave:d22.t2]
+include/diff_tables.inc [master:d22.t1, slave:d22.t1]
+include/diff_tables.inc [master:d21.t8, slave:d21.t8]
+include/diff_tables.inc [master:d21.t7, slave:d21.t7]
+include/diff_tables.inc [master:d21.t6, slave:d21.t6]
+include/diff_tables.inc [master:d21.t5, slave:d21.t5]
+include/diff_tables.inc [master:d21.t4, slave:d21.t4]
+include/diff_tables.inc [master:d21.t3, slave:d21.t3]
+include/diff_tables.inc [master:d21.t2, slave:d21.t2]
+include/diff_tables.inc [master:d21.t1, slave:d21.t1]
+include/diff_tables.inc [master:d20.t8, slave:d20.t8]
+include/diff_tables.inc [master:d20.t7, slave:d20.t7]
+include/diff_tables.inc [master:d20.t6, slave:d20.t6]
+include/diff_tables.inc [master:d20.t5, slave:d20.t5]
+include/diff_tables.inc [master:d20.t4, slave:d20.t4]
+include/diff_tables.inc [master:d20.t3, slave:d20.t3]
+include/diff_tables.inc [master:d20.t2, slave:d20.t2]
+include/diff_tables.inc [master:d20.t1, slave:d20.t1]
+include/diff_tables.inc [master:d19.t8, slave:d19.t8]
+include/diff_tables.inc [master:d19.t7, slave:d19.t7]
+include/diff_tables.inc [master:d19.t6, slave:d19.t6]
+include/diff_tables.inc [master:d19.t5, slave:d19.t5]
+include/diff_tables.inc [master:d19.t4, slave:d19.t4]
+include/diff_tables.inc [master:d19.t3, slave:d19.t3]
+include/diff_tables.inc [master:d19.t2, slave:d19.t2]
+include/diff_tables.inc [master:d19.t1, slave:d19.t1]
+include/diff_tables.inc [master:d18.t8, slave:d18.t8]
+include/diff_tables.inc [master:d18.t7, slave:d18.t7]
+include/diff_tables.inc [master:d18.t6, slave:d18.t6]
+include/diff_tables.inc [master:d18.t5, slave:d18.t5]
+include/diff_tables.inc [master:d18.t4, slave:d18.t4]
+include/diff_tables.inc [master:d18.t3, slave:d18.t3]
+include/diff_tables.inc [master:d18.t2, slave:d18.t2]
+include/diff_tables.inc [master:d18.t1, slave:d18.t1]
+include/diff_tables.inc [master:d17.t8, slave:d17.t8]
+include/diff_tables.inc [master:d17.t7, slave:d17.t7]
+include/diff_tables.inc [master:d17.t6, slave:d17.t6]
+include/diff_tables.inc [master:d17.t5, slave:d17.t5]
+include/diff_tables.inc [master:d17.t4, slave:d17.t4]
+include/diff_tables.inc [master:d17.t3, slave:d17.t3]
+include/diff_tables.inc [master:d17.t2, slave:d17.t2]
+include/diff_tables.inc [master:d17.t1, slave:d17.t1]
+include/diff_tables.inc [master:d16.t8, slave:d16.t8]
+include/diff_tables.inc [master:d16.t7, slave:d16.t7]
+include/diff_tables.inc [master:d16.t6, slave:d16.t6]
+include/diff_tables.inc [master:d16.t5, slave:d16.t5]
+include/diff_tables.inc [master:d16.t4, slave:d16.t4]
+include/diff_tables.inc [master:d16.t3, slave:d16.t3]
+include/diff_tables.inc [master:d16.t2, slave:d16.t2]
+include/diff_tables.inc [master:d16.t1, slave:d16.t1]
+include/diff_tables.inc [master:d15.t8, slave:d15.t8]
+include/diff_tables.inc [master:d15.t7, slave:d15.t7]
+include/diff_tables.inc [master:d15.t6, slave:d15.t6]
+include/diff_tables.inc [master:d15.t5, slave:d15.t5]
+include/diff_tables.inc [master:d15.t4, slave:d15.t4]
+include/diff_tables.inc [master:d15.t3, slave:d15.t3]
+include/diff_tables.inc [master:d15.t2, slave:d15.t2]
+include/diff_tables.inc [master:d15.t1, slave:d15.t1]
+include/diff_tables.inc [master:d14.t8, slave:d14.t8]
+include/diff_tables.inc [master:d14.t7, slave:d14.t7]
+include/diff_tables.inc [master:d14.t6, slave:d14.t6]
+include/diff_tables.inc [master:d14.t5, slave:d14.t5]
+include/diff_tables.inc [master:d14.t4, slave:d14.t4]
+include/diff_tables.inc [master:d14.t3, slave:d14.t3]
+include/diff_tables.inc [master:d14.t2, slave:d14.t2]
+include/diff_tables.inc [master:d14.t1, slave:d14.t1]
+include/diff_tables.inc [master:d13.t8, slave:d13.t8]
+include/diff_tables.inc [master:d13.t7, slave:d13.t7]
+include/diff_tables.inc [master:d13.t6, slave:d13.t6]
+include/diff_tables.inc [master:d13.t5, slave:d13.t5]
+include/diff_tables.inc [master:d13.t4, slave:d13.t4]
+include/diff_tables.inc [master:d13.t3, slave:d13.t3]
+include/diff_tables.inc [master:d13.t2, slave:d13.t2]
+include/diff_tables.inc [master:d13.t1, slave:d13.t1]
+include/diff_tables.inc [master:d12.t8, slave:d12.t8]
+include/diff_tables.inc [master:d12.t7, slave:d12.t7]
+include/diff_tables.inc [master:d12.t6, slave:d12.t6]
+include/diff_tables.inc [master:d12.t5, slave:d12.t5]
+include/diff_tables.inc [master:d12.t4, slave:d12.t4]
+include/diff_tables.inc [master:d12.t3, slave:d12.t3]
+include/diff_tables.inc [master:d12.t2, slave:d12.t2]
+include/diff_tables.inc [master:d12.t1, slave:d12.t1]
+include/diff_tables.inc [master:d11.t8, slave:d11.t8]
+include/diff_tables.inc [master:d11.t7, slave:d11.t7]
+include/diff_tables.inc [master:d11.t6, slave:d11.t6]
+include/diff_tables.inc [master:d11.t5, slave:d11.t5]
+include/diff_tables.inc [master:d11.t4, slave:d11.t4]
+include/diff_tables.inc [master:d11.t3, slave:d11.t3]
+include/diff_tables.inc [master:d11.t2, slave:d11.t2]
+include/diff_tables.inc [master:d11.t1, slave:d11.t1]
+include/diff_tables.inc [master:d10.t8, slave:d10.t8]
+include/diff_tables.inc [master:d10.t7, slave:d10.t7]
+include/diff_tables.inc [master:d10.t6, slave:d10.t6]
+include/diff_tables.inc [master:d10.t5, slave:d10.t5]
+include/diff_tables.inc [master:d10.t4, slave:d10.t4]
+include/diff_tables.inc [master:d10.t3, slave:d10.t3]
+include/diff_tables.inc [master:d10.t2, slave:d10.t2]
+include/diff_tables.inc [master:d10.t1, slave:d10.t1]
+include/diff_tables.inc [master:d9.t8, slave:d9.t8]
+include/diff_tables.inc [master:d9.t7, slave:d9.t7]
+include/diff_tables.inc [master:d9.t6, slave:d9.t6]
+include/diff_tables.inc [master:d9.t5, slave:d9.t5]
+include/diff_tables.inc [master:d9.t4, slave:d9.t4]
+include/diff_tables.inc [master:d9.t3, slave:d9.t3]
+include/diff_tables.inc [master:d9.t2, slave:d9.t2]
+include/diff_tables.inc [master:d9.t1, slave:d9.t1]
+include/diff_tables.inc [master:d8.t8, slave:d8.t8]
+include/diff_tables.inc [master:d8.t7, slave:d8.t7]
+include/diff_tables.inc [master:d8.t6, slave:d8.t6]
+include/diff_tables.inc [master:d8.t5, slave:d8.t5]
+include/diff_tables.inc [master:d8.t4, slave:d8.t4]
+include/diff_tables.inc [master:d8.t3, slave:d8.t3]
+include/diff_tables.inc [master:d8.t2, slave:d8.t2]
+include/diff_tables.inc [master:d8.t1, slave:d8.t1]
+include/diff_tables.inc [master:d7.t8, slave:d7.t8]
+include/diff_tables.inc [master:d7.t7, slave:d7.t7]
+include/diff_tables.inc [master:d7.t6, slave:d7.t6]
+include/diff_tables.inc [master:d7.t5, slave:d7.t5]
+include/diff_tables.inc [master:d7.t4, slave:d7.t4]
+include/diff_tables.inc [master:d7.t3, slave:d7.t3]
+include/diff_tables.inc [master:d7.t2, slave:d7.t2]
+include/diff_tables.inc [master:d7.t1, slave:d7.t1]
+include/diff_tables.inc [master:d6.t8, slave:d6.t8]
+include/diff_tables.inc [master:d6.t7, slave:d6.t7]
+include/diff_tables.inc [master:d6.t6, slave:d6.t6]
+include/diff_tables.inc [master:d6.t5, slave:d6.t5]
+include/diff_tables.inc [master:d6.t4, slave:d6.t4]
+include/diff_tables.inc [master:d6.t3, slave:d6.t3]
+include/diff_tables.inc [master:d6.t2, slave:d6.t2]
+include/diff_tables.inc [master:d6.t1, slave:d6.t1]
+include/diff_tables.inc [master:d5.t8, slave:d5.t8]
+include/diff_tables.inc [master:d5.t7, slave:d5.t7]
+include/diff_tables.inc [master:d5.t6, slave:d5.t6]
+include/diff_tables.inc [master:d5.t5, slave:d5.t5]
+include/diff_tables.inc [master:d5.t4, slave:d5.t4]
+include/diff_tables.inc [master:d5.t3, slave:d5.t3]
+include/diff_tables.inc [master:d5.t2, slave:d5.t2]
+include/diff_tables.inc [master:d5.t1, slave:d5.t1]
+include/diff_tables.inc [master:d4.t8, slave:d4.t8]
+include/diff_tables.inc [master:d4.t7, slave:d4.t7]
+include/diff_tables.inc [master:d4.t6, slave:d4.t6]
+include/diff_tables.inc [master:d4.t5, slave:d4.t5]
+include/diff_tables.inc [master:d4.t4, slave:d4.t4]
+include/diff_tables.inc [master:d4.t3, slave:d4.t3]
+include/diff_tables.inc [master:d4.t2, slave:d4.t2]
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t8, slave:d3.t8]
+include/diff_tables.inc [master:d3.t7, slave:d3.t7]
+include/diff_tables.inc [master:d3.t6, slave:d3.t6]
+include/diff_tables.inc [master:d3.t5, slave:d3.t5]
+include/diff_tables.inc [master:d3.t4, slave:d3.t4]
+include/diff_tables.inc [master:d3.t3, slave:d3.t3]
+include/diff_tables.inc [master:d3.t2, slave:d3.t2]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t8, slave:d2.t8]
+include/diff_tables.inc [master:d2.t7, slave:d2.t7]
+include/diff_tables.inc [master:d2.t6, slave:d2.t6]
+include/diff_tables.inc [master:d2.t5, slave:d2.t5]
+include/diff_tables.inc [master:d2.t4, slave:d2.t4]
+include/diff_tables.inc [master:d2.t3, slave:d2.t3]
+include/diff_tables.inc [master:d2.t2, slave:d2.t2]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t8, slave:d1.t8]
+include/diff_tables.inc [master:d1.t7, slave:d1.t7]
+include/diff_tables.inc [master:d1.t6, slave:d1.t6]
+include/diff_tables.inc [master:d1.t5, slave:d1.t5]
+include/diff_tables.inc [master:d1.t4, slave:d1.t4]
+include/diff_tables.inc [master:d1.t3, slave:d1.t3]
+include/diff_tables.inc [master:d1.t2, slave:d1.t2]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_fallback.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_fallback.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_fallback.result	2010-12-27 18:54:41 +0000
@@ -0,0 +1,21 @@
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+include/start_slave.inc
+Warnings:
+Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+set @@session.binlog_format= row;
+create database d0;
+create table d0.t1 (a int auto_increment primary key) engine=innodb;
+set @@session.binlog_format= row;
+create database d1;
+create table d1.t1 (a int auto_increment primary key) engine=innodb;
+set @@session.binlog_rows_query_log_events= 1;
+set @@session.binlog_rows_query_log_events= 0;
+include/diff_tables.inc [master:d0.t1, slave:d0.t1]
+drop database d0;
+drop database d1;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_multi_db.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result	2011-02-27 17:35:25 +0000
@@ -0,0 +1,373 @@
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+include/start_slave.inc
+Warnings:
+Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+create database d8;
+create table d8.t8 (a int);
+select round(rand()*8) into @var;
+insert into d8.t8 values (@var);
+create table d8.t7 (a int);
+select round(rand()*8) into @var;
+insert into d8.t7 values (@var);
+create table d8.t6 (a int);
+select round(rand()*8) into @var;
+insert into d8.t6 values (@var);
+create table d8.t5 (a int);
+select round(rand()*8) into @var;
+insert into d8.t5 values (@var);
+create table d8.t4 (a int);
+select round(rand()*8) into @var;
+insert into d8.t4 values (@var);
+create table d8.t3 (a int);
+select round(rand()*8) into @var;
+insert into d8.t3 values (@var);
+create table d8.t2 (a int);
+select round(rand()*8) into @var;
+insert into d8.t2 values (@var);
+create table d8.t1 (a int);
+select round(rand()*8) into @var;
+insert into d8.t1 values (@var);
+create database d7;
+create table d7.t8 (a int);
+select round(rand()*8) into @var;
+insert into d7.t8 values (@var);
+create table d7.t7 (a int);
+select round(rand()*8) into @var;
+insert into d7.t7 values (@var);
+create table d7.t6 (a int);
+select round(rand()*8) into @var;
+insert into d7.t6 values (@var);
+create table d7.t5 (a int);
+select round(rand()*8) into @var;
+insert into d7.t5 values (@var);
+create table d7.t4 (a int);
+select round(rand()*8) into @var;
+insert into d7.t4 values (@var);
+create table d7.t3 (a int);
+select round(rand()*8) into @var;
+insert into d7.t3 values (@var);
+create table d7.t2 (a int);
+select round(rand()*8) into @var;
+insert into d7.t2 values (@var);
+create table d7.t1 (a int);
+select round(rand()*8) into @var;
+insert into d7.t1 values (@var);
+create database d6;
+create table d6.t8 (a int);
+select round(rand()*8) into @var;
+insert into d6.t8 values (@var);
+create table d6.t7 (a int);
+select round(rand()*8) into @var;
+insert into d6.t7 values (@var);
+create table d6.t6 (a int);
+select round(rand()*8) into @var;
+insert into d6.t6 values (@var);
+create table d6.t5 (a int);
+select round(rand()*8) into @var;
+insert into d6.t5 values (@var);
+create table d6.t4 (a int);
+select round(rand()*8) into @var;
+insert into d6.t4 values (@var);
+create table d6.t3 (a int);
+select round(rand()*8) into @var;
+insert into d6.t3 values (@var);
+create table d6.t2 (a int);
+select round(rand()*8) into @var;
+insert into d6.t2 values (@var);
+create table d6.t1 (a int);
+select round(rand()*8) into @var;
+insert into d6.t1 values (@var);
+create database d5;
+create table d5.t8 (a int);
+select round(rand()*8) into @var;
+insert into d5.t8 values (@var);
+create table d5.t7 (a int);
+select round(rand()*8) into @var;
+insert into d5.t7 values (@var);
+create table d5.t6 (a int);
+select round(rand()*8) into @var;
+insert into d5.t6 values (@var);
+create table d5.t5 (a int);
+select round(rand()*8) into @var;
+insert into d5.t5 values (@var);
+create table d5.t4 (a int);
+select round(rand()*8) into @var;
+insert into d5.t4 values (@var);
+create table d5.t3 (a int);
+select round(rand()*8) into @var;
+insert into d5.t3 values (@var);
+create table d5.t2 (a int);
+select round(rand()*8) into @var;
+insert into d5.t2 values (@var);
+create table d5.t1 (a int);
+select round(rand()*8) into @var;
+insert into d5.t1 values (@var);
+create database d4;
+create table d4.t8 (a int);
+select round(rand()*8) into @var;
+insert into d4.t8 values (@var);
+create table d4.t7 (a int);
+select round(rand()*8) into @var;
+insert into d4.t7 values (@var);
+create table d4.t6 (a int);
+select round(rand()*8) into @var;
+insert into d4.t6 values (@var);
+create table d4.t5 (a int);
+select round(rand()*8) into @var;
+insert into d4.t5 values (@var);
+create table d4.t4 (a int);
+select round(rand()*8) into @var;
+insert into d4.t4 values (@var);
+create table d4.t3 (a int);
+select round(rand()*8) into @var;
+insert into d4.t3 values (@var);
+create table d4.t2 (a int);
+select round(rand()*8) into @var;
+insert into d4.t2 values (@var);
+create table d4.t1 (a int);
+select round(rand()*8) into @var;
+insert into d4.t1 values (@var);
+create database d3;
+create table d3.t8 (a int);
+select round(rand()*8) into @var;
+insert into d3.t8 values (@var);
+create table d3.t7 (a int);
+select round(rand()*8) into @var;
+insert into d3.t7 values (@var);
+create table d3.t6 (a int);
+select round(rand()*8) into @var;
+insert into d3.t6 values (@var);
+create table d3.t5 (a int);
+select round(rand()*8) into @var;
+insert into d3.t5 values (@var);
+create table d3.t4 (a int);
+select round(rand()*8) into @var;
+insert into d3.t4 values (@var);
+create table d3.t3 (a int);
+select round(rand()*8) into @var;
+insert into d3.t3 values (@var);
+create table d3.t2 (a int);
+select round(rand()*8) into @var;
+insert into d3.t2 values (@var);
+create table d3.t1 (a int);
+select round(rand()*8) into @var;
+insert into d3.t1 values (@var);
+create database d2;
+create table d2.t8 (a int);
+select round(rand()*8) into @var;
+insert into d2.t8 values (@var);
+create table d2.t7 (a int);
+select round(rand()*8) into @var;
+insert into d2.t7 values (@var);
+create table d2.t6 (a int);
+select round(rand()*8) into @var;
+insert into d2.t6 values (@var);
+create table d2.t5 (a int);
+select round(rand()*8) into @var;
+insert into d2.t5 values (@var);
+create table d2.t4 (a int);
+select round(rand()*8) into @var;
+insert into d2.t4 values (@var);
+create table d2.t3 (a int);
+select round(rand()*8) into @var;
+insert into d2.t3 values (@var);
+create table d2.t2 (a int);
+select round(rand()*8) into @var;
+insert into d2.t2 values (@var);
+create table d2.t1 (a int);
+select round(rand()*8) into @var;
+insert into d2.t1 values (@var);
+create database d1;
+create table d1.t8 (a int);
+select round(rand()*8) into @var;
+insert into d1.t8 values (@var);
+create table d1.t7 (a int);
+select round(rand()*8) into @var;
+insert into d1.t7 values (@var);
+create table d1.t6 (a int);
+select round(rand()*8) into @var;
+insert into d1.t6 values (@var);
+create table d1.t5 (a int);
+select round(rand()*8) into @var;
+insert into d1.t5 values (@var);
+create table d1.t4 (a int);
+select round(rand()*8) into @var;
+insert into d1.t4 values (@var);
+create table d1.t3 (a int);
+select round(rand()*8) into @var;
+insert into d1.t3 values (@var);
+create table d1.t2 (a int);
+select round(rand()*8) into @var;
+insert into d1.t2 values (@var);
+create table d1.t1 (a int);
+select round(rand()*8) into @var;
+insert into d1.t1 values (@var);
+include/diff_tables.inc [master:d8.t8, slave:d8.t8]
+include/diff_tables.inc [master:d8.t7, slave:d8.t7]
+include/diff_tables.inc [master:d8.t6, slave:d8.t6]
+include/diff_tables.inc [master:d8.t5, slave:d8.t5]
+include/diff_tables.inc [master:d8.t4, slave:d8.t4]
+include/diff_tables.inc [master:d8.t3, slave:d8.t3]
+include/diff_tables.inc [master:d8.t2, slave:d8.t2]
+include/diff_tables.inc [master:d8.t1, slave:d8.t1]
+include/diff_tables.inc [master:d7.t8, slave:d7.t8]
+include/diff_tables.inc [master:d7.t7, slave:d7.t7]
+include/diff_tables.inc [master:d7.t6, slave:d7.t6]
+include/diff_tables.inc [master:d7.t5, slave:d7.t5]
+include/diff_tables.inc [master:d7.t4, slave:d7.t4]
+include/diff_tables.inc [master:d7.t3, slave:d7.t3]
+include/diff_tables.inc [master:d7.t2, slave:d7.t2]
+include/diff_tables.inc [master:d7.t1, slave:d7.t1]
+include/diff_tables.inc [master:d6.t8, slave:d6.t8]
+include/diff_tables.inc [master:d6.t7, slave:d6.t7]
+include/diff_tables.inc [master:d6.t6, slave:d6.t6]
+include/diff_tables.inc [master:d6.t5, slave:d6.t5]
+include/diff_tables.inc [master:d6.t4, slave:d6.t4]
+include/diff_tables.inc [master:d6.t3, slave:d6.t3]
+include/diff_tables.inc [master:d6.t2, slave:d6.t2]
+include/diff_tables.inc [master:d6.t1, slave:d6.t1]
+include/diff_tables.inc [master:d5.t8, slave:d5.t8]
+include/diff_tables.inc [master:d5.t7, slave:d5.t7]
+include/diff_tables.inc [master:d5.t6, slave:d5.t6]
+include/diff_tables.inc [master:d5.t5, slave:d5.t5]
+include/diff_tables.inc [master:d5.t4, slave:d5.t4]
+include/diff_tables.inc [master:d5.t3, slave:d5.t3]
+include/diff_tables.inc [master:d5.t2, slave:d5.t2]
+include/diff_tables.inc [master:d5.t1, slave:d5.t1]
+include/diff_tables.inc [master:d4.t8, slave:d4.t8]
+include/diff_tables.inc [master:d4.t7, slave:d4.t7]
+include/diff_tables.inc [master:d4.t6, slave:d4.t6]
+include/diff_tables.inc [master:d4.t5, slave:d4.t5]
+include/diff_tables.inc [master:d4.t4, slave:d4.t4]
+include/diff_tables.inc [master:d4.t3, slave:d4.t3]
+include/diff_tables.inc [master:d4.t2, slave:d4.t2]
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t8, slave:d3.t8]
+include/diff_tables.inc [master:d3.t7, slave:d3.t7]
+include/diff_tables.inc [master:d3.t6, slave:d3.t6]
+include/diff_tables.inc [master:d3.t5, slave:d3.t5]
+include/diff_tables.inc [master:d3.t4, slave:d3.t4]
+include/diff_tables.inc [master:d3.t3, slave:d3.t3]
+include/diff_tables.inc [master:d3.t2, slave:d3.t2]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t8, slave:d2.t8]
+include/diff_tables.inc [master:d2.t7, slave:d2.t7]
+include/diff_tables.inc [master:d2.t6, slave:d2.t6]
+include/diff_tables.inc [master:d2.t5, slave:d2.t5]
+include/diff_tables.inc [master:d2.t4, slave:d2.t4]
+include/diff_tables.inc [master:d2.t3, slave:d2.t3]
+include/diff_tables.inc [master:d2.t2, slave:d2.t2]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t8, slave:d1.t8]
+include/diff_tables.inc [master:d1.t7, slave:d1.t7]
+include/diff_tables.inc [master:d1.t6, slave:d1.t6]
+include/diff_tables.inc [master:d1.t5, slave:d1.t5]
+include/diff_tables.inc [master:d1.t4, slave:d1.t4]
+include/diff_tables.inc [master:d1.t3, slave:d1.t3]
+include/diff_tables.inc [master:d1.t2, slave:d1.t2]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+create database d20;
+create table d20.t1 (a int);
+select round(rand()*8) into @var;
+insert into d20.t1 values (@var);
+create database d19;
+create table d19.t1 (a int);
+select round(rand()*8) into @var;
+insert into d19.t1 values (@var);
+create database d18;
+create table d18.t1 (a int);
+select round(rand()*8) into @var;
+insert into d18.t1 values (@var);
+create database d17;
+create table d17.t1 (a int);
+select round(rand()*8) into @var;
+insert into d17.t1 values (@var);
+create database d16;
+create table d16.t1 (a int);
+select round(rand()*8) into @var;
+insert into d16.t1 values (@var);
+create database d15;
+create table d15.t1 (a int);
+select round(rand()*8) into @var;
+insert into d15.t1 values (@var);
+create database d14;
+create table d14.t1 (a int);
+select round(rand()*8) into @var;
+insert into d14.t1 values (@var);
+create database d13;
+create table d13.t1 (a int);
+select round(rand()*8) into @var;
+insert into d13.t1 values (@var);
+create database d12;
+create table d12.t1 (a int);
+select round(rand()*8) into @var;
+insert into d12.t1 values (@var);
+create database d11;
+create table d11.t1 (a int);
+select round(rand()*8) into @var;
+insert into d11.t1 values (@var);
+create database d10;
+create table d10.t1 (a int);
+select round(rand()*8) into @var;
+insert into d10.t1 values (@var);
+create database d9;
+create table d9.t1 (a int);
+select round(rand()*8) into @var;
+insert into d9.t1 values (@var);
+create database d8;
+create table d8.t1 (a int);
+select round(rand()*8) into @var;
+insert into d8.t1 values (@var);
+create database d7;
+create table d7.t1 (a int);
+select round(rand()*8) into @var;
+insert into d7.t1 values (@var);
+create database d6;
+create table d6.t1 (a int);
+select round(rand()*8) into @var;
+insert into d6.t1 values (@var);
+create database d5;
+create table d5.t1 (a int);
+select round(rand()*8) into @var;
+insert into d5.t1 values (@var);
+create database d4;
+create table d4.t1 (a int);
+select round(rand()*8) into @var;
+insert into d4.t1 values (@var);
+create database d3;
+create table d3.t1 (a int);
+select round(rand()*8) into @var;
+insert into d3.t1 values (@var);
+create database d2;
+create table d2.t1 (a int);
+select round(rand()*8) into @var;
+insert into d2.t1 values (@var);
+create database d1;
+create table d1.t1 (a int);
+select round(rand()*8) into @var;
+insert into d1.t1 values (@var);
+include/diff_tables.inc [master:d20.t1, slave:d20.t1]
+include/diff_tables.inc [master:d19.t1, slave:d19.t1]
+include/diff_tables.inc [master:d18.t1, slave:d18.t1]
+include/diff_tables.inc [master:d17.t1, slave:d17.t1]
+include/diff_tables.inc [master:d16.t1, slave:d16.t1]
+include/diff_tables.inc [master:d15.t1, slave:d15.t1]
+include/diff_tables.inc [master:d14.t1, slave:d14.t1]
+include/diff_tables.inc [master:d13.t1, slave:d13.t1]
+include/diff_tables.inc [master:d12.t1, slave:d12.t1]
+include/diff_tables.inc [master:d11.t1, slave:d11.t1]
+include/diff_tables.inc [master:d10.t1, slave:d10.t1]
+include/diff_tables.inc [master:d9.t1, slave:d9.t1]
+include/diff_tables.inc [master:d8.t1, slave:d8.t1]
+include/diff_tables.inc [master:d7.t1, slave:d7.t1]
+include/diff_tables.inc [master:d6.t1, slave:d6.t1]
+include/diff_tables.inc [master:d5.t1, slave:d5.t1]
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_start_stop.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result	2011-02-27 17:35:25 +0000
@@ -0,0 +1,78 @@
+include/master-slave.inc
+[connection master]
+create view worker_proc_list as SELECT id  from Information_Schema.processlist
+where state like 'Waiting for an event from sql thread%';
+create view coord_proc_list  as SELECT id from Information_Schema.processlist where state like 'Slave has read all relay log%';
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+include/start_slave.inc
+select min(id) from worker_proc_list into @w_id;
+kill query @w_id;
+include/wait_for_slave_sql_to_stop.inc
+include/start_slave.inc
+select id from coord_proc_list into @c_id;
+kill query @c_id;
+include/wait_for_slave_sql_to_stop.inc
+include/start_slave.inc
+CREATE TABLE t1 (a int primary key) engine=innodb;
+insert into t1 values (1),(2);
+insert into t1 values (3);
+insert into t1 values (3);
+include/wait_for_slave_sql_to_stop.inc
+delete from t1 where a=3;
+include/start_slave.inc
+delete from t1;
+insert into t1 values (1),(2),(3);
+create table t2m (a int) engine=myisam;
+insert into t2m values (1);
+begin;
+update t1 set a=31 where a=3;
+insert into t1 values (5),(6),(7);
+begin;
+update t1 set a=20 where a=2;
+insert into t2m values (2);
+update t1 set a=30 where a=3;
+commit;
+update t1 set a=21 where a=2;
+include/wait_for_slave_sql_error.inc [errno=1213, 1205]
+rollback;
+include/start_slave.inc
+stop slave sql_thread;
+set @@global.sql_slave_skip_counter=7;
+begin;
+select max(a) + 1 from t1 into @a;
+insert into t1 set a=@a;
+commit;
+begin;
+select max(a) + 1 from t1 into @a;
+insert into t1 set a=@a;
+commit;
+begin;
+select max(a) + 1 from t1 into @a;
+insert into t1 set a=@a;
+commit;
+set @save.slave_transaction_retries= @@global.slave_transaction_retries;
+set @@global.slave_transaction_retries= 1;
+start slave sql_thread;
+Warnings:
+Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+include/stop_slave.inc
+create table t2 (a int);
+insert into t2 values (1);
+start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
+Warnings:
+Note	1726	UNTIL condtion is not supported in Parallel Slave. Slave is started in the sequential execution mode.
+include/wait_for_slave_sql_to_stop.inc
+include/start_slave.inc
+Warnings:
+Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+drop table t1;
+drop table t2m;
+drop table t2;
+drop view worker_proc_list;
+drop view coord_proc_list;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_transaction_retries= @save.slave_transaction_retries;
+end of the tests
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_parallel_temp_query.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result	2011-02-27 17:35:25 +0000
@@ -0,0 +1,51 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table.*');
+include/stop_slave.inc
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+include/start_slave.inc
+Warnings:
+Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+create database d2;
+use d2;
+create table d2.t1 (a int auto_increment primary key, b int) engine=innodb;
+insert into d2.t1 (b) select count(*) from tt_##;
+create database d1;
+use d1;
+create table d1.t1 (a int auto_increment primary key, b int) engine=innodb;
+insert into d1.t1 (b) select count(*) from tt_##;
+create database d4;
+use d4;
+create table d4.t1 (a int auto_increment primary key, b int) engine=innodb;
+insert into d4.t1 (b) select count(*) from tt_##;
+create database d3;
+use d3;
+create table d3.t1 (a int auto_increment primary key, b int) engine=innodb;
+insert into d3.t1 (b) select count(*) from tt_##;
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+drop temporary table tt_8;
+drop temporary table tt_7;
+drop temporary table tt_6;
+drop temporary table tt_5;
+drop temporary table tt_4;
+drop temporary table tt_3;
+drop temporary table tt_2;
+drop temporary table tt_1;
+drop database d2;
+drop database d1;
+drop temporary table tt_8;
+drop temporary table tt_7;
+drop temporary table tt_6;
+drop temporary table tt_5;
+drop temporary table tt_4;
+drop temporary table tt_3;
+drop temporary table tt_2;
+drop temporary table tt_1;
+drop database d4;
+drop database d3;
+include/stop_slave.inc
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_row_crash_safe.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_crash_safe.result	2010-12-27 18:54:41 +0000
@@ -20,36 +20,9 @@ slave_relay_log_info	CREATE TABLE `slave
   `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
   `Master_log_pos` bigint(20) unsigned NOT NULL,
   `Sql_delay` int(11) NOT NULL,
-  PRIMARY KEY (`Master_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
-SHOW CREATE TABLE mysql.slave_relay_log_info;
-Table	Create Table
-slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
-  `Master_id` int(10) unsigned NOT NULL,
-  `Number_of_lines` int(10) unsigned NOT NULL,
-  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-  `Relay_log_pos` bigint(20) unsigned NOT NULL,
-  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-  `Master_log_pos` bigint(20) unsigned NOT NULL,
-  `Sql_delay` int(11) NOT NULL,
+  `Number_of_workers` int(10) unsigned NOT NULL,
   PRIMARY KEY (`Master_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -62,7 +35,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== modified file 'mysql-test/suite/rpl/r/rpl_row_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result	2010-12-27 18:54:41 +0000
@@ -6,7 +6,6 @@ include/master-slave.inc
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 SET @verbose= 'Y';
 SET @commands= 'configure';
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -19,21 +18,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== added file 'mysql-test/suite/rpl/r/rpl_row_parallel_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_row_parallel_crash_safe.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_parallel_crash_safe.result	2010-12-27 18:54:41 +0000
@@ -0,0 +1,1588 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+###################################################################################
+#                               PREPARE EXECUTION
+###################################################################################
+SET @verbose= 'Y';
+SET @commands= 'configure';
+SHOW CREATE TABLE mysql.slave_relay_log_info;
+Table	Create Table
+slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
+  `Master_id` int(10) unsigned NOT NULL,
+  `Number_of_lines` int(10) unsigned NOT NULL,
+  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Relay_log_pos` bigint(20) unsigned NOT NULL,
+  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Master_log_pos` bigint(20) unsigned NOT NULL,
+  `Sql_delay` int(11) NOT NULL,
+  `Number_of_workers` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`Master_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
+CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
+CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_tt_5_suc";
+END|
+CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_nt_5_suc";
+END|
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+SET @commands= '';
+###################################################################################
+#                         EXECUTE CASES CRASHING THE XID
+###################################################################################
+SET @failures= 'd,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply';
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1);
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1);
+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_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (9, 1);
+fc_i_tt_5_suc (9, 1)
+fc_i_tt_5_suc
+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_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (10, 1);
+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_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (12, 4);
+fc_i_tt_5_suc (12, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (13, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (15, 2);
+fc_i_tt_5_suc (15, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (16, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1);
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1);
+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_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (19, 1);
+fc_i_tt_5_suc (19, 1)
+fc_i_tt_5_suc
+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_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (20, 1);
+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_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (22, 4);
+fc_i_tt_5_suc (22, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (23, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (25, 2);
+fc_i_tt_5_suc (25, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (26, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1);
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1);
+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_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (29, 1);
+fc_i_tt_5_suc (29, 1)
+fc_i_tt_5_suc
+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_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (30, 1);
+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_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (32, 4);
+fc_i_tt_5_suc (32, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (33, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (35, 2);
+fc_i_tt_5_suc (35, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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: #
+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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (36, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.tt_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 */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+###################################################################################
+#                      EXECUTE CASES CRASHING THE BEGIN/COMMIT
+###################################################################################
+SET @failures= 'd,crash_after_commit_and_update_pos';
+
+
+
+SET @commands= 'N';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'N-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_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	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_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	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'N-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_nt_5_suc (39, 1);
+fc_i_nt_5_suc (39, 1)
+fc_i_nt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.nt_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: #
+master-bin.000001	#	Write_rows	#	#	table_id: #
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+###################################################################################
+#                               CHECK CONSISTENCY
+###################################################################################
+###################################################################################
+#                                        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_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+DROP FUNCTION fc_i_tt_5_suc;
+DROP FUNCTION fc_i_nt_5_suc;
+SET @commands= '';
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/r/rpl_sequential.result'
--- a/mysql-test/suite/rpl/r/rpl_sequential.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_sequential.result	2011-04-06 12:51:58 +0000
@@ -0,0 +1,84 @@
+include/master-slave.inc
+[connection master]
+set @save.mts_slave_parallel_workers= 0;
+select @@global.mts_slave_parallel_workers as 'zero';
+zero
+0
+call mtr.add_suppression('Slave: Error dropping database');
+include/stop_slave.inc
+start slave;
+stop slave sql_thread;
+use test;
+select * from test0.benchmark into outfile 'benchmark.out';
+select ts from test0.benchmark where state like 'master started load' into @m_0;
+select ts from test0.benchmark where state like 'master ends load' into @m_1;
+select ts from test0.benchmark where state like 'slave takes on load' into @s_0;
+select ts from test0.benchmark where state like 'slave ends load' into @s_1;
+select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta_m', 
+time_to_sec(@s_1) - time_to_sec(@s_0) as 'delta_s' into outfile 'delta.out';
+include/diff_tables.inc [master:test15.v_tm_nk, slave:test15.v_tm_nk]
+include/diff_tables.inc [master:test15.v_ti_nk, slave:test15.v_ti_nk]
+include/diff_tables.inc [master:test15.v_tm_wk, slave:test15.v_tm_wk]
+include/diff_tables.inc [master:test15.v_ti_wk, slave:test15.v_ti_wk]
+include/diff_tables.inc [master:test14.v_tm_nk, slave:test14.v_tm_nk]
+include/diff_tables.inc [master:test14.v_ti_nk, slave:test14.v_ti_nk]
+include/diff_tables.inc [master:test14.v_tm_wk, slave:test14.v_tm_wk]
+include/diff_tables.inc [master:test14.v_ti_wk, slave:test14.v_ti_wk]
+include/diff_tables.inc [master:test13.v_tm_nk, slave:test13.v_tm_nk]
+include/diff_tables.inc [master:test13.v_ti_nk, slave:test13.v_ti_nk]
+include/diff_tables.inc [master:test13.v_tm_wk, slave:test13.v_tm_wk]
+include/diff_tables.inc [master:test13.v_ti_wk, slave:test13.v_ti_wk]
+include/diff_tables.inc [master:test12.v_tm_nk, slave:test12.v_tm_nk]
+include/diff_tables.inc [master:test12.v_ti_nk, slave:test12.v_ti_nk]
+include/diff_tables.inc [master:test12.v_tm_wk, slave:test12.v_tm_wk]
+include/diff_tables.inc [master:test12.v_ti_wk, slave:test12.v_ti_wk]
+include/diff_tables.inc [master:test11.v_tm_nk, slave:test11.v_tm_nk]
+include/diff_tables.inc [master:test11.v_ti_nk, slave:test11.v_ti_nk]
+include/diff_tables.inc [master:test11.v_tm_wk, slave:test11.v_tm_wk]
+include/diff_tables.inc [master:test11.v_ti_wk, slave:test11.v_ti_wk]
+include/diff_tables.inc [master:test10.v_tm_nk, slave:test10.v_tm_nk]
+include/diff_tables.inc [master:test10.v_ti_nk, slave:test10.v_ti_nk]
+include/diff_tables.inc [master:test10.v_tm_wk, slave:test10.v_tm_wk]
+include/diff_tables.inc [master:test10.v_ti_wk, slave:test10.v_ti_wk]
+include/diff_tables.inc [master:test9.v_tm_nk, slave:test9.v_tm_nk]
+include/diff_tables.inc [master:test9.v_ti_nk, slave:test9.v_ti_nk]
+include/diff_tables.inc [master:test9.v_tm_wk, slave:test9.v_tm_wk]
+include/diff_tables.inc [master:test9.v_ti_wk, slave:test9.v_ti_wk]
+include/diff_tables.inc [master:test8.v_tm_nk, slave:test8.v_tm_nk]
+include/diff_tables.inc [master:test8.v_ti_nk, slave:test8.v_ti_nk]
+include/diff_tables.inc [master:test8.v_tm_wk, slave:test8.v_tm_wk]
+include/diff_tables.inc [master:test8.v_ti_wk, slave:test8.v_ti_wk]
+include/diff_tables.inc [master:test7.v_tm_nk, slave:test7.v_tm_nk]
+include/diff_tables.inc [master:test7.v_ti_nk, slave:test7.v_ti_nk]
+include/diff_tables.inc [master:test7.v_tm_wk, slave:test7.v_tm_wk]
+include/diff_tables.inc [master:test7.v_ti_wk, slave:test7.v_ti_wk]
+include/diff_tables.inc [master:test6.v_tm_nk, slave:test6.v_tm_nk]
+include/diff_tables.inc [master:test6.v_ti_nk, slave:test6.v_ti_nk]
+include/diff_tables.inc [master:test6.v_tm_wk, slave:test6.v_tm_wk]
+include/diff_tables.inc [master:test6.v_ti_wk, slave:test6.v_ti_wk]
+include/diff_tables.inc [master:test5.v_tm_nk, slave:test5.v_tm_nk]
+include/diff_tables.inc [master:test5.v_ti_nk, slave:test5.v_ti_nk]
+include/diff_tables.inc [master:test5.v_tm_wk, slave:test5.v_tm_wk]
+include/diff_tables.inc [master:test5.v_ti_wk, slave:test5.v_ti_wk]
+include/diff_tables.inc [master:test4.v_tm_nk, slave:test4.v_tm_nk]
+include/diff_tables.inc [master:test4.v_ti_nk, slave:test4.v_ti_nk]
+include/diff_tables.inc [master:test4.v_tm_wk, slave:test4.v_tm_wk]
+include/diff_tables.inc [master:test4.v_ti_wk, slave:test4.v_ti_wk]
+include/diff_tables.inc [master:test3.v_tm_nk, slave:test3.v_tm_nk]
+include/diff_tables.inc [master:test3.v_ti_nk, slave:test3.v_ti_nk]
+include/diff_tables.inc [master:test3.v_tm_wk, slave:test3.v_tm_wk]
+include/diff_tables.inc [master:test3.v_ti_wk, slave:test3.v_ti_wk]
+include/diff_tables.inc [master:test2.v_tm_nk, slave:test2.v_tm_nk]
+include/diff_tables.inc [master:test2.v_ti_nk, slave:test2.v_ti_nk]
+include/diff_tables.inc [master:test2.v_tm_wk, slave:test2.v_tm_wk]
+include/diff_tables.inc [master:test2.v_ti_wk, slave:test2.v_ti_wk]
+include/diff_tables.inc [master:test1.v_tm_nk, slave:test1.v_tm_nk]
+include/diff_tables.inc [master:test1.v_ti_nk, slave:test1.v_ti_nk]
+include/diff_tables.inc [master:test1.v_tm_wk, slave:test1.v_tm_wk]
+include/diff_tables.inc [master:test1.v_ti_wk, slave:test1.v_ti_wk]
+include/diff_tables.inc [master:test0.v_tm_nk, slave:test0.v_tm_nk]
+include/diff_tables.inc [master:test0.v_ti_nk, slave:test0.v_ti_nk]
+include/diff_tables.inc [master:test0.v_tm_wk, slave:test0.v_tm_wk]
+include/diff_tables.inc [master:test0.v_ti_wk, slave:test0.v_ti_wk]
+set @@global.mts_exp_slave_local_timestamp= @save.mts_exp_slave_local_timestamp;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result	2010-12-27 18:54:41 +0000
@@ -20,36 +20,9 @@ slave_relay_log_info	CREATE TABLE `slave
   `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
   `Master_log_pos` bigint(20) unsigned NOT NULL,
   `Sql_delay` int(11) NOT NULL,
-  PRIMARY KEY (`Master_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
-SHOW CREATE TABLE mysql.slave_relay_log_info;
-Table	Create Table
-slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
-  `Master_id` int(10) unsigned NOT NULL,
-  `Number_of_lines` int(10) unsigned NOT NULL,
-  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-  `Relay_log_pos` bigint(20) unsigned NOT NULL,
-  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-  `Master_log_pos` bigint(20) unsigned NOT NULL,
-  `Sql_delay` int(11) NOT NULL,
+  `Number_of_workers` int(10) unsigned NOT NULL,
   PRIMARY KEY (`Master_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -62,7 +35,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result	2010-12-27 18:54:41 +0000
@@ -6,7 +6,6 @@ include/master-slave.inc
 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 SET @verbose= 'Y';
 SET @commands= 'configure';
-SET SQL_LOG_BIN=0;
 CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
 CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -19,21 +18,6 @@ CREATE TABLE tt_3 (trans_id INT, stmt_id
 CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
 CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-SET SQL_LOG_BIN=1;
 INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
 INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);

=== added file 'mysql-test/suite/rpl/r/rpl_stm_parallel_crash_safe.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_parallel_crash_safe.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_parallel_crash_safe.result	2010-12-27 18:54:41 +0000
@@ -0,0 +1,1276 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+###################################################################################
+#                               PREPARE EXECUTION
+###################################################################################
+SET @verbose= 'Y';
+SET @commands= 'configure';
+SHOW CREATE TABLE mysql.slave_relay_log_info;
+Table	Create Table
+slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
+  `Master_id` int(10) unsigned NOT NULL,
+  `Number_of_lines` int(10) unsigned NOT NULL,
+  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Relay_log_pos` bigint(20) unsigned NOT NULL,
+  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  `Master_log_pos` bigint(20) unsigned NOT NULL,
+  `Sql_delay` int(11) NOT NULL,
+  `Number_of_workers` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`Master_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
+CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
+CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
+INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
+CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+END|
+CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_tt_5_suc";
+END|
+CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
+RETURN "fc_i_nt_5_suc";
+END|
+CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
+BEGIN
+DECLARE in_stmt_id INTEGER;
+SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
+SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
+INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
+END|
+SET @commands= '';
+###################################################################################
+#                         EXECUTE CASES CRASHING THE XID
+###################################################################################
+SET @failures= 'd,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply';
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1);
+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_5(trans_id, stmt_id) VALUES (8, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (9, 1);
+fc_i_tt_5_suc (9, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (10, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (12, 4);
+fc_i_tt_5_suc (12, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (13, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (15, 2);
+fc_i_tt_5_suc (15, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_apply";;
+FAILURE d,crash_after_apply and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (16, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1);
+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_5(trans_id, stmt_id) VALUES (18, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (19, 1);
+fc_i_tt_5_suc (19, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (20, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (22, 4);
+fc_i_tt_5_suc (22, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (23, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (25, 2);
+fc_i_tt_5_suc (25, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_before_update_pos";;
+FAILURE d,crash_before_update_pos and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (26, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1);
+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_5(trans_id, stmt_id) VALUES (28, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (29, 1);
+fc_i_tt_5_suc (29, 1)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'T-proc';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (30, 1);
+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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-trig C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-func C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (32, 4);
+fc_i_tt_5_suc (32, 4)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T T-proc C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (33, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-trig T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-func T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_tt_5_suc (35, 2);
+fc_i_tt_5_suc (35, 2)
+fc_i_tt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'B T-proc T C';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
+FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
+-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
+BEGIN;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
+CALL pc_i_tt_5_suc (36, 2);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
+COMMIT;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+###################################################################################
+#                      EXECUTE CASES CRASHING THE BEGIN/COMMIT
+###################################################################################
+SET @failures= 'd,crash_after_commit_and_update_pos';
+
+
+
+SET @commands= 'N';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'N-trig';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1);
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+
+
+
+SET @commands= 'N-func';
+STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
+FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+SELECT fc_i_nt_5_suc (39, 1);
+fc_i_nt_5_suc (39, 1)
+fc_i_nt_5_suc
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
+master-bin.000001	#	Query	#	#	COMMIT
+-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
+
+include/rpl_reconnect.inc
+START SLAVE;
+include/wait_for_slave_to_start.inc
+###################################################################################
+#                               CHECK CONSISTENCY
+###################################################################################
+###################################################################################
+#                                        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_5_suc;
+DROP PROCEDURE pc_i_nt_5_suc;
+DROP FUNCTION fc_i_tt_5_suc;
+DROP FUNCTION fc_i_nt_5_suc;
+SET @commands= '';
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_migration_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_migration_crash_safe.test	2010-12-20 14:27:17 +0000
+++ b/mysql-test/suite/rpl/t/rpl_migration_crash_safe.test	2010-12-27 18:54:41 +0000
@@ -40,6 +40,7 @@
 --source include/not_embedded.inc
 --source include/not_valgrind.inc
 --source include/not_relay_log_info_table.inc
+--source include/not_mts_slave_parallel_workers.inc
 
 --connection slave
 

=== added file 'mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt.THIS'
--- a/mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt.THIS	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_crash_safe-slave.opt.THIS	2010-12-27 18:54:41 +0000
@@ -0,0 +1 @@
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --relay-log-recovery=1

=== added file 'mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS'
--- a/mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS	2010-12-27 18:54:41 +0000
@@ -0,0 +1,15 @@
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+--source include/not_mts_slave_parallel_workers.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+
+--source extra/rpl_tests/rpl_crash_safe.test

=== added file 'mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe-slave.opt	2010-12-22 19:19:17 +0000
@@ -0,0 +1 @@
+--mts-slave-parallel-workers=5 --skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --worker-info-repository=TABLE --worker-info-engine=innodb --slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_parallel_crash_safe.test	2010-12-27 18:54:41 +0000
@@ -0,0 +1,16 @@
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+
+--source extra/rpl_tests/rpl_crash_safe.test
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_packet.test'
--- a/mysql-test/suite/rpl/t/rpl_packet.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_packet.test	2011-02-27 17:35:25 +0000
@@ -63,8 +63,20 @@ connection master;
 
 # Change the max packet size on master
 
-SET @@global.max_allowed_packet=4096;
-SET @@global.net_buffer_length=4096;
+# Todo: improve over-max_allowed_packet size events block on the slave.
+# The current size checking algorithm is not presize to allow large event
+# to slip it. Reject happens according to the guard:
+#   if (data_len > max(max_allowed_packet,
+#       opt_binlog_rows_event_max_size + MAX_LOG_EVENT_HEADER))
+# However, MAX_LOG_EVENT_HEADER is a conservative estimate so if the actual
+# header size is less the extra data let in the slave.
+
+# Adding the max size of the query log event status as
+# MAX_DBS_IN_QUERY_MTS * (1 + NAME_LEN) to make the master not fail to read
+# an event itself.
+
+SET @@global.max_allowed_packet=4096 + (floor(64 * 3 * 254 / 1024) + 1) * 1024;
+SET @@global.net_buffer_length=@@global.max_allowed_packet;
 
 # Restart slave for new setting to take effect
 connection slave;
@@ -82,7 +94,7 @@ sync_slave_with_master;
 
 connection master;
 
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+INSERT INTO t1 VALUES (REPEAT('a', @@global.max_allowed_packet));
 
 
 #
@@ -169,6 +181,7 @@ if (`SELECT NOT(@max_allowed_packet_0 = 
 #
 
 connection slave;
+
 START SLAVE;
 --source include/wait_for_slave_to_start.inc
 
@@ -186,7 +199,7 @@ CREATE TABLE t1 (a TEXT) ENGINE=MyISAM;
 
 # Create big row event.
 --connection master
-INSERT INTO t1 VALUES (REPEAT('a', 2048));
+INSERT INTO t1 VALUES (REPEAT('a', @@global.max_allowed_packet));
 
 # Slave IO thread should stop with error when trying to read the big event.
 --connection slave

=== added file 'mysql-test/suite/rpl/t/rpl_parallel-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel-master.opt	2010-12-16 21:41:45 +0000
@@ -0,0 +1 @@
+--log-warnings=0

=== added file 'mysql-test/suite/rpl/t/rpl_parallel-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel-slave.opt	2011-05-06 18:33:32 +0000
@@ -0,0 +1 @@
+ --log-warnings=0 --slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_parallel.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test	2011-05-06 18:33:32 +0000
@@ -0,0 +1,42 @@
+#
+# WL#5563 Prototype for Parallel Slave with db name partitioning.
+#
+# The test checks correctness of replication and is designed for 
+# benchmarking and comparision with results of its sequential
+# counterpart rpl_sequential.test.
+# Both tests leave mysqld.2/data/test/delta.out file
+# that contains a row with two columns.
+#  1. the duration (in seconds) of execution on the master
+#  2. the duration of execution on the slave
+#  The 2nd column of the rpl_parallel can be compared with the 2nd of rpl_sequential.test.
+#
+#  The duration recorded in the file accounts the SQL thread/workers work.
+#  That is benchmarking on the slave side is effectively started with
+#  `start slave sql_thread'.
+#  NOTICE, there is set @@global.slave_local_timestamp=1;
+#  
+#
+# of load that rpl_parallel_load.test represents.
+# See there how to tune load and concurrency parameters.
+#
+# Example of usage.
+# To gather a collection of figures:
+#  mysql-test$ export slave;
+#  mysql-test$ slave=parallel; for n in `seq 1 10`; 
+#  do ./mtr  --vardir=/dev/shm/var1 --mtr-build-thread=765 rpl_$slave 
+#             --mysqld=--binlog-format=statement; 
+#     find /dev/shm/var1 -name delta.out -exec cat {} \; | cat >> delta.$slave.log; 
+#  done
+#
+# mysql-test$ slave=sequential; ...
+#
+# In the end there will be mysql-test/delta.{parallel,sequential}.log files.
+#
+
+let $rpl_skip_reset_master_and_slave= 1;
+--source include/master-slave.inc
+
+connection master;
+source extra/rpl_tests/rpl_parallel_load.test;
+
+--source include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_benchmark-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_benchmark-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_benchmark-master.opt	2011-04-02 11:32:02 +0000
@@ -0,0 +1 @@
+--log-warnings=0

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_benchmark-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_benchmark-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_benchmark-slave.opt	2011-04-02 11:32:02 +0000
@@ -0,0 +1,3 @@
+--skip-log-bin --skip-log-slave-updates --log-warnings=0 --slave-transaction-retries=0
+
+

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_benchmark.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_benchmark.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_benchmark.test	2011-04-02 11:32:02 +0000
@@ -0,0 +1,57 @@
+#
+# WL#5563 Prototype for Parallel Slave with db name partitioning.
+#
+# The test checks correctness of replication and is designed for 
+# benchmarking and comparision with results of its sequential
+# counterpart rpl_sequential.test.
+# Both tests leave mysqld.2/data/test/delta.out file
+# that contains a row with two columns.
+#  1. the duration (in seconds) of execution on the master
+#  2. the duration of execution on the slave
+#  The 2nd column of the rpl_parallel can be compared with the 2nd of rpl_sequential.test.
+#
+#  The duration recorded in the file accounts the SQL thread/workers work.
+#  That is benchmarking on the slave side is effectively started with
+#  `start slave sql_thread'.
+#  NOTICE, there is set @@global.slave_local_timestamp=1;
+#  
+#
+# of load that rpl_parallel_load.test represents.
+# See there how to tune load and concurrency parameters.
+#
+# Example of usage.
+# To gather a collection of figures:
+#  mysql-test$ export slave;
+#  mysql-test$ slave=parallel; for n in `seq 1 10`; 
+#  do ./mtr  --vardir=/dev/shm/var1 --mtr-build-thread=765 rpl_$slave 
+#             --mysqld=--binlog-format=statement; 
+#     find /dev/shm/var1 -name delta.out -exec cat {} \; | cat >> delta.$slave.log; 
+#  done
+#
+# mysql-test$ slave=sequential; ...
+#
+# In the end there will be mysql-test/delta.{parallel,sequential}.log files.
+#
+
+let $rpl_skip_reset_master_and_slave= 1;
+
+--source include/master-slave.inc
+
+connection slave;
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+###select @@global.mts_slave_parallel_workers as 'non-zero means parallel';
+
+let $workers = `select @@global.mts_slave_parallel_workers`;
+###let $databases= $workers;
+# workers vary db:s do not
+let $databases= 16;
+
+connection master;
+source extra/rpl_tests/rpl_parallel_benchmark_load.test;
+
+connection slave;
+--disable_query_log
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+--enable_result_log
+
+--source include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_conf_limits-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_conf_limits-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_conf_limits-slave.opt	2010-12-23 10:35:28 +0000
@@ -0,0 +1 @@
+--slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test	2010-12-27 18:54:41 +0000
@@ -0,0 +1,214 @@
+#
+# WL#5569 MTS
+#
+# The test verifies correctness of MTS execution when system meets
+# various limits due to few configuration options:
+#
+# @@global.mts_pending_jobs_size_max
+# @@global.mts_slave_worker_queue_len_max
+# @@global.mts_partition_hash_soft_max
+
+--source include/master-slave.inc
+# no support for Query-log-event in this test
+--source include/have_binlog_format_row.inc
+
+connection slave;
+
+create view coord_wait_list as
+       SELECT id from Information_Schema.processlist
+              where state like 'Waiting for Slave Worker%';
+
+# restart in Parallel
+source include/stop_slave.inc;
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+
+
+# max len of WQ
+set @save_mts_slave_worker_queue_len_max= @@global.mts_slave_worker_queue_len_max;
+set @@global.mts_slave_worker_queue_len_max= 5;
+source include/start_slave.inc;
+
+
+connection master;
+create database d0;
+create table d0.t1 (a int auto_increment primary key) engine=innodb;
+
+
+sync_slave_with_master;
+
+begin;
+insert into d0.t1 set a=null; # lock a row that master has inserted into
+
+
+connection master;
+
+begin;
+
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+insert into d0.t1 set a=null;
+
+commit;
+
+let $d0_t1_count=`select count(*) from d0.t1`;
+
+connection slave;
+
+--echo *** Coordinator must be waiting a for Worker to process its queue ***
+
+let $count= 1;
+let $table= coord_wait_list;
+source include/wait_until_rows_count.inc;
+
+rollback;
+
+let $count= $d0_t1_count;
+let $table= d0.t1;
+source include/wait_until_rows_count.inc;
+
+# cleanup of the max len
+set @@global.mts_slave_worker_queue_len_max= @save_mts_slave_worker_queue_len_max;
+
+
+#
+# Max size of Worker queues
+#
+
+--let $mts_max_q_size=1024
+
+connection slave;
+
+source include/stop_slave.inc;
+set @save_mts_pending_jobs_size_max = @@global.mts_pending_jobs_size_max;
+eval set @@global.mts_pending_jobs_size_max= $mts_max_q_size;
+source include/start_slave.inc;
+
+connection master;
+create table d0.t2 (a int auto_increment primary key, b text null) engine=innodb;
+
+sync_slave_with_master;
+
+
+begin;
+insert into d0.t2 set a= 1;
+
+# master trans structure aims at testing C's wait loop
+
+let $i_loop= 10;
+
+connection master;
+
+begin;
+--disable_query_log
+  eval insert into d0.t2 set a= 1, b=  REPEAT('b', 1);
+
+while ($i_loop)
+{
+  eval insert into d0.t2 set       b=  REPEAT('b', 1);
+  eval insert into d0.t2 set       b=  REPEAT('b', 1);
+  eval insert into d0.t2 set       b=  REPEAT('b', 1);
+  eval insert into d0.t2 set       b=  REPEAT('b', 1);
+  eval insert into d0.t2 set       b=  REPEAT('b', 1);
+  eval insert into d0.t2 set       b=  REPEAT('b', 1);
+  eval insert into d0.t2 set       b=  REPEAT('b', 2* $mts_max_q_size/3);
+  dec $i_loop;
+}
+--enable_query_log
+commit;
+
+let $d0_t2_count=`select count(*) from d0.t2`;
+
+connection slave;
+
+--echo *** Coordinator must be waiting for Workers have released pending events mem ***
+
+let $count= 1;
+let $table= coord_wait_list;
+source include/wait_until_rows_count.inc;
+
+rollback;
+
+let $count= $d0_t2_count;
+let $table= d0.t2;
+source include/wait_until_rows_count.inc;
+
+# cleanup of the max len
+set @@global.mts_pending_jobs_size_max= @save_mts_pending_jobs_size_max;
+
+#
+# Number of records in the mts partition hash below which
+# entries with zero usage are tolerated.
+# The test ensures slave's stable execution.
+#
+
+# force eager garbage collecting
+set @save.mts_partition_hash_soft_max= @@global.mts_partition_hash_soft_max;
+set @@global.mts_partition_hash_soft_max= 0;
+
+let $databases= 16;
+
+connection master;
+
+let $i= $databases;
+while ($i)
+{
+  eval create database d$i;
+  eval create table d$i.t1 (a int auto_increment primary key) engine=innodb;
+  dec $i;
+}
+
+# loading slave with $databases number of parallelizable transaction
+# each leaving a dummy record after is completed on the slave
+
+let $i= $databases;
+while ($i)
+{
+  begin;
+  eval insert into d$i.t1 set a=null;
+  eval insert into d$i.t1 set a=null;
+  eval insert into d$i.t1 set a=null;
+  eval insert into d$i.t1 set a=null;
+  commit;
+
+  dec $i;
+}
+
+sync_slave_with_master;
+
+set @@global.mts_partition_hash_soft_max= @save.mts_partition_hash_soft_max;
+
+connection master;
+
+let $i= $databases;
+while ($i)
+{
+  eval drop database d$i;
+  dec $i;
+}
+
+
+#connection slave;
+sync_slave_with_master;
+
+
+#
+# cleanup
+#
+
+connection master;
+
+drop database d0;
+
+
+sync_slave_with_master;
+#connection slave;
+
+drop view coord_wait_list;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+
+--source include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_conflicts-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_conflicts-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_conflicts-slave.opt	2010-12-23 10:35:28 +0000
@@ -0,0 +1 @@
+--slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_conflicts.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test	2010-12-27 18:54:41 +0000
@@ -0,0 +1,216 @@
+#
+# WL#5569 MTS
+#
+# The test checks cases of hashing conflicts forcing a special hanling.
+# The cases include
+#
+# I. two Worker jobs conflict to each other
+#
+#   a. two multi-statement transactions containing more than one partition
+#      in which one is common are mapped to different Workers.
+#   b. similarly two autocommit queries or ddl:s
+#
+# Handling of the cases is carried out as the following:
+# when Coordinator hits to an occupied by not the currenly assigned Worker
+# partition it marks the partition and goes to wait till the Worker-owner
+# has released it and signaled.
+#
+# II. An event requires the sequential execution
+#
+# Coordinator does not schedule the event and is waiting till all workers have 
+# released their partitions and signalled.
+
+--source include/master-slave.inc
+
+# 
+#  Testing with the statement format requires 
+#  @@global.slave_run_query_in_parallel = 1.
+#  Notice, parallelization for Query-log-event is limitted
+#  to the default dababase. That's why 'use db'.
+#  With the default @@global.slave_run_query_in_parallel == 0
+#  the tests in stmt format still run to prove switching to the sequential.
+
+#  TODO: convert this file into two tests for either value of 
+#        @@global.slave_run_query_in_parallel
+--source include/have_binlog_format_row.inc
+
+connection slave;
+
+--disable_query_log
+--disable_result_log
+call mtr.add_suppression('Error reading slave worker configuration');
+--enable_query_log
+--enable_result_log
+
+create view coord_wait_list  as SELECT id from Information_Schema.processlist where state like 'Waiting for Slave Worker%';
+
+source include/stop_slave.inc;
+
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+
+source include/start_slave.inc;
+
+
+connection master;
+
+create database d1;
+create database d2;
+create database d3;
+create table d1.t1 (a int auto_increment primary key) engine=innodb;
+create table d2.t1 (a int auto_increment primary key) engine=innodb;
+create table d3.t1 (a int auto_increment primary key) engine=innodb;
+
+#
+
+# I. Two parallel jobs conflict
+#
+# two conflicting jobs to follow
+
+sync_slave_with_master;
+# To be really conflicting slave needs to block commit of the first.
+#connection slave;
+
+begin;
+insert into d2.t1 values (1);
+
+connection master;
+
+# Job_1
+begin;
+use d1;
+insert into d1.t1 values (null);
+use d2;
+insert into d2.t1 values (1);   # will be block at this point on Worker
+commit;
+
+# Job_2
+begin;
+use d3;
+insert into d3.t1 values (null);
+use d1;
+insert into d1.t1 values (null); #  will be block at this point on Coord
+commit;
+
+connection slave;
+
+--echo *** Coordinator must be in waiting for a Worker to unassign from a partition ***
+
+let $count= 1;
+let $table= coord_wait_list;
+source include/wait_until_rows_count.inc;
+
+# release the Worker
+rollback;
+
+let $count= 2;
+let $table= d1.t1;
+source include/wait_until_rows_count.inc;
+
+
+#
+# II. The only-sequential conflicts with ongoing parallel applying
+#
+
+# a. DDL waits for all workers have processed their earlier scheduled assignments
+
+connection slave1;
+
+# fix the tables status. Tables are supposed to exist, possibly with data left
+# after previous part.
+
+select count(*) from d1.t1 into @d1;
+select count(*) from d2.t1 into @d2;
+select count(*) from d3.t1 into @d3;
+use d1;
+create table `exists_only_on_slave` (a int);
+
+connection slave;
+
+# put in the way of workers blocking load
+
+begin;
+insert into d1.t1 values (null);
+insert into d2.t1 values (null);
+insert into d3.t1 values (null);
+
+connection master;
+
+# Job_1
+begin;
+use d1;
+insert into d1.t1 values (null);
+commit;
+
+# Job_2
+begin;
+use d2;
+insert into d2.t1 values (null);
+commit;
+
+
+# Job_3
+begin;
+use d3;
+insert into d3.t1 values (null);
+commit;
+
+--disable_warnings
+use d1;
+drop table if exists `exists_only_on_slave`;
+--enable_warnings
+
+
+connection slave1;
+
+select sleep(1);  # give Workers a little time to process (but they won't)
+
+select count(*) - @d1 as 'zero' from d1.t1;
+select count(*) - @d2 as 'zero' from d2.t1;
+select count(*) - @d3 as 'zero' from d3.t1;
+
+# proof the master DDL has not got through
+use d1;
+select count(*) as 'zero' from `exists_only_on_slave`;
+
+connection slave;
+
+rollback; # release workers
+
+connection slave1;
+
+# to finish up with getting all committed.
+
+let $count= `select @d1 + 1`;
+let $table= d1.t1;
+source include/wait_until_rows_count.inc;
+
+let $count= `select @d2 + 1`;
+let $table= d2.t1;
+source include/wait_until_rows_count.inc;
+
+let $count= `select @d3 + 1`;
+let $table= d3.t1;
+source include/wait_until_rows_count.inc;
+connection slave;
+
+
+#
+# cleanup
+#
+
+connection master;
+
+drop database d1;
+drop database d2;
+drop database d3;
+
+sync_slave_with_master;
+#connection slave;
+
+drop view coord_wait_list;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+
+--echo *** End of the tests ***
+
+--source include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_ddl.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_ddl.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_ddl.test	2011-02-27 17:35:25 +0000
@@ -0,0 +1,256 @@
+#
+# WL#5569 MTS
+#
+# The test verifies correctness of DDL Query event parallelization
+#
+
+
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+
+
+# restart in Parallel
+
+let $workers= 4;
+
+connection slave;
+
+source include/stop_slave.inc;
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+eval set @@global.mts_slave_parallel_workers= $workers;
+
+# Note, the number of db:s should be greater than MAX_DBS_IN_QUERY_MTS
+# in order to satisfy to the over-max final test.
+let $dbs= 32;
+let $tables= 8;
+let $queries= `select $dbs*$tables * 8`;
+
+#
+# D1. CREATE/DROP database
+#
+#
+# D2. CREATE/DROP/ALTER/RENAME table
+#
+
+--disable_query_log
+
+let $n= $dbs;
+while ($n)
+{
+  connection master;
+  eval create database d$n;
+
+  let $m= $tables;
+  while ($m)
+  {
+     eval create table d$n.t$m (a int);
+     eval select round(rand()*$tables) into @var;
+     eval insert into d$n.t$m values (@var);
+
+     dec $m;
+  }
+  dec $n;
+
+  connection master1;
+  eval create database d$n;
+
+  let $m= $tables;
+  while ($m)
+  {
+     eval create table d$n.t$m (a int);
+     eval select round(rand()*$tables) into @var;
+     eval insert into d$n.t$m values (@var);
+
+     dec $m;
+  }
+  dec $n;
+}
+
+
+let $k= $queries;
+
+while ($k)
+{
+   let $n_1 = `select floor(rand()*$dbs) + 1`;
+   let $n_2 = `select floor(rand()*$dbs) + 1`;
+   let $n1_1= `select floor(rand()*$dbs) + 1`;
+   let $n1_2= `select floor(rand()*$dbs) + 1`;
+   let $m= `select floor(rand()*$tables) + 1`;
+
+   --error 0,ER_TABLE_EXISTS_ERROR
+   eval rename table d$n_1.t$m to d$n1_1.t$m, d$n_2.t$m to d$n1_2.t$m;
+   --error 0,ER_TABLE_EXISTS_ERROR
+   eval rename table d$n1_1.t$m to d$n_1.t$m,  d$n1_2.t$m to d$n_2.t$m;
+
+   dec $k;
+}
+
+--enable_query_log
+
+#
+# D3. CREATE/DROP Stored Proc, Stored Func, Trigger, Func
+
+connection master;
+
+let $n= $dbs;
+# n'th db tables won't have any trigger to avoid circular dependency
+let $n1= $n;
+dec $n1;
+
+--disable_query_log
+
+while ($n1)
+{
+  let $m= $tables;
+
+  while ($m)
+  {
+     eval create trigger `d$n1`.`trg_t$m` before insert on `d$n1`.`t$m` for each row insert into `d$n`.`t$m` values(1);
+
+     delimiter |;
+
+     eval create function `d$n`.`func_$m` (a int) returns int
+          begin
+	  insert into `d$n`.`t$m` values(1);
+	  return 1;
+	  end|
+
+     eval create procedure `d$n`.`proc_$m`(a int)
+          begin
+	  insert into `d$n`.`t$m` values(1);
+	  end|
+	  
+     delimiter ;|
+
+     dec $m;
+  }
+  dec $n;
+  dec $n1;
+}
+
+#
+# D3. CREATE/ALTER/DROP event
+#
+
+CREATE EVENT d1.e_1 on schedule every '50:20:12:45' day_second do select 1;
+ALTER EVENT d1.e_1 RENAME to d2.e_2;
+DROP EVENT d2.e_2;
+
+#
+# D4. CREATE/DROP view
+#
+
+CREATE VIEW d1.v_1 AS SELECT 1;
+CREATE VIEW d2.v_2 AS SELECT 1;
+DROP VIEW d1.v_1, d2.v_2;
+
+--enable_query_log
+
+
+#
+# Run it on slave;
+#
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#
+# Consistency check
+#
+
+let $n = $dbs;
+while($n)
+{
+  let $m= $tables;
+  while ($m)
+  {
+    let $diff_tables=master:d$n.t$m, slave:d$n.t$m;
+    source include/diff_tables.inc;
+    dec $m;
+  }
+  dec $n;
+}
+
+#
+# Finally, over-the-max-limit updated db:s
+#
+
+connection master;
+
+# Prepare the test with dropping the triggers
+
+let $n= $dbs;
+# n'th db tables won't have any trigger to avoid circular dependency
+let $n1= $n;
+dec $n1;
+
+--disable_query_log
+
+while ($n1)
+{
+  let $m= $tables;
+
+  while ($m)
+  {
+     eval drop trigger `d$n1`.`trg_t$m`;
+
+     dec $m;
+  }
+  dec $n;
+  dec $n1;
+}
+
+let $n1= $dbs;
+dec $n1;
+let $n2= $n1;
+dec $n2;
+let $tables_2_rename= ;
+let $m= `select floor(rand()*$tables) + 1`;
+
+while ($n2)
+{
+    let $tables_2_rename= $tables_2_rename d$n1.t$m to d$n2.t$m ,;
+    eval drop table d$n2.t$m;
+    dec $n1;
+    dec $n2;
+}
+
+
+let $n= $dbs;
+let $n1= $n;
+dec $n1;
+
+--disable_warnings
+# The following query will leave so many warnings as many extra db pairs
+eval rename table $tables_2_rename d$n.t$m to d$n1.t$m;
+--enable_warnings
+
+--enable_query_log
+
+
+
+#
+# Clean-up
+#
+
+connection master;
+
+--disable_query_log
+
+let $n= $dbs;
+while ($n)
+{
+  eval drop database d$n;
+  dec $n;
+}
+
+--enable_query_log
+
+sync_slave_with_master;
+
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+
+### TODO: --source include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_fallback.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_fallback.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_fallback.test	2011-02-27 17:35:25 +0000
@@ -0,0 +1,94 @@
+#
+# WL#5569 MTS
+#
+# The test lists cases of transparent fallback to the sequential execution and
+# verifies it correctness.
+# Notice, the Query-log-event fallback is largely tested by rpl_parallel.
+#
+
+--source include/master-slave.inc
+--source include/have_binlog_format_mixed.inc
+
+let $workers= 4;
+
+connection slave;
+
+# restart in Parallel
+source include/stop_slave.inc;
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+eval set @@global.mts_slave_parallel_workers= $workers;
+source include/start_slave.inc;
+
+connection master;
+
+set @@session.binlog_format= row;
+create database d0;
+create table d0.t1 (a int auto_increment primary key) engine=innodb;
+
+connection master1;
+
+set @@session.binlog_format= row;
+create database d1;
+create table d1.t1 (a int auto_increment primary key) engine=innodb;
+
+# (TODO: remove during refactoring)
+# Rows_query_log_event case
+#
+
+let $iter= 100;
+let $i= $iter;
+
+connection master;
+set @@session.binlog_rows_query_log_events= 1;
+
+connection master1;
+set @@session.binlog_rows_query_log_events= 0;
+
+--disable_query_log
+--disable_result_log
+
+while ($i)
+{
+  connection master;
+  begin;
+  insert into d0.t1 values(null);
+  insert into d1.t1 values(null);
+  commit;
+
+  connection master1;
+  begin;
+  insert into d1.t1 values(null);
+  insert into d0.t1 values(null);
+  commit;
+
+  dec $i;
+}
+
+--enable_result_log
+--enable_query_log
+
+sync_slave_with_master;
+
+# verification
+
+let $diff_tables=master:d0.t1, slave:d0.t1;
+source include/diff_tables.inc;
+
+
+#
+# cleanup
+#
+
+connection master;
+
+drop database d0;
+drop database d1;
+
+
+sync_slave_with_master;
+#connection slave;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+
+--source include/rpl_end.inc
+
+

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt	2011-02-27 17:35:25 +0000
@@ -0,0 +1 @@
+--thread_stack=512K

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt	2011-02-27 17:35:25 +0000
@@ -0,0 +1 @@
+--thread_stack=512K

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test	2011-02-27 17:35:25 +0000
@@ -0,0 +1,342 @@
+#
+# WL#5569 MTS
+#
+# The test verifies correctness of Query event parallelization when
+# a DML Query modifies multiple databases.
+#
+
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+call mtr.add_suppression('.*Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*');
+--enable_query_log
+
+# restart in Parallel
+
+let $workers= 4;
+
+connection slave;
+
+source include/stop_slave.inc;
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+eval set @@global.mts_slave_parallel_workers= $workers;
+source include/start_slave.inc;
+
+
+let $dbs= 8;
+let $tables= 8;
+let $queries= `select $dbs*$tables * 4`;
+
+#
+# 1. Case of multi-update
+#
+
+connection master;
+
+# create & populate
+
+let $n= $dbs;
+while ($n)
+{
+  eval create database d$n;
+  let $m= $tables;
+  while ($m)
+  {
+     eval create table d$n.t$m (a int);
+     eval select round(rand()*$tables) into @var;
+     eval insert into d$n.t$m values (@var);
+     dec $m;
+  }
+  dec $n;
+}
+
+
+# operate to check consistency in the end
+
+let $k= $queries;
+
+--disable_query_log
+--disable_warnings
+while ($k)
+{
+   let $tables_in_query= `select 2 * (1 + floor(rand()*$dbs))`;
+   let $i= $tables_in_query;
+   let $table_list= ;
+   let $set_list= ;
+   while ($i)
+   {
+       let $n1= `select floor(rand()*$dbs + 1)`;
+       let $m1= `select floor(rand()*$tables + 1)`;
+       let $n2= `select floor(rand()*$dbs + 1)`;
+       let $m2= `select floor(rand()*$tables + 1)`;
+       let $table_list= $table_list d$n1.t$m1 as t_$i, ;
+       let $set_list= $set_list t_$i.a= ;
+       dec $i;
+
+       let $table_list= $table_list d$n2.t$m2 as t_$i, ;
+       let $set_list= $set_list t_$i.a + round(rand(10)), ;
+
+       dec $i;
+   }
+   let $n1= `select floor(rand()*$dbs + 1)`;
+   let $m1= `select floor(rand()*$tables + 1)`;   
+   let $n2= `select floor(rand()*$dbs + 1)`;
+   let $m2= `select floor(rand()*$tables + 1)`;
+
+##   --disable_warnings
+     
+     eval update $table_list d$n1.t$m1 as t_1_$i, d$n2.t$m2 as t_2_$i
+                 set $set_list t_1_$i.a=t_2_$i.a + round(rand(10));
+##   --enable_warnings
+
+   dec $k;
+}
+--enable_warnings
+--enable_query_log
+
+sync_slave_with_master; 
+
+#
+# 2. Case of invoked routines
+#
+
+# A. Functions
+
+# create functions & run load
+let $n= $dbs;
+# n'th db func is defined through n-1'th except n == 1
+let $n1= $n;
+dec $n1;
+
+connection master;
+
+--disable_query_log
+
+while ($n1)
+{
+  let $m= `select floor(rand()*$tables) + 1`;
+
+  delimiter |;
+
+  eval create function `d$n`.`func` (a int) returns int
+     begin
+     insert into `d$n`.`t$m` values (`d$n1`.`func`(1));
+     return 1;
+     end|
+
+  delimiter ;|
+
+  dec $n;
+  dec $n1;
+}
+
+delimiter |;
+
+eval create function `d1`.`func` (a int) returns int
+     begin
+     insert into `d1`.`t$m` values (0);
+     return 1;
+     end|
+
+delimiter ;|
+
+
+# invoke...
+
+let $k= $queries;
+
+while ($k)
+{
+   let $n= `select floor(rand()*$dbs) + 1`;
+   let $m= `select floor(rand()*$tables) + 1`;
+   let $n1= $n;
+   dec $n1;
+   if ($n1)
+   {
+       eval insert into d$n.t$m values (`d$n1`.`func`(1));
+   }
+   dec $k;
+}
+
+--enable_query_log
+
+sync_slave_with_master;
+
+# B. Triggers
+
+connection master;
+
+# create triggers & run load
+let $n= $dbs;
+# n'th db tables won't have any trigger to avoid circular dependency
+let $n1= $n;
+dec $n1;
+
+--disable_query_log
+while ($n1)
+{
+  let $m= $tables;
+
+  while ($m)
+  {
+     eval create trigger `d$n1`.`trg_t$m` before insert on `d$n1`.`t$m` for each row insert into `d$n`.`t$m` values(1);
+     dec $m;
+  }
+  dec $n;
+  dec $n1;
+}
+--enable_query_log
+
+# invoke...
+
+let $k= $queries;
+
+--disable_query_log
+--disable_warnings
+while ($k)
+{
+   let $n= `select floor(rand()*$dbs + 1)`;
+   let $m= `select floor(rand()*$tables + 1)`;
+   eval insert into d$n.t$n values (2);
+   dec $k;
+}
+--enable_warnings
+--enable_query_log
+
+
+sync_slave_with_master;
+
+#
+# Consistency check
+#
+
+let $n = $dbs;
+while($n)
+{
+  let $m= $tables;
+  while ($m)
+  {
+    let $diff_tables=master:d$n.t$m, slave:d$n.t$m;
+    source include/diff_tables.inc;
+    dec $m;
+  }
+  dec $n;
+}
+
+#
+# Clean-up of the regular case tests
+#
+
+connection master;
+
+--disable_query_log
+
+let $n= $dbs;
+while ($n)
+{
+  eval drop database d$n;
+  dec $n;
+}
+
+--enable_query_log
+
+sync_slave_with_master;
+
+#
+# Over MAX_DBS_IN_QUERY_MTS
+#
+
+let $dbs= 20;
+let $queries= `select $dbs* 4`;
+
+connection master;
+
+let $n= $dbs;
+let $m= 1;
+while ($n)
+{
+  eval create database d$n;
+  eval create table d$n.t$m (a int);
+  eval select round(rand()*$tables) into @var;
+  eval insert into d$n.t$m values (@var);
+
+  dec $n;
+}
+
+--disable_query_log
+--disable_warnings
+
+let $k= $queries;
+
+while ($k)
+{
+   let $tables_in_query= `select 2 * (1 + floor(rand()*$dbs))`;
+   let $i= $tables_in_query;
+   let $table_list= ;
+   let $set_list= ;
+   while ($i)
+   {
+       let $n1= `select floor(rand()*$dbs + 1)`;
+       let $m1= 1;
+       let $n2= `select floor(rand()*$dbs + 1)`;
+       let $m2= 1;
+       let $table_list= $table_list d$n1.t$m1 as t_$i, ;
+       let $set_list= $set_list t_$i.a= ;
+       dec $i;
+
+       let $table_list= $table_list d$n2.t$m2 as t_$i, ;
+       let $set_list= $set_list t_$i.a + round(rand(10)), ;
+
+       dec $i;
+   }
+   let $n1= `select floor(rand()*$dbs + 1)`;
+   let $m1= 1;
+   let $n2= `select floor(rand()*$dbs + 1)`;
+   let $m2= 1;
+
+     eval update $table_list d$n1.t$m1 as t_1_$i, d$n2.t$m2 as t_2_$i
+                 set $set_list t_1_$i.a=t_2_$i.a + round(rand(10));
+   dec $k;
+}
+--enable_warnings
+--enable_query_log
+
+sync_slave_with_master;
+
+#
+# Consistency check
+#
+
+let $n = $dbs;
+let $m= 1;
+while($n)
+{
+  let $diff_tables=master:d$n.t$m, slave:d$n.t$m;
+  source include/diff_tables.inc;
+  dec $n;
+}
+
+#
+# The final clean-up
+#
+
+connection master;
+
+--disable_query_log
+
+let $n= $dbs;
+while ($n)
+{
+  eval drop database d$n;
+  dec $n;
+}
+
+--enable_query_log
+
+sync_slave_with_master;
+
+
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+
+### TODO: --source include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_start_stop-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_start_stop-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_start_stop-slave.opt	2010-12-22 19:19:17 +0000
@@ -0,0 +1 @@
+--relay-log-info-repository=FILE --slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_start_stop.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test	2011-05-16 19:43:58 +0000
@@ -0,0 +1,277 @@
+#
+# WL#5569 MTS
+#
+# The test checks START and STOP, graceful, killing or 
+# due to an error of a Worker.
+# START is considered to be with UNTIL that forces the sequential execution mode
+# and with non-zero @@global.sql_slave_skip_counter that is compatible to
+# the parallel mode.
+#
+
+--source include/master-slave.inc
+--source include/have_binlog_format_row.inc
+
+connection slave;
+
+create view worker_proc_list as SELECT id  from Information_Schema.processlist
+       where state like 'Waiting for an event from sql thread%';
+create view coord_proc_list  as SELECT id from Information_Schema.processlist where state like 'Slave has read all relay log%';
+
+source include/stop_slave.inc;
+
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+set @@global.mts_slave_parallel_workers= 4;
+
+source include/start_slave.inc;
+
+let $count= `select @@global.mts_slave_parallel_workers`;
+let $table= worker_proc_list;
+source include/wait_until_rows_count.inc;
+
+#
+# KILL of a Worker stops the pool and the Coordinator
+#
+select min(id) from worker_proc_list into @w_id;
+kill query @w_id;
+
+let $count= 0;
+let $table= worker_proc_list;
+source include/wait_until_rows_count.inc;
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+#
+# KILL of the Coordinator stops the pool as well
+#
+source include/start_slave.inc;
+
+# testing of the poll is up
+
+let $count= `select @@global.mts_slave_parallel_workers`;
+let $table= worker_proc_list;
+source include/wait_until_rows_count.inc;
+
+let $count= 1;
+let $table= coord_proc_list;
+source include/wait_until_rows_count.inc;
+
+select id from coord_proc_list into @c_id;
+
+kill query @c_id;
+
+let $count= 0;
+let $table= worker_proc_list;
+source include/wait_until_rows_count.inc;
+
+source include/wait_for_slave_sql_to_stop.inc;
+
+source include/start_slave.inc;
+
+##
+# Errored-out Worker stops the pool and the Coordinator
+##
+
+# 
+# A. A regular error case
+#
+connection master;
+
+# make some load
+
+CREATE TABLE t1 (a int primary key) engine=innodb;
+
+insert into t1 values (1),(2);
+
+sync_slave_with_master;
+#connection slave;
+
+let $count= 2;
+let $table= t1;
+source include/wait_until_rows_count.inc;
+
+# create an offending record
+insert into t1 values (3);
+
+connection master;
+
+# hit it
+insert into t1 values (3);
+
+connection slave;
+
+let $count= 0;
+let $table= worker_proc_list;
+source include/wait_until_rows_count.inc;
+
+source include/wait_for_slave_sql_to_stop.inc;
+delete from t1 where a=3;
+
+source include/start_slave.inc;
+
+connection master;
+
+sync_slave_with_master;
+#connection slave;
+
+if (`select count(*) != 3 from t1`)
+{
+    query_vertical show slave status;
+    --die Wrong recovery after restart
+}
+
+# cleanup but leaving on t1
+
+connection master;
+delete from t1;
+
+sync_slave_with_master;
+#connection slave;
+
+#
+# B. In a temporary error execution is not retried
+#
+
+connection master;
+insert into t1 values (1),(2),(3);
+create table t2m (a int) engine=myisam; # non-trans engine to detect deadlock
+insert into t2m values (1);
+
+sync_slave_with_master;
+#connection slave;
+
+begin;
+# set up a deadlock
+update t1 set a=31 where a=3;
+insert into t1 values (5),(6),(7);
+
+connection master;
+
+begin;
+update t1 set a=20 where a=2;
+insert into t2m values (2);
+update t1 set a=30 where a=3;
+commit;
+
+
+connection slave;
+
+let $count= 2;
+let $table= t2m;
+source include/wait_until_rows_count.inc;
+
+# must victimize the master trans because of deadlock or timeout
+update t1 set a=21 where a=2;
+
+# slave is stopped
+
+let $slave_sql_errno= 1213, 1205; 
+source include/wait_for_slave_sql_error.inc;
+
+##source include/wait_for_slave_sql_to_stop.inc;
+
+rollback;
+
+source include/start_slave.inc;
+
+connection master;
+
+# recovery is proved
+sync_slave_with_master;
+#connection slave;
+
+
+#
+# Skipping works with Parallel slave
+#
+
+connection slave;
+stop slave sql_thread;
+set @@global.sql_slave_skip_counter=7;
+
+connection master;
+
+# the following creates 8 events 
+begin;
+select max(a) + 1 from t1 into @a;
+insert into t1 set a=@a;
+commit;
+begin;
+select max(a) + 1 from t1 into @a;
+insert into t1 set a=@a;
+commit;
+
+# which will force to skip the two above transactions by the slave
+# And the third will be executed:
+
+begin;
+select max(a) + 1 from t1 into @a;
+insert into t1 set a=@a;
+commit;
+
+connection slave;
+
+set @save.slave_transaction_retries= @@global.slave_transaction_retries;
+set @@global.slave_transaction_retries= 1; # must cause a warning
+start slave sql_thread;
+
+connection master;
+let $a=`select max(a) from t1`;
+
+sync_slave_with_master;
+#connection slave;
+
+if (`select $a - max(a) from t1`)
+{
+    eval select $a as 'max(a) from t1 on master';
+    eval select max(a) as 'max(a) from t1 on slave' from t1;
+    --die Wrong skipping logics or a flaw in the test
+}
+
+#
+# UNTIL condition is not supported by Parallel slave to reject
+# with a warning and no Worker thread is started
+#
+
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+create table t2 (a int);
+
+let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+insert into t2 values (1);
+
+connection slave;
+--replace_regex /master_log_pos=[0-9]+/master_log_pos=MASTER_LOG_POS/
+eval start slave until master_log_file='$master_log_file', master_log_pos=$master_log_pos;
+
+source include/wait_for_slave_sql_to_stop.inc;
+if (`select count(*) from t2`)
+{
+    select count(*) from t2;
+    --die Wrong UNTIL condtion handling or a flaw in the test
+}
+
+source include/start_slave.inc;
+
+##
+# cleanup
+##
+connection master;
+drop table t1;
+drop table t2m;
+drop table t2;
+
+sync_slave_with_master;
+#connection slave;
+
+drop view worker_proc_list;
+drop view coord_proc_list;
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+set @@global.slave_transaction_retries= @save.slave_transaction_retries;
+--echo end of the tests
+
+### TODO: restore --source include/rpl_end.inc
+--echo include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_temp_query.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test	2011-02-27 17:35:25 +0000
@@ -0,0 +1,169 @@
+#
+# WL#5569 MTS
+#
+# The test verifies correctness of Query events parallelization.
+#
+
+--source include/master-slave.inc
+--source include/have_binlog_format_statement.inc
+
+call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table.*');
+
+let $temp_tables= 16;
+let $workers= 4;
+
+connection slave;
+
+# restart in Parallel
+source include/stop_slave.inc;
+set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
+eval set @@global.mts_slave_parallel_workers= $workers;
+
+source include/start_slave.inc;
+
+# Two connections each create 2 db:s a regular table and a set of temp tables.
+# The temp tables contribute content to the regular tables.
+# In the end there must be consistent data on both sides.
+
+connection master;
+
+let $n= `select round($workers/2)`;
+let $n1= `select $n`;
+while ($n)
+{
+  eval create database d$n1;
+  eval use d$n1;
+  eval create table d$n1.t1 (a int auto_increment primary key, b int) engine=innodb;
+  let $i= $temp_tables;
+
+--disable_query_log
+  while($i)
+  {
+    let $temp_rows= `select round(rand()*$temp_tables) + 1`;
+    let $k= $temp_rows;
+    eval create temporary table tt_$i (a int auto_increment primary key);
+    while($k)
+    {
+	eval insert into tt_$i values (null);
+	dec $k;
+    }
+    dec $i;
+  }
+--enable_query_log
+
+  let $j= `select floor(rand()*$temp_tables) + 1`;
+--replace_regex /tt_.*/tt_##/
+  eval insert into d$n1.t1 (b) select count(*) from tt_$j;
+  dec $n;
+  dec $n1;
+}
+
+connection master1;
+
+let $n= `select round($workers/2)`;
+let $n1= `select 2*$n`;
+while ($n)
+{
+  eval create database d$n1;
+  eval use d$n1;
+  eval create table d$n1.t1 (a int auto_increment primary key, b int) engine=innodb;
+  let $i= $temp_tables;
+
+--disable_query_log
+  while($i)
+  {
+    let $temp_rows= `select round(rand()*$temp_tables) + 1`;
+    let $k= $temp_rows;
+    eval create temporary table tt_$i (a int auto_increment primary key);
+    while($k)
+    {
+	eval insert into tt_$i values (null);
+	dec $k;
+    }
+    dec $i;
+  }
+--enable_query_log
+
+  let $j= `select floor(rand()*$temp_tables) + 1`;
+--replace_regex /tt_.*/tt_##/
+  eval insert into d$n1.t1 (b) select count(*) from tt_$j;
+  dec $n;
+  dec $n1;
+}
+
+sync_slave_with_master;
+
+#
+# Consistency check
+#
+
+let $n = $workers;
+while($n)
+{
+  let $diff_tables=master:d$n.t1, slave:d$n.t1;
+  source include/diff_tables.inc;
+
+  dec $n;
+}
+
+#
+# cleanup
+#
+# Temp tables are removed two ways explicitly and implicitly by disconnecting.
+#
+
+connection master;
+
+let $i= `select round($temp_tables/2)`;
+while($i)
+{
+  eval drop temporary table tt_$i;
+  dec $i;
+}
+
+let $n= `select round($workers/2)`;
+let $n1= `select $n`;
+while ($n)
+{
+  eval drop database d$n1;
+  dec $n;
+  dec $n1;
+}
+
+
+connection master1;
+
+let $i= `select round($temp_tables/2)`;
+while($i)
+{
+  eval drop temporary table tt_$i;
+  dec $i;
+}
+
+sync_slave_with_master;
+#connection slave;
+
+connection master1;
+disconnect master1;
+
+#
+# Clean-up
+#
+
+connection master;
+
+let $n= `select round($workers/2)`;
+let $n1= `select 2*$n`;
+while ($n)
+{
+  eval drop database d$n1;
+  dec $n;
+  dec $n1;
+}
+
+sync_slave_with_master;
+source include/stop_slave.inc;
+
+set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
+
+### TODO: --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt	2010-10-27 11:50:22 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_crash_safe-slave.opt	2010-12-13 21:16:31 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --relay-log-recovery=1

=== modified file 'mysql-test/suite/rpl/t/rpl_row_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_row_crash_safe.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_crash_safe.test	2010-12-27 18:54:41 +0000
@@ -4,6 +4,7 @@
 --source include/have_debug.inc
 --source include/have_innodb.inc
 --source include/have_binlog_format_row.inc
+--source include/not_mts_slave_parallel_workers.inc
 
 call mtr.add_suppression('Attempting backtrace');
 call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");

=== added file 'mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe-slave.opt	2010-12-22 19:19:17 +0000
@@ -0,0 +1 @@
+--mts-slave-parallel-workers=5 --skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --worker-info-repository=TABLE --worker-info-engine=innodb --slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_parallel_crash_safe.test	2010-12-27 18:54:41 +0000
@@ -0,0 +1,16 @@
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+
+--source extra/rpl_tests/rpl_crash_safe.test
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_row_until.test'
--- a/mysql-test/suite/rpl/t/rpl_row_until.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test	2010-12-27 18:54:41 +0000
@@ -1,6 +1,7 @@
 -- source include/not_ndb_default.inc
 -- source include/have_binlog_format_row.inc
 -- source include/master-slave.inc
+--source include/not_mts_slave_parallel_workers.inc
 
 # Note: The test is dependent on binlog positions
 

=== added file 'mysql-test/suite/rpl/t/rpl_sequential-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_sequential-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_sequential-master.opt	2010-12-16 22:00:47 +0000
@@ -0,0 +1 @@
+--log-warnings=0

=== added file 'mysql-test/suite/rpl/t/rpl_sequential-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_sequential-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_sequential-slave.opt	2010-12-16 22:00:47 +0000
@@ -0,0 +1,2 @@
+--log-warnings=0
+

=== added file 'mysql-test/suite/rpl/t/rpl_sequential.test'
--- a/mysql-test/suite/rpl/t/rpl_sequential.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_sequential.test	2010-12-27 18:54:41 +0000
@@ -0,0 +1,20 @@
+#
+# WL#5563 Prototype for Parallel Slave with db name partitioning.
+#
+# The test can be used for benchmarking and comparision with its sequential
+# counterpart rpl_parallel.test. Read more comments in there.
+#
+
+--source include/master-slave.inc
+--source include/not_mts_slave_parallel_workers.inc
+
+connection slave;
+
+set @save.mts_slave_parallel_workers= 0;
+select @@global.mts_slave_parallel_workers as 'zero';
+
+connection master;
+
+source extra/rpl_tests/rpl_parallel_load.test;
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_server_id2.test'
--- a/mysql-test/suite/rpl/t/rpl_server_id2.test	2010-12-19 17:15:12 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test	2010-12-27 18:54:41 +0000
@@ -46,7 +46,9 @@ connection slave;
 --replace_result $MASTER_MYPORT MASTER_PORT
 eval change master to master_port=$MASTER_MYPORT;
 --replace_result $until_pos UNTIL_POS
+--disable_warnings
 eval start slave until master_log_file='master-bin.000001', master_log_pos=$until_pos;
+--enable_warnings
 --source include/wait_for_slave_io_to_start.inc
 --source include/wait_for_slave_sql_to_stop.inc
 

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe-slave.opt	2010-12-27 18:54:41 +0000
@@ -1 +1 @@
---skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-recovery=1
+--skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --relay-log-recovery=1

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixed_crash_safe.test	2010-12-27 18:54:41 +0000
@@ -4,6 +4,7 @@
 --source include/have_debug.inc
 --source include/have_innodb.inc
 --source include/have_binlog_format_mixed_or_statement.inc
+--source include/not_mts_slave_parallel_workers.inc
 
 call mtr.add_suppression('Attempting backtrace');
 call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");

=== added file 'mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe-slave.opt	2010-12-22 19:19:17 +0000
@@ -0,0 +1 @@
+--mts-slave-parallel-workers=5 --skip-core-file --skip-slave-start --relay-log-info-repository=TABLE --relay-log-info-engine=innodb --worker-info-repository=TABLE --worker-info-engine=innodb --slave-transaction-retries=0

=== added file 'mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_parallel_crash_safe.test	2010-12-27 18:54:41 +0000
@@ -0,0 +1,16 @@
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
+call mtr.add_suppression(".*int __cxa_pure_virtual().*");
+
+--source extra/rpl_tests/rpl_crash_safe.test
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_until.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test	2010-12-27 18:54:41 +0000
@@ -19,6 +19,7 @@
 
 -- source include/have_binlog_format_mixed_or_statement.inc
 -- source include/master-slave.inc
+-- source include/not_mts_slave_parallel_workers.inc
 
 # Test is dependent on binlog positions
 

=== modified file 'mysql-test/suite/rpl/t/rpl_temporary_errors.test'
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test	2010-12-27 18:54:41 +0000
@@ -1,6 +1,7 @@
-source include/have_debug.inc;
-source include/have_binlog_format_row.inc;
-source include/master-slave.inc;
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/not_mts_slave_parallel_workers.inc
 
 call mtr.add_suppression("Deadlock found");
 

=== modified file 'mysql-test/suite/sys_vars/r/all_vars.result'
--- a/mysql-test/suite/sys_vars/r/all_vars.result	2010-12-14 08:07:25 +0000
+++ b/mysql-test/suite/sys_vars/r/all_vars.result	2011-02-27 17:35:25 +0000
@@ -12,29 +12,45 @@ There should be *no* long test name list
 select variable_name as `There should be *no* variables listed below:` from t2
 left join t1 on variable_name=test_name where test_name is null;
 There should be *no* variables listed below:
+MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
+MTS_PARTITION_HASH_SOFT_MAX
+MTS_EXP_SLAVE_LOCAL_TIMESTAMP
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
 RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_PRINT_ALL_DEADLOCKS
+MTS_MASTER_UPDATED_DBS_MAX
 INNODB_RESET_MONITOR_COUNTER
+MTS_SLAVE_PARALLEL_WORKERS
+MTS_WORKER_UNDERRUN_LEVEL
 INNODB_RESET_ALL_MONITOR_COUNTER
 LOG_BIN_INDEX
 INNODB_DISABLE_MONITOR_COUNTER
 INNODB_ENABLE_MONITOR_COUNTER
 INNODB_FILE_FORMAT_MAX
+MTS_PENDING_JOBS_SIZE_MAX
+MTS_COORDINATOR_BASIC_NAP
+MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
+MTS_PARTITION_HASH_SOFT_MAX
+MTS_EXP_SLAVE_LOCAL_TIMESTAMP
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES
 RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_PRINT_ALL_DEADLOCKS
+MTS_MASTER_UPDATED_DBS_MAX
 INNODB_RESET_MONITOR_COUNTER
+MTS_SLAVE_PARALLEL_WORKERS
+MTS_WORKER_UNDERRUN_LEVEL
 INNODB_RESET_ALL_MONITOR_COUNTER
 LOG_BIN_INDEX
 INNODB_DISABLE_MONITOR_COUNTER
 INNODB_ENABLE_MONITOR_COUNTER
 INNODB_FILE_FORMAT_MAX
+MTS_PENDING_JOBS_SIZE_MAX
+MTS_COORDINATOR_BASIC_NAP
 drop table t1;
 drop table t2;

=== added file 'mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result'
--- a/mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/mts_checkpoint_group_basic.result	2010-12-18 00:33:02 +0000
@@ -0,0 +1,51 @@
+SET @start_global_value = @@global.mts_checkpoint_group;
+SELECT @start_global_value;
+@start_global_value
+512
+select @@global.mts_checkpoint_group;
+@@global.mts_checkpoint_group
+512
+select @@session.mts_checkpoint_group;
+ERROR HY000: Variable 'mts_checkpoint_group' is a GLOBAL variable
+show global variables like 'mts_checkpoint_group';
+Variable_name	Value
+mts_checkpoint_group	512
+show session variables like 'mts_checkpoint_group';
+Variable_name	Value
+mts_checkpoint_group	512
+select * from information_schema.global_variables where variable_name='mts_checkpoint_group';
+VARIABLE_NAME	VARIABLE_VALUE
+MTS_CHECKPOINT_GROUP	512
+select * from information_schema.session_variables where variable_name='mts_checkpoint_group';
+VARIABLE_NAME	VARIABLE_VALUE
+MTS_CHECKPOINT_GROUP	512
+set global mts_checkpoint_group=1;
+Warnings:
+Warning	1292	Truncated incorrect mts_checkpoint_group value: '1'
+select @@global.mts_checkpoint_group;
+@@global.mts_checkpoint_group
+512
+set session mts_checkpoint_group=1;
+ERROR HY000: Variable 'mts_checkpoint_group' is a GLOBAL variable and should be set with SET GLOBAL
+set global mts_checkpoint_group=1.1;
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_group'
+set global mts_checkpoint_group=1e1;
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_group'
+set global mts_checkpoint_group="foo";
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_group'
+set global mts_checkpoint_group=0;
+Warnings:
+Warning	1292	Truncated incorrect mts_checkpoint_group value: '0'
+select @@global.mts_checkpoint_group;
+@@global.mts_checkpoint_group
+512
+set global mts_checkpoint_group=cast(-1 as unsigned int);
+Warnings:
+Warning	1292	Truncated incorrect mts_checkpoint_group value: '18446744073709551615'
+select @@global.mts_checkpoint_group;
+@@global.mts_checkpoint_group
+4294967288
+SET @@global.mts_checkpoint_group = @start_global_value;
+SELECT @@global.mts_checkpoint_group;
+@@global.mts_checkpoint_group
+512

=== added file 'mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result'
--- a/mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/mts_checkpoint_period_basic.result	2010-12-14 12:51:30 +0000
@@ -0,0 +1,47 @@
+SET @start_global_value = @@global.mts_checkpoint_period;
+SELECT @start_global_value;
+@start_global_value
+300
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+300
+select @@session.mts_checkpoint_period;
+ERROR HY000: Variable 'mts_checkpoint_period' is a GLOBAL variable
+show global variables like 'mts_checkpoint_period';
+Variable_name	Value
+mts_checkpoint_period	300
+show session variables like 'mts_checkpoint_period';
+Variable_name	Value
+mts_checkpoint_period	300
+select * from information_schema.global_variables where variable_name='mts_checkpoint_period';
+VARIABLE_NAME	VARIABLE_VALUE
+MTS_CHECKPOINT_PERIOD	300
+select * from information_schema.session_variables where variable_name='mts_checkpoint_period';
+VARIABLE_NAME	VARIABLE_VALUE
+MTS_CHECKPOINT_PERIOD	300
+set global mts_checkpoint_period=1;
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+1
+set session mts_checkpoint_period=1;
+ERROR HY000: Variable 'mts_checkpoint_period' is a GLOBAL variable and should be set with SET GLOBAL
+set global mts_checkpoint_period=1.1;
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
+set global mts_checkpoint_period=1e1;
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
+set global mts_checkpoint_period="foo";
+ERROR 42000: Incorrect argument type to variable 'mts_checkpoint_period'
+set global mts_checkpoint_period=0;
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+0
+set global mts_checkpoint_period=cast(-1 as unsigned int);
+Warnings:
+Warning	1292	Truncated incorrect mts_checkpoint_period value: '18446744073709551615'
+select @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+4294967295
+SET @@global.mts_checkpoint_period = @start_global_value;
+SELECT @@global.mts_checkpoint_period;
+@@global.mts_checkpoint_period
+300

=== added file 'mysql-test/suite/sys_vars/r/worker_info_repository_basic.result'
--- a/mysql-test/suite/sys_vars/r/worker_info_repository_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/worker_info_repository_basic.result	2010-12-09 13:23:19 +0000
@@ -0,0 +1,44 @@
+'#---------------------BS_STVARS_002_01----------------------#'
+SELECT @@GLOBAL.worker_info_repository;
+@@GLOBAL.worker_info_repository
+FILE
+SELECT COUNT(@@GLOBAL.worker_info_repository);
+COUNT(@@GLOBAL.worker_info_repository)
+1
+1 Expected
+SELECT COUNT(@@SESSION.worker_info_repository);
+ERROR HY000: Variable 'worker_info_repository' is a GLOBAL variable
+'#---------------------BS_STVARS_002_02----------------------#'
+SET @@GLOBAL.worker_info_repository= "TABLE";
+ERROR HY000: Variable 'worker_info_repository' is a read only variable
+SELECT @@GLOBAL.worker_info_repository;
+@@GLOBAL.worker_info_repository
+FILE
+'#---------------------BS_STVARS_002_03----------------------#'
+SELECT @@GLOBAL.worker_info_repository = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='worker_info_repository';
+@@GLOBAL.worker_info_repository = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.worker_info_repository);
+COUNT(@@GLOBAL.worker_info_repository)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='worker_info_repository';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_002_05----------------------#'
+SELECT COUNT(@@worker_info_repository);
+COUNT(@@worker_info_repository)
+1
+1 Expected
+SELECT COUNT(@@local.worker_info_repository);
+ERROR HY000: Variable 'worker_info_repository' is a GLOBAL variable
+SELECT COUNT(@@GLOBAL.worker_info_repository);
+COUNT(@@GLOBAL.worker_info_repository)
+1
+1 Expected

=== added file 'mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test'
--- a/mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/mts_checkpoint_group_basic.test	2010-12-18 00:33:02 +0000
@@ -0,0 +1,44 @@
+--source include/not_embedded.inc
+
+SET @start_global_value = @@global.mts_checkpoint_group;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.mts_checkpoint_group;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.mts_checkpoint_group;
+show global variables like 'mts_checkpoint_group';
+show session variables like 'mts_checkpoint_group';
+select * from information_schema.global_variables where variable_name='mts_checkpoint_group';
+select * from information_schema.session_variables where variable_name='mts_checkpoint_group';
+
+#
+# show that it's writable
+#
+set global mts_checkpoint_group=1;
+select @@global.mts_checkpoint_group;
+--error ER_GLOBAL_VARIABLE
+set session mts_checkpoint_group=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_group=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_group=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_group="foo";
+
+#
+# min/max values
+#
+set global mts_checkpoint_group=0;
+select @@global.mts_checkpoint_group;
+set global mts_checkpoint_group=cast(-1 as unsigned int);
+select @@global.mts_checkpoint_group;
+
+SET @@global.mts_checkpoint_group = @start_global_value;
+SELECT @@global.mts_checkpoint_group;

=== added file 'mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test'
--- a/mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/mts_checkpoint_period_basic.test	2010-12-13 21:16:31 +0000
@@ -0,0 +1,44 @@
+--source include/not_embedded.inc
+
+SET @start_global_value = @@global.mts_checkpoint_period;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.mts_checkpoint_period;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.mts_checkpoint_period;
+show global variables like 'mts_checkpoint_period';
+show session variables like 'mts_checkpoint_period';
+select * from information_schema.global_variables where variable_name='mts_checkpoint_period';
+select * from information_schema.session_variables where variable_name='mts_checkpoint_period';
+
+#
+# show that it's writable
+#
+set global mts_checkpoint_period=1;
+select @@global.mts_checkpoint_period;
+--error ER_GLOBAL_VARIABLE
+set session mts_checkpoint_period=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_period=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_period=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global mts_checkpoint_period="foo";
+
+#
+# min/max values
+#
+set global mts_checkpoint_period=0;
+select @@global.mts_checkpoint_period;
+set global mts_checkpoint_period=cast(-1 as unsigned int);
+select @@global.mts_checkpoint_period;
+
+SET @@global.mts_checkpoint_period = @start_global_value;
+SELECT @@global.mts_checkpoint_period;

=== added file 'mysql-test/suite/sys_vars/t/worker_info_repository_basic.test'
--- a/mysql-test/suite/sys_vars/t/worker_info_repository_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/worker_info_repository_basic.test	2010-12-09 13:23:19 +0000
@@ -0,0 +1,76 @@
+############## mysql-test\t\worker_info_repository_basic.test #################
+#                                                                             #
+# Variable Name: worker_info_repository                                       #
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type: enumeration                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2010-12-09                                                   #
+# Author : Alfranio Correia                                                   #
+#                                                                             #
+#                                                                             #
+# Description:Test Cases of System Variable worker_info_repository            #
+#             that checks the behavior of this variable in the following ways #
+#              * Value Check                                                  #
+#              * Scope Check                                                  #
+#                                                                             #
+# Reference:                                                                  #
+#    http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html      #
+#                                                                             #
+###############################################################################
+--source include/not_worker_info_table.inc
+
+--echo '#---------------------BS_STVARS_002_01----------------------#'
+####################################################################
+#   Displaying default value                                       #
+####################################################################
+SELECT @@GLOBAL.worker_info_repository;
+
+SELECT COUNT(@@GLOBAL.worker_info_repository);
+--echo 1 Expected
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.worker_info_repository);
+
+--echo '#---------------------BS_STVARS_002_02----------------------#'
+####################################################################
+#   Check if Value can set                                         #
+####################################################################
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.worker_info_repository= "TABLE";
+
+SELECT @@GLOBAL.worker_info_repository;
+
+
+--echo '#---------------------BS_STVARS_002_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+SELECT @@GLOBAL.worker_info_repository = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='worker_info_repository';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.worker_info_repository);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='worker_info_repository';
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_002_05----------------------#'
+################################################################################
+#   Check if worker_info_repository can be accessed with and without @@ sign   #
+################################################################################
+
+SELECT COUNT(@@worker_info_repository);
+--echo 1 Expected
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.worker_info_repository);
+
+SELECT COUNT(@@GLOBAL.worker_info_repository);
+--echo 1 Expected

=== modified file 'mysql-test/t/system_mysql_db_fix40123.test'
--- a/mysql-test/t/system_mysql_db_fix40123.test	2010-12-17 11:28:59 +0000
+++ b/mysql-test/t/system_mysql_db_fix40123.test	2010-12-27 18:54:41 +0000
@@ -72,7 +72,7 @@ CREATE TABLE time_zone_leap_second (   T
 -- disable_query_log
 
 # Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, slave_worker_info;
 
 -- enable_query_log
 

=== modified file 'mysql-test/t/system_mysql_db_fix50030.test'
--- a/mysql-test/t/system_mysql_db_fix50030.test	2010-12-17 11:28:59 +0000
+++ b/mysql-test/t/system_mysql_db_fix50030.test	2010-12-27 18:54:41 +0000
@@ -78,7 +78,7 @@ INSERT INTO servers VALUES ('test','loca
 -- disable_query_log
 
 # Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, slave_worker_info;
 
 -- enable_query_log
 

=== modified file 'mysql-test/t/system_mysql_db_fix50117.test'
--- a/mysql-test/t/system_mysql_db_fix50117.test	2010-12-17 11:28:59 +0000
+++ b/mysql-test/t/system_mysql_db_fix50117.test	2010-12-27 18:54:41 +0000
@@ -97,7 +97,7 @@ CREATE TABLE IF NOT EXISTS ndb_binlog_in
 -- disable_query_log
 
 # Drop all tables created by this test
-DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index, proxies_priv, slave_master_info, slave_relay_log_info, slave_worker_info;
 
 -- enable_query_log
 

=== modified file 'scripts/mysql_install_db.pl.in'
--- a/scripts/mysql_install_db.pl.in	2010-10-25 10:39:01 +0000
+++ b/scripts/mysql_install_db.pl.in	2010-12-13 21:16:31 +0000
@@ -79,11 +79,6 @@ Usage: $0 [OPTIONS]
                        user.  You must be root to use this option.  By default
                        mysqld runs using your current login name and files and
                        directories that it creates will be owned by you.
-  --rpl-engine=engine  The storage engine used for the mysql.slave_master_info and
-                       mysql.slave_relay_log_info tables. By default, both tables are
-                       created using the MyISAM storage engine. However, any storage
-                       engine available to the server may be used. If a crash-safe
-                       slave is required, the storage engine must be transactional.
 
 All other options are passed to the mysqld program
 
@@ -122,7 +117,6 @@ sub parse_arguments
              "builddir=s",      # FIXME not documented
              "srcdir=s",
              "ldata|datadir=s",
-             "rpl-engine=s",
 
              # Note that the user will be passed to mysqld so that it runs
              # as 'user' (crucial e.g. if log-bin=/some_other_path/
@@ -459,29 +453,6 @@ if ( open(PIPE, "| $mysqld_install_cmd_l
   report_verbose($opt,"OK");
 
   # ----------------------------------------------------------------------
-  # Pipe ALTER TABLE mysql.slave_master_info|slave_relay_log_info to "mysqld --bootstrap"
-  # ----------------------------------------------------------------------
-
-  if ($opt->{'rpl-engine'})
-  {
-    report_verbose_wait($opt,"Setting engine for mysql.slave_master_info mysql.slave_relay_log_info tables...");
-    if ( open(PIPE, "| $mysqld_install_cmd_line") )
-    {
-      print PIPE "use mysql;\n";
-      print PIPE "ALTER TABLE mysql.slave_master_info ENGINE= " . $opt->{'rpl-engine'} . ";\n";
-      print PIPE "ALTER TABLE mysql.slave_relay_log_info ENGINE= " . $opt->{'$rpl-engine'} . ";\n";
-      close PIPE;
-
-      report_verbose($opt,"OK");
-    }
-    else
-    {
-      warning($opt,"CRASH-SAFE SLAVE IS NOT COMPLETELY CONFIGURED!",
-                   "The \"CRASH-SAFE SLAVE\" might not work properly.");
-    }
-  }
-
-  # ----------------------------------------------------------------------
   # Pipe fill_help_tables.sql to "mysqld --bootstrap"
   # ----------------------------------------------------------------------
 

=== modified file 'scripts/mysql_install_db.sh'
--- a/scripts/mysql_install_db.sh	2010-10-25 10:39:01 +0000
+++ b/scripts/mysql_install_db.sh	2010-12-13 21:16:31 +0000
@@ -63,11 +63,6 @@ Usage: $0 [OPTIONS]
                        user.  You must be root to use this option.  By default
                        mysqld runs using your current login name and files and
                        directories that it creates will be owned by you.
-  --rpl-engine=engine  The storage engine used for the mysql.slave_master_info and
-                       mysql.slave_relay_log_info tables. By default, both tables are
-                       created using the MyISAM storage engine. However, any storage
-                       engine available to the server may be used. If a crash-safe
-                       slave is required, the storage engine must be transactional.
 
 All other options are passed to the mysqld program
 
@@ -120,8 +115,6 @@ parse_arguments()
       --no-defaults|--defaults-file=*|--defaults-extra-file=*)
         defaults="$arg" ;;
 
-      --rpl-engine=*) rpl_engine=`parse_arg "$arg"` ;;
-
       --cross-bootstrap|--windows)
         # Used when building the MySQL system tables on a different host than
         # the target. The platform-independent files that are created in
@@ -434,19 +427,6 @@ else
   exit 1
 fi
 
-if test -n "$rpl_engine"
-then
-  s_echo "Setting engine for mysql.slave_master_info mysql.slave_relay_log_info tables..."
-  if { echo "use mysql;"; echo "ALTER TABLE mysql.slave_master_info ENGINE= $rpl_engine;"; echo "ALTER TABLE mysql.slave_relay_log_info ENGINE= $rpl_engine;"; } | $mysqld_install_cmd_line > /dev/null
-  then
-    s_echo "OK"
-  else
-    echo
-    echo "WARNING: CRASH-SAFE SLAVE IS NOT COMPLETELY CONFIGURED!"
-    echo "The \"CRASH-SAFE SLAVE\" might not work properly."
-  fi
-fi
-
 s_echo "Filling help tables..."
 if { echo "use mysql;"; cat $fill_help_tables; } | $mysqld_install_cmd_line > /dev/null
 then

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2010-12-29 00:38:59 +0000
+++ b/scripts/mysql_system_tables.sql	2011-01-11 23:01:02 +0000
@@ -100,10 +100,12 @@ CREATE TABLE IF NOT EXISTS event ( db ch
 
 CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
 
-CREATE TABLE IF NOT EXISTS slave_relay_log_info (Master_id INTEGER UNSIGNED NOT NULL, Number_of_lines INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Sql_delay INTEGER NOT NULL, PRIMARY KEY(Master_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Relay Log Information';
+CREATE TABLE IF NOT EXISTS slave_relay_log_info (Master_id INTEGER UNSIGNED NOT NULL, Number_of_lines INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Sql_delay INTEGER NOT NULL, Number_of_workers INTEGER UNSIGNED NOT NULL, PRIMARY KEY(Master_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Relay Log Information';
 
 CREATE TABLE IF NOT EXISTS slave_master_info (Master_id INTEGER UNSIGNED NOT NULL, Number_of_lines INTEGER UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Host TEXT CHARACTER SET utf8 COLLATE utf8_bin, User_name TEXT CHARACTER SET utf8 COLLATE utf8_bin, User_password TEXT CHARACTER SET utf8 COLLATE utf8_bin, Port INTEGER UNSIGNED NOT NULL, Connect_retry INTEGER UNSIGNED NOT NULL, Enabled_ssl BOOLEAN NOT NULL, Ssl_ca TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_capath TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_cert TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_cipher TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_key TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ssl_verify_servert_cert BOOLEAN NOT NULL, Heartbeat FLOAT NOT NULL, Bind TEXT CHARACTER SET utf8 COLLATE utf8_bin, Ignored_server_ids TEXT CHARACTER SET utf8 COLLATE utf8_bin, Uuid TEXT CHARACTER SET utf8 COLLATE utf8_bin, Retry_count BIGIN!
 T UNSIGNED NOT NULL, PRIMARY KEY(Master_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Master Information';
 
+CREATE TABLE IF NOT EXISTS slave_worker_info (Master_id INTEGER UNSIGNED NOT NULL, Worker_id INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_relay_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_seqno INT UNSIGNED NOT NULL, Checkpoint_group_size INTEGER UNSIGNED NOT NULL, Checkpoint_group_bitmap BLOB NOT NULL, PRIMARY KEY(Master_id, Worker_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Worker Information';
+
 --
 -- PERFORMANCE SCHEMA INSTALLATION
 -- Note that this script is also reused by mysql_upgrade,


Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20110518171247-1afvl6yql7v3drqz.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3487) WL#5569WL#5754Andrei Elkin19 May