summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2022-01-22 16:51:21 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2022-01-22 22:23:13 +0530
commit5e04903f592bb425d52f9fa18388e1e64b67497f (patch)
tree8f4a08658455c4759eacb21c9de3c53238ab6c8a /sql/sql_prepare.cc
parent5e6fd4e80435ae6d5994abbff6032c7957713410 (diff)
downloadmariadb-git-bb-10.7-MDEV-26843.tar.gz
MDEV-26843: Inconsistent behavior of ROW_NUMBER upon resignalling frombb-10.7-MDEV-26843
function Analysis: m_current_row_for_warning is reset to 0 earlier so new value '0' of the counter gets recorded for error condition. Fix: reset m_current_row_for_warning after other error conditions.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 68dd670787c..739f744f058 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1347,7 +1347,7 @@ static bool mysql_test_insert_common(Prepared_statement *stmt,
goto error;
}
if (setup_fields(thd, Ref_ptr_array(),
- *values, COLUMNS_READ, 0, NULL, 0))
+ *values, COLUMNS_READ, 0, NULL, 0, 0))
goto error;
thd->get_stmt_da()->inc_current_row_for_warning();
}
@@ -1481,7 +1481,7 @@ static int mysql_test_update(Prepared_statement *stmt,
#endif
thd->lex->first_select_lex()->no_wrap_view_item= TRUE;
res= setup_fields(thd, Ref_ptr_array(),
- select->item_list, MARK_COLUMNS_READ, 0, NULL, 0);
+ select->item_list, MARK_COLUMNS_READ, 0, NULL, 0, 0);
thd->lex->first_select_lex()->no_wrap_view_item= FALSE;
if (res)
goto error;
@@ -1493,7 +1493,7 @@ static int mysql_test_update(Prepared_statement *stmt,
table_list->register_want_access(SELECT_ACL);
#endif
if (setup_fields(thd, Ref_ptr_array(),
- stmt->lex->value_list, COLUMNS_READ, 0, NULL, 0) ||
+ stmt->lex->value_list, COLUMNS_READ, 0, NULL, 0, 0) ||
check_unique_table(thd, table_list))
goto error;
/* TODO: here we should send types of placeholders to the client. */
@@ -1669,7 +1669,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt,
DT_INIT | DT_PREPARE))
DBUG_RETURN(TRUE);
DBUG_RETURN(setup_fields(thd, Ref_ptr_array(),
- *values, COLUMNS_READ, 0, NULL, 0));
+ *values, COLUMNS_READ, 0, NULL, 0, 0));
}