diff --git a/sql/handler.cc b/sql/handler.cc index 27eccb3ab98a..63cda776373a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2911,7 +2911,7 @@ void handler::ha_statistic_increment( (table->in_use->status_var.*offset)++; table->in_use->check_limit_rows_examined(); table->in_use->update_sql_stats_periodic(); - table->in_use->check_yield(std::bind(yield_condition, table)); + table->in_use->check_yield([t=table]{ return yield_condition(t); }); } } @@ -6489,7 +6489,7 @@ ha_rows handler::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, while (!seq->next(seq_it, &range)) { if (unlikely(thd->killed != 0)) return HA_POS_ERROR; - thd->check_yield(std::bind(yield_condition, table)); + thd->check_yield([t=table]{ return yield_condition(t); }); n_ranges++; key_range *min_endp, *max_endp; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1e2b7ae4c56b..f159b9ed159f 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2731,7 +2731,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) { } void THD::check_yield(std::function cond) { - yield_cond = cond; + yield_cond = std::move(cond); thd_wait_begin(this, THD_WAIT_YIELD); thd_wait_end(this); yield_cond = nullptr;