Skip to content

Commit 87e3650

Browse files
committed
Another attempt to fix rpl.rpl_unsafe_statements
Summary: The rpl.rpl_unsafe_statements test was added in 5.6.29 and when we rebased to 5.6.35 it started causing a problem with the diff "optionally disable binlogging while executing triggers". This is an attempt to modify that diff to work correctly for this case. Squash with: cdeb012 Test Plan: MTR Reviewers: arahut, mung Reviewed By: mung Subscribers: webscalesql-eng@fb.com Differential Revision: https://phabricator.intern.facebook.com/D4836512 Tasks: 17136505 Signature: t1:4836512:1491420957:b8732a9cc65b7d1f44870dd9371282b1561c9dd9
1 parent b9c8bd2 commit 87e3650

File tree

7 files changed

+8
-1
lines changed

7 files changed

+8
-1
lines changed

sql/handler.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7511,7 +7511,7 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
75117511
table->s->cached_row_logging_check &&
75127512
(thd->variables.option_bits & OPTION_BIN_LOG) &&
75137513
mysql_bin_log.is_open() &&
7514-
!table->pos_in_table_list->disable_sql_log_bin_triggers);
7514+
!table->disable_sql_log_bin_triggers);
75157515
}
75167516

75177517

sql/sql_base.cc

+2
Original file line numberDiff line numberDiff line change
@@ -8540,6 +8540,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
85408540
{
85418541
TABLE *table= table_list->table;
85428542
table->pos_in_table_list= table_list;
8543+
table->disable_sql_log_bin_triggers=
8544+
table_list->disable_sql_log_bin_triggers;
85438545
if (first_select_table &&
85448546
table_list->top_table() == first_select_table)
85458547
{

sql/sql_optimizer.cc

+1
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, Item *conds,
32123212
TABLE *const table= tables->table;
32133213
s->table= table;
32143214
table->pos_in_table_list= tables;
3215+
table->disable_sql_log_bin_triggers= tables->disable_sql_log_bin_triggers;
32153216
error= tables->fetch_number_of_rows();
32163217

32173218
DBUG_EXECUTE_IF("bug11747970_raise_error",

sql/sql_select.cc

+1
Original file line numberDiff line numberDiff line change
@@ -2748,6 +2748,7 @@ bool JOIN::setup_materialized_table(JOIN_TAB *tab, uint tableno,
27482748
tab->materialize_table= join_materialize_semijoin;
27492749

27502750
table->pos_in_table_list= tl;
2751+
table->disable_sql_log_bin_triggers= tl->disable_sql_log_bin_triggers;
27512752
table->keys_in_use_for_query.set_all();
27522753
sjm_pos->table= tab;
27532754
sjm_pos->sj_strategy= SJ_OPT_NONE;

sql/sql_update.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,7 @@ int multi_update::prepare(List<Item> &not_used_values,
16391639
table->no_keyread=1;
16401640
table->covering_keys.clear_all();
16411641
table->pos_in_table_list= tl;
1642+
table->disable_sql_log_bin_triggers= tl->disable_sql_log_bin_triggers;
16421643
table->prepare_triggers_for_update_stmt_or_event();
16431644
}
16441645
}

sql/table.cc

+1
Original file line numberDiff line numberDiff line change
@@ -4035,6 +4035,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
40354035
auto_increment_field_not_null= FALSE;
40364036

40374037
pos_in_table_list= tl;
4038+
disable_sql_log_bin_triggers= tl->disable_sql_log_bin_triggers;
40384039

40394040
clear_column_bitmaps();
40404041

sql/table.h

+1
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ struct TABLE
12921292
close_thread_tables!!!
12931293
*/
12941294
my_bool m_needs_reopen;
1295+
my_bool disable_sql_log_bin_triggers;
12951296
private:
12961297
bool created; /* For tmp tables. TRUE <=> tmp table has been instantiated.*/
12971298
bool tmp_file_created; /* For tmp tables. It is TRUE when the files of the

0 commit comments

Comments
 (0)