From d45841b9be6fe069383cc05405f747ae36d08362 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Tue, 26 Apr 2022 12:58:48 +0530 Subject: MDEV-26695: Number of an invalid row is not calculated for table value constructor Analysis: counter does not increment while sending rows for table value constructor and so row_number assumes the default value (0 in this case). Fix: Increment the counter to avoid counter using default value. --- sql/sql_tvc.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/sql_tvc.cc') diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index 9a99224b26e..72d53b2307c 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -406,9 +406,11 @@ bool table_value_constr::exec(SELECT_LEX *sl) while ((elem= li++)) { + THD *cur_thd= sl->parent_lex->thd; if (send_records >= sl->master_unit()->select_limit_cnt) break; int rc= result->send_data(*elem); + cur_thd->get_stmt_da()->inc_current_row_for_warning(); if (!rc) send_records++; else if (rc > 0) -- cgit v1.2.1