Skip to content

Commit 6966ed2

Browse files
committed
Bug#25807358: GET RID OF TMP_DISABLE_BINLOG/REENABLE_BINLOG MACROS
Post-post-push fix: Handle cases where Rpl_info_table_access::create_thd() doesn't create a THD and Rpl_info_table_access::drop_thd() doesn't delete a THD.
1 parent c195927 commit 6966ed2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sql/rpl_info_table.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ int Rpl_info_table::do_init_info(enum_find_method method, uint instance)
122122
THD *thd= access->create_thd();
123123

124124
saved_mode= thd->variables.sql_mode;
125+
ulonglong saved_options= thd->variables.option_bits;
125126
thd->variables.option_bits &= ~OPTION_BIN_LOG;
126127

127128
/*
@@ -171,6 +172,7 @@ int Rpl_info_table::do_init_info(enum_find_method method, uint instance)
171172
*/
172173
access->close_table(thd, table, &backup, error);
173174
thd->variables.sql_mode= saved_mode;
175+
thd->variables.option_bits= saved_options;
174176
access->drop_thd(thd);
175177
DBUG_RETURN(error);
176178
}
@@ -193,6 +195,7 @@ int Rpl_info_table::do_flush_info(const bool force)
193195

194196
sync_counter= 0;
195197
saved_mode= thd->variables.sql_mode;
198+
ulonglong saved_options= thd->variables.option_bits;
196199
thd->variables.option_bits &= ~OPTION_BIN_LOG;
197200
thd->is_operating_substatement_implicitly= true;
198201

@@ -281,6 +284,7 @@ int Rpl_info_table::do_flush_info(const bool force)
281284
access->close_table(thd, table, &backup, error);
282285
thd->is_operating_substatement_implicitly= false;
283286
thd->variables.sql_mode= saved_mode;
287+
thd->variables.option_bits= saved_options;
284288
access->drop_thd(thd);
285289
DBUG_RETURN(error);
286290
}
@@ -303,6 +307,7 @@ int Rpl_info_table::do_clean_info()
303307
THD *thd= access->create_thd();
304308

305309
saved_mode= thd->variables.sql_mode;
310+
ulonglong saved_options= thd->variables.option_bits;
306311
thd->variables.option_bits &= ~OPTION_BIN_LOG;
307312

308313
/*
@@ -335,6 +340,7 @@ int Rpl_info_table::do_clean_info()
335340
*/
336341
access->close_table(thd, table, &backup, error);
337342
thd->variables.sql_mode= saved_mode;
343+
thd->variables.option_bits= saved_options;
338344
access->drop_thd(thd);
339345
DBUG_RETURN(error);
340346
}
@@ -371,6 +377,7 @@ int Rpl_info_table::do_reset_info(uint nparam,
371377

372378
thd= info->access->create_thd();
373379
saved_mode= thd->variables.sql_mode;
380+
ulonglong saved_options= thd->variables.option_bits;
374381
thd->variables.option_bits &= ~OPTION_BIN_LOG;
375382

376383
/*
@@ -445,6 +452,7 @@ int Rpl_info_table::do_reset_info(uint nparam,
445452
*/
446453
info->access->close_table(thd, table, &backup, error);
447454
thd->variables.sql_mode= saved_mode;
455+
thd->variables.option_bits= saved_options;
448456
info->access->drop_thd(thd);
449457
delete info;
450458
DBUG_RETURN(error);
@@ -797,6 +805,7 @@ bool Rpl_info_table::do_update_is_transactional()
797805

798806
THD *thd= access->create_thd();
799807
saved_mode= thd->variables.sql_mode;
808+
ulonglong saved_options= thd->variables.option_bits;
800809
thd->variables.option_bits &= ~OPTION_BIN_LOG;
801810

802811
/*
@@ -813,6 +822,7 @@ bool Rpl_info_table::do_update_is_transactional()
813822
end:
814823
access->close_table(thd, table, &backup, 0);
815824
thd->variables.sql_mode= saved_mode;
825+
thd->variables.option_bits= saved_options;
816826
access->drop_thd(thd);
817827
DBUG_RETURN(error);
818828
}

0 commit comments

Comments
 (0)