Commit e7704bfd authored by unknown's avatar unknown

RBR triggers compiled-out with ifdefs in 10.0

parent af3180ab
...@@ -1301,7 +1301,6 @@ slave-max-allowed-packet 1073741824 ...@@ -1301,7 +1301,6 @@ slave-max-allowed-packet 1073741824
slave-net-timeout 3600 slave-net-timeout 3600
slave-parallel-max-queued 131072 slave-parallel-max-queued 131072
slave-parallel-threads 0 slave-parallel-threads 0
slave-run-triggers-for-rbr NO
slave-skip-errors (No default value) slave-skip-errors (No default value)
slave-sql-verify-checksum TRUE slave-sql-verify-checksum TRUE
slave-transaction-retries 10 slave-transaction-retries 10
......
...@@ -9486,10 +9486,12 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length) ...@@ -9486,10 +9486,12 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length)
*/ */
static void restore_empty_query_table_list(LEX *lex) static void restore_empty_query_table_list(LEX *lex)
{ {
#ifdef RBR_TRIGGERS
if (lex->first_not_own_table()) if (lex->first_not_own_table())
(*lex->first_not_own_table()->prev_global)= NULL; (*lex->first_not_own_table()->prev_global)= NULL;
lex->query_tables= NULL; lex->query_tables= NULL;
lex->query_tables_last= &lex->query_tables; lex->query_tables_last= &lex->query_tables;
#endif //RBR_TRIGGERS
} }
...@@ -10043,7 +10045,7 @@ Rows_log_event::do_update_pos(rpl_group_info *rgi) ...@@ -10043,7 +10045,7 @@ Rows_log_event::do_update_pos(rpl_group_info *rgi)
DBUG_RETURN(error); DBUG_RETURN(error);
} }
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ #endif //defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
bool Rows_log_event::write_data_header(IO_CACHE *file) bool Rows_log_event::write_data_header(IO_CACHE *file)
...@@ -10395,8 +10397,10 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, ...@@ -10395,8 +10397,10 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid,
DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf)); DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
m_data_size+= (cbuf_end - cbuf) + m_colcnt; // COLCNT and column types m_data_size+= (cbuf_end - cbuf) + m_colcnt; // COLCNT and column types
#ifdef RBR_TRIGGERS
if (tbl->triggers) if (tbl->triggers)
m_flags|= TM_BIT_HAS_TRIGGERS_F; m_flags|= TM_BIT_HAS_TRIGGERS_F;
#endif //RBR_TRIGGERS
/* If malloc fails, caught in is_valid() */ /* If malloc fails, caught in is_valid() */
if ((m_memory= (uchar*) my_malloc(m_colcnt, MYF(MY_WME)))) if ((m_memory= (uchar*) my_malloc(m_colcnt, MYF(MY_WME))))
...@@ -10805,7 +10809,9 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi) ...@@ -10805,7 +10809,9 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi)
table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id); table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
table_list->updating= 1; table_list->updating= 1;
table_list->required_type= FRMTYPE_TABLE; table_list->required_type= FRMTYPE_TABLE;
#ifdef RBR_TRIGGERS
table_list->master_had_triggers= ((m_flags & TM_BIT_HAS_TRIGGERS_F) ? 1 : 0); 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", DBUG_PRINT("debug", ("table: %s is mapped to %u%s",
table_list->table_name, table_list->table_id, table_list->table_name, table_list->table_id,
(table_list->master_had_triggers ? (table_list->master_had_triggers ?
...@@ -11127,6 +11133,7 @@ bool Rows_log_event::process_triggers(trg_event_type event, ...@@ -11127,6 +11133,7 @@ bool Rows_log_event::process_triggers(trg_event_type event,
trg_action_time_type time_type, trg_action_time_type time_type,
bool old_row_is_record1) bool old_row_is_record1)
{ {
#ifdef RBR_TRIGGERS
bool result; bool result;
DBUG_ENTER("Rows_log_event::process_triggers"); DBUG_ENTER("Rows_log_event::process_triggers");
if (slave_run_triggers_for_rbr == SLAVE_RUN_TRIGGERS_FOR_RBR_YES) if (slave_run_triggers_for_rbr == SLAVE_RUN_TRIGGERS_FOR_RBR_YES)
...@@ -11141,6 +11148,9 @@ bool Rows_log_event::process_triggers(trg_event_type event, ...@@ -11141,6 +11148,9 @@ bool Rows_log_event::process_triggers(trg_event_type event,
time_type, old_row_is_record1); time_type, old_row_is_record1);
DBUG_RETURN(result); DBUG_RETURN(result);
#else
return TRUE;
#endif //RBR_TRIGGERS
} }
/* /*
Check if there are more UNIQUE keys after the given key. Check if there are more UNIQUE keys after the given key.
...@@ -12107,8 +12117,10 @@ Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability ...@@ -12107,8 +12117,10 @@ Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability
*/ */
return 0; return 0;
} }
#ifdef RBR_TRIGGERS
if (slave_run_triggers_for_rbr && !master_had_triggers) if (slave_run_triggers_for_rbr && !master_had_triggers)
m_table->prepare_triggers_for_delete_stmt_or_event(); m_table->prepare_triggers_for_delete_stmt_or_event();
#endif //RBR_TRIGGERS
return find_key(); return find_key();
} }
......
...@@ -4340,7 +4340,7 @@ protected: ...@@ -4340,7 +4340,7 @@ protected:
bool process_triggers(trg_event_type event, bool process_triggers(trg_event_type event,
trg_action_time_type time_type, trg_action_time_type time_type,
bool old_row_is_record1); bool old_row_is_record1);
#endif #endif //defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
private: private:
......
...@@ -479,7 +479,9 @@ ulong open_files_limit, max_binlog_size; ...@@ -479,7 +479,9 @@ ulong open_files_limit, max_binlog_size;
ulong slave_trans_retries; ulong slave_trans_retries;
uint slave_net_timeout; uint slave_net_timeout;
ulong slave_exec_mode_options; ulong slave_exec_mode_options;
#ifdef RBR_TRIGGERS
ulong slave_run_triggers_for_rbr= 0; ulong slave_run_triggers_for_rbr= 0;
#endif //RBR_TRIGGERS
ulong slave_ddl_exec_mode_options= SLAVE_EXEC_MODE_IDEMPOTENT; ulong slave_ddl_exec_mode_options= SLAVE_EXEC_MODE_IDEMPOTENT;
ulonglong slave_type_conversions_options; ulonglong slave_type_conversions_options;
ulong thread_cache_size=0; ulong thread_cache_size=0;
......
...@@ -98,7 +98,11 @@ extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap; ...@@ -98,7 +98,11 @@ extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern ulong slave_exec_mode_options, slave_ddl_exec_mode_options; extern ulong slave_exec_mode_options, slave_ddl_exec_mode_options;
extern ulong slave_retried_transactions; extern ulong slave_retried_transactions;
#ifdef RBR_TRIGGERS
extern ulong slave_run_triggers_for_rbr; 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 ulonglong slave_type_conversions_options;
extern my_bool read_only, opt_readonly; extern my_bool read_only, opt_readonly;
extern my_bool lower_case_file_system; extern my_bool lower_case_file_system;
......
...@@ -2737,6 +2737,7 @@ static Sys_var_enum Slave_ddl_exec_mode( ...@@ -2737,6 +2737,7 @@ static Sys_var_enum Slave_ddl_exec_mode(
GLOBAL_VAR(slave_ddl_exec_mode_options), CMD_LINE(REQUIRED_ARG), GLOBAL_VAR(slave_ddl_exec_mode_options), CMD_LINE(REQUIRED_ARG),
slave_exec_mode_names, DEFAULT(SLAVE_EXEC_MODE_IDEMPOTENT)); slave_exec_mode_names, DEFAULT(SLAVE_EXEC_MODE_IDEMPOTENT));
#ifdef RBR_TRIGGERS
static const char *slave_run_triggers_for_rbr_names[]= static const char *slave_run_triggers_for_rbr_names[]=
{"NO", "YES", "LOGGING", 0}; {"NO", "YES", "LOGGING", 0};
static Sys_var_enum Slave_run_triggers_for_rbr( static Sys_var_enum Slave_run_triggers_for_rbr(
...@@ -2751,6 +2752,7 @@ static Sys_var_enum Slave_run_triggers_for_rbr( ...@@ -2751,6 +2752,7 @@ static Sys_var_enum Slave_run_triggers_for_rbr(
GLOBAL_VAR(slave_run_triggers_for_rbr), CMD_LINE(REQUIRED_ARG), GLOBAL_VAR(slave_run_triggers_for_rbr), CMD_LINE(REQUIRED_ARG),
slave_run_triggers_for_rbr_names, slave_run_triggers_for_rbr_names,
DEFAULT(SLAVE_RUN_TRIGGERS_FOR_RBR_NO)); DEFAULT(SLAVE_RUN_TRIGGERS_FOR_RBR_NO));
#endif //RBR_TRIGGERS
static const char *slave_type_conversions_name[]= {"ALL_LOSSY", "ALL_NON_LOSSY", 0}; static const char *slave_type_conversions_name[]= {"ALL_LOSSY", "ALL_NON_LOSSY", 0};
static Sys_var_set Slave_type_conversions( static Sys_var_set Slave_type_conversions(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment