[Commits] Rev 4047: RBR triggers compiled-out with ifdefs in 10.0 in file:///home/bell/maria/bzr/work-maria-10.0-MDEV-5095/

sanja at montyprogram.com sanja at montyprogram.com
Tue Mar 11 21:27:24 EET 2014


At file:///home/bell/maria/bzr/work-maria-10.0-MDEV-5095/

------------------------------------------------------------
revno: 4047
revision-id: sanja at montyprogram.com-20140311192722-xdu1suwtdv8nkmcv
parent: sanja at montyprogram.com-20140311115651-kuwrllpb0wdyw22u
committer: sanja at montyprogram.com
branch nick: work-maria-10.0-MDEV-5095
timestamp: Tue 2014-03-11 21:27:22 +0200
message:
  RBR triggers compiled-out with ifdefs in 10.0
-------------- next part --------------
=== modified file 'mysql-test/r/mysqld--help.result'
--- a/mysql-test/r/mysqld--help.result	2014-03-11 11:56:51 +0000
+++ b/mysql-test/r/mysqld--help.result	2014-03-11 19:27:22 +0000
@@ -904,15 +904,6 @@ The following options may be given as th
  in parallel events on the slave that were group-committed
  on the master or were logged with GTID in different
  replication domains.
- --slave-run-triggers-for-rbr=name 
- Modes for how triggers in row-base replication on slave
- side will be executed. Legal values are NO (default), YES
- and LOGGING. NO means that trigger for RBR will not be
- running on slave. YES and LOGGING means that triggers
- will be running on slave, if there was not triggers
- running on the master for the statement. LOGGING also
- means results of that the executed triggers work will be
- written to the binlog.
  --slave-skip-errors=name 
  Tells the slave thread to continue replication when a
  query event returns an error from the provided list
@@ -1298,7 +1289,6 @@ slave-max-allowed-packet 1073741824
 slave-net-timeout 3600
 slave-parallel-max-queued 131072
 slave-parallel-threads 0
