@@ -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()
813822end:
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