diff options
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index e35cf17b182..0403d6e73c3 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -728,6 +728,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, explain= (Explain_delete*)thd->lex->explain->get_upd_del_plan(); explain->tracker.on_scan_init(); + thd->get_stmt_da()->reset_current_row_for_warning(1); + if (!delete_while_scanning) { /* @@ -793,9 +795,11 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, THD_STAGE_INFO(thd, stage_updating); fix_rownum_pointers(thd, thd->lex->current_select, &deleted); + thd->get_stmt_da()->reset_current_row_for_warning(0); while (likely(!(error=info.read_record())) && likely(!thd->killed) && likely(!thd->is_error())) { + thd->get_stmt_da()->inc_current_row_for_warning(); if (delete_while_scanning) delete_record= record_should_be_deleted(thd, table, select, explain, delete_history); @@ -871,6 +875,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, else break; } + thd->get_stmt_da()->reset_current_row_for_warning(1); terminate_delete: killed_status= thd->killed; |