1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-26606: ROW_NUMBER property value isn't passed from inside a stored

procedure

Analysis: m_current_row_for_warning is reset to 1 during cleanup phase of
stored procedure. When we perform a copy because some statement of procedure
created warning, this reset value is passed to push_warning().
Hence the output is always 1.
Fix: Add a parameter in relevant functions to pass correct value of
row_number and don't use m_current_row_for_warning directly.
This commit is contained in:
Rucha Deodhar
2021-09-26 01:30:36 +05:30
parent 25921c997e
commit 479e303ef3
6 changed files with 140 additions and 10 deletions

View File

@ -663,7 +663,8 @@ void Warning_info::reserve_space(THD *thd, uint count)
Sql_condition *Warning_info::push_warning(THD *thd,
const Sql_condition_identity *value,
const char *msg)
const char *msg,
ulong current_row_number)
{
Sql_condition *cond= NULL;
@ -673,7 +674,7 @@ Sql_condition *Warning_info::push_warning(THD *thd,
m_warn_list.elements() < thd->variables.max_error_count)
{
cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg,
m_current_row_for_warning);
current_row_number);
if (cond)
m_warn_list.push_back(cond);
}
@ -689,7 +690,8 @@ Sql_condition *Warning_info::push_warning(THD *thd,
const Sql_condition *sql_condition)
{
Sql_condition *new_condition= push_warning(thd, sql_condition,
sql_condition->get_message_text());
sql_condition->get_message_text(),
sql_condition->m_row_number);
if (new_condition)
new_condition->copy_opt_attributes(sql_condition);