Hi, Oleksandr! Ok to push. See a couple of comments below. On Mar 18, Oleksandr Byelkin wrote:
=== added file 'mysql-test/suite/rpl/t/rpl_row_triggers.test' --- mysql-test/suite/rpl/t/rpl_row_triggers.test 1970-01-01 00:00:00 +0000 +++ mysql-test/suite/rpl/t/rpl_row_triggers.test 2014-03-11 08:49:31 +0000 @@ -0,0 +1,280 @@ +-- source include/have_binlog_format_row.inc +-- source include/have_rbr_triggers.inc +-- source include/master-slave.inc +-- source include/have_innodb.inc
Note that master-slave.inc should always be the last in the series of includes. Everything that can fail should be before it, otherwise you can abort and skip the test after configuring replication, but without a corresponding replication cleanup. It will affect following tests.
=== added file 'mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test' --- mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test 1970-01-01 00:00:00 +0000 +++ mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test 2014-03-11 08:49:48 +0000 @@ -0,0 +1,43 @@ +--source include/master-slave.inc +--source include/have_binlog_format_statement.inc +--source include/have_rbr_triggers.inc
Same here.
=== modified file 'sql/log_event.cc' --- sql/log_event.cc 2014-03-05 22:20:10 +0000 +++ sql/log_event.cc 2014-03-11 18:39:51 +0000 @@ -11121,6 +11233,13 @@ Rows_log_event::write_row(rpl_group_info TABLE *table= m_table; // pointer to event's table int error; int UNINIT_VAR(keynum); + +#ifdef RBR_TRIGGERS + bool invoke_triggers= + slave_run_triggers_for_rbr && !master_had_triggers && table->triggers; +#else +#define invoke_triggers 0 +#endif //RBR_TRIGGERS
I think you don't need this ifdef, just declare invoke_triggers as const: const bool invoke_triggers= slave_run_triggers_for_rbr && !master_had_triggers && table->triggers;
auto_afree_ptr<char> key(NULL);
prepare_record(table, m_width,
Regards, Sergei