diff options
Diffstat (limited to 'sql/sql_tvc.cc')
-rw-r--r-- | sql/sql_tvc.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index 49f319b3856..a191ec9c328 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -422,7 +422,9 @@ bool table_value_constr::exec(SELECT_LEX *sl) DBUG_ENTER("table_value_constr::exec"); List_iterator_fast<List_item> li(lists_of_values); List_item *elem; + THD *cur_thd= sl->parent_lex->thd; ha_rows send_records= 0; + int rc; if (select_options & SELECT_DESCRIBE) DBUG_RETURN(false); @@ -438,16 +440,21 @@ bool table_value_constr::exec(SELECT_LEX *sl) while ((elem= li++)) { + cur_thd->get_stmt_da()->inc_current_row_for_warning(); if (send_records >= sl->master_unit()->lim.get_select_limit()) - break; - int rc= - result->send_data_with_check(*elem, sl->master_unit(), send_records); + goto reset_counter_and_exit; + rc= result->send_data_with_check(*elem, sl->master_unit(), send_records); if (!rc) send_records++; else if (rc > 0) - DBUG_RETURN(true); + goto reset_counter_and_exit; } +reset_counter_and_exit: + cur_thd->get_stmt_da()->reset_current_row_for_warning(0); + if (rc>0) + DBUG_RETURN(true); + if (result->send_eof()) DBUG_RETURN(true); |