Skip to content

Commit

Permalink
Another attempt to fix rpl.rpl_unsafe_statements
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jkedgar committed Apr 5, 2017
1 parent b9c8bd2 commit 87e3650
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7511,7 +7511,7 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
table->s->cached_row_logging_check &&
(thd->variables.option_bits & OPTION_BIN_LOG) &&
mysql_bin_log.is_open() &&
!table->pos_in_table_list->disable_sql_log_bin_triggers);
!table->disable_sql_log_bin_triggers);
}


Expand Down
2 changes: 2 additions & 0 deletions sql/sql_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8540,6 +8540,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
{
TABLE *table= table_list->table;
table->pos_in_table_list= table_list;
table->disable_sql_log_bin_triggers=
table_list->disable_sql_log_bin_triggers;
if (first_select_table &&
table_list->top_table() == first_select_table)
{
Expand Down
1 change: 1 addition & 0 deletions sql/sql_optimizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables_arg, Item *conds,
TABLE *const table= tables->table;
s->table= table;
table->pos_in_table_list= tables;
table->disable_sql_log_bin_triggers= tables->disable_sql_log_bin_triggers;
error= tables->fetch_number_of_rows();

DBUG_EXECUTE_IF("bug11747970_raise_error",
Expand Down
1 change: 1 addition & 0 deletions sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2748,6 +2748,7 @@ bool JOIN::setup_materialized_table(JOIN_TAB *tab, uint tableno,
tab->materialize_table= join_materialize_semijoin;

table->pos_in_table_list= tl;
table->disable_sql_log_bin_triggers= tl->disable_sql_log_bin_triggers;
table->keys_in_use_for_query.set_all();
sjm_pos->table= tab;
sjm_pos->sj_strategy= SJ_OPT_NONE;
Expand Down
1 change: 1 addition & 0 deletions sql/sql_update.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,7 @@ int multi_update::prepare(List<Item> &not_used_values,
table->no_keyread=1;
table->covering_keys.clear_all();
table->pos_in_table_list= tl;
table->disable_sql_log_bin_triggers= tl->disable_sql_log_bin_triggers;
table->prepare_triggers_for_update_stmt_or_event();
}
}
Expand Down
1 change: 1 addition & 0 deletions sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4035,6 +4035,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
auto_increment_field_not_null= FALSE;

pos_in_table_list= tl;
disable_sql_log_bin_triggers= tl->disable_sql_log_bin_triggers;

clear_column_bitmaps();

Expand Down
1 change: 1 addition & 0 deletions sql/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,7 @@ struct TABLE
close_thread_tables!!!
*/
my_bool m_needs_reopen;
my_bool disable_sql_log_bin_triggers;
private:
bool created; /* For tmp tables. TRUE <=> tmp table has been instantiated.*/
bool tmp_file_created; /* For tmp tables. It is TRUE when the files of the
Expand Down

0 comments on commit 87e3650

Please sign in to comment.