-slave-run-triggers-for-rbr NO
 slave-skip-errors (No default value)
 slave-sql-verify-checksum TRUE
 slave-transaction-retries 10

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2014-03-11 11:56:51 +0000
+++ b/sql/log_event.cc	2014-03-11 19:27:22 +0000
@@ -9485,10 +9485,12 @@ int Rows_log_event::do_add_row_data(ucha
 */
 static void restore_empty_query_table_list(LEX *lex)
 {
+#ifdef RBR_TRIGGERS
   if (lex->first_not_own_table())
       (*lex->first_not_own_table()->prev_global)= NULL;
   lex->query_tables= NULL;
   lex->query_tables_last= &lex->query_tables;
+#endif //RBR_TRIGGERS
 }
 
 
@@ -10042,7 +10044,7 @@ Rows_log_event::do_update_pos(rpl_group_
   DBUG_RETURN(error);
 }
 
-#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
+#endif //defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
 
 #ifndef MYSQL_CLIENT
 bool Rows_log_event::write_data_header(IO_CACHE *file)
@@ -10394,8 +10396,10 @@ Table_map_log_event::Table_map_log_event
   DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
   m_data_size+= (cbuf_end - cbuf) + m_colcnt;	// COLCNT and column types
 
+#ifdef RBR_TRIGGERS
   if (tbl->triggers)
     m_flags|= TM_BIT_HAS_TRIGGERS_F;
+#endif //RBR_TRIGGERS
 
   /* If malloc fails, caught in is_valid() */
   if ((m_memory= (uchar*) my_malloc(m_colcnt, MYF(MY_WME))))
@@ -10804,7 +10808,9 @@ int Table_map_log_event::do_apply_event(
   table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
   table_list->updating= 1;
   table_list->required_type= FRMTYPE_TABLE;
+#ifdef RBR_TRIGGERS
   table_list->master_had_triggers= ((m_flags & TM_BIT_HAS_TRIGGERS_F) ? 1 : 0);
+#endif //RBR_TRIGGERS
   DBUG_PRINT("debug", ("table: %s is mapped to %u%s",
                        table_list->table_name, table_list->table_id,
                        (table_list->master_had_triggers ?
@@ -11126,6 +11132,7 @@ bool Rows_log_event::process_triggers(tr
                                       trg_action_time_type time_type,
                                       bool old_row_is_record1)
 {
+#ifdef RBR_TRIGGERS
   bool result;
   DBUG_ENTER("Rows_log_event::process_triggers");
   if (slave_run_triggers_for_rbr == SLAVE_RUN_TRIGGERS_FOR_RBR_YES)
@@ -11140,6 +11147,9 @@ bool Rows_log_event::process_triggers(tr
                                               time_type, old_row_is_record1);
 
   DBUG_RETURN(result);
+#else
+  return TRUE;
+#endif //RBR_TRIGGERS
 }
 /*
   Check if there are more UNIQUE keys after the given key.
@@ -11223,8 +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
   auto_afree_ptr<char> key(NULL);
 
   prepare_record(table, m_width,
@@ -11254,6 +11269,7 @@ Rows_log_event::write_row(rpl_group_info
   DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set);
 #endif
 
+
   if (invoke_triggers &&
       process_triggers(TRG_EVENT_INSERT, TRG_ACTION_BEFORE, TRUE))
   {
@@ -11386,6 +11402,7 @@ Rows_log_event::write_row(rpl_group_info
         !table->file->referenced_by_foreign_key())
     {
       DBUG_PRINT("info",("Updating row using ha_update_row()"));
+
       if (invoke_triggers &&
           process_triggers(TRG_EVENT_UPDATE, TRG_ACTION_BEFORE, FALSE))
         error= HA_ERR_GENERIC; // in case if error is not set yet
@@ -12106,8 +12123,10 @@ Delete_rows_log_event::do_before_row_ope
     */
     return 0;
   }
+#ifdef RBR_TRIGGERS
   if (slave_run_triggers_for_rbr && !master_had_triggers)
     m_table->prepare_triggers_for_delete_stmt_or_event();
+#endif //RBR_TRIGGERS
 
   return find_key();
 }
@@ -12128,8 +12147,12 @@ Delete_rows_log_event::do_after_row_oper
 int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
 {
   int error;
+#ifdef RBR_TRIGGERS
   bool invoke_triggers=
     slave_run_triggers_for_rbr && !master_had_triggers && m_table->triggers;
+#else
+#define invoke_triggers 0
+#endif //RBR_TRIGGERS
   DBUG_ASSERT(m_table != NULL);
 
   if (!(error= find_row(rgi))) 
@@ -12272,8 +12295,12 @@ Update_rows_log_event::do_after_row_oper
 int 
 Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
 {
+#ifdef RBR_TRIGGERS
   bool invoke_triggers=
     slave_run_triggers_for_rbr && !master_had_triggers && m_table->triggers;
+#else
+#define invoke_triggers 0
+#endif //RBR_TRIGGERS
   DBUG_ASSERT(m_table != NULL);
 
   int error= find_row(rgi); 

=== modified file 'sql/log_event.h'
--- a/sql/log_event.h	2014-03-11 11:56:51 +0000
+++ b/sql/log_event.h	2014-03-11 19:27:22 +0000
@@ -4340,7 +4340,7 @@ protected:
   bool process_triggers(trg_event_type event,
                         trg_action_time_type time_type,
                         bool old_row_is_record1);
-#endif
+#endif //defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
 
 private:
 

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2014-03-11 11:56:51 +0000
+++ b/sql/mysqld.cc	2014-03-11 19:27:22 +0000
@@ -479,7 +479,9 @@ ulong open_files_limit, max_binlog_size;
 ulong slave_trans_retries;
 uint  slave_net_timeout;
 ulong slave_exec_mode_options;
+#ifdef RBR_TRIGGERS
 ulong slave_run_triggers_for_rbr= 0;
+#endif //RBR_TRIGGERS
 ulong slave_ddl_exec_mode_options= SLAVE_EXEC_MODE_IDEMPOTENT;
 ulonglong slave_type_conversions_options;
 ulong thread_cache_size=0;

=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h	2014-03-11 11:56:51 +0000
+++ b/sql/mysqld.h	2014-03-11 19:27:22 +0000
@@ -98,7 +98,11 @@ extern my_bool opt_safe_show_db, opt_loc
 extern my_bool opt_slave_compressed_protocol, use_temp_pool;
 extern ulong slave_exec_mode_options, slave_ddl_exec_mode_options;
 extern ulong slave_retried_transactions;
+#ifdef RBR_TRIGGERS
 extern ulong slave_run_triggers_for_rbr;
+#else
+#define slave_run_triggers_for_rbr 0
+#endif //RBR_TRIGGERS
 extern ulonglong slave_type_conversions_options;
 extern my_bool read_only, opt_readonly;
 extern my_bool lower_case_file_system;

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2014-03-11 11:56:51 +0000
+++ b/sql/sys_vars.cc	2014-03-11 19:27:22 +0000
@@ -2692,6 +2692,7 @@ static Sys_var_enum Slave_ddl_exec_mode(
        GLOBAL_VAR(slave_ddl_exec_mode_options), CMD_LINE(REQUIRED_ARG),
        slave_exec_mode_names, DEFAULT(SLAVE_EXEC_MODE_IDEMPOTENT));
 
+#ifdef RBR_TRIGGERS
 static const char *slave_run_triggers_for_rbr_names[]=
   {"NO", "YES", "LOGGING", 0};
 static Sys_var_enum Slave_run_triggers_for_rbr(
@@ -2706,6 +2707,7 @@ static Sys_var_enum Slave_run_triggers_f
        GLOBAL_VAR(slave_run_triggers_for_rbr), CMD_LINE(REQUIRED_ARG),
        slave_run_triggers_for_rbr_names,
        DEFAULT(SLAVE_RUN_TRIGGERS_FOR_RBR_NO));
+#endif //RBR_TRIGGERS
 
 static const char *slave_type_conversions_name[]= {"ALL_LOSSY", "ALL_NON_LOSSY", 0};
 static Sys_var_set Slave_type_conversions(



More information about the commits mailing list