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:
@ -748,7 +748,8 @@ private:
|
||||
*/
|
||||
Sql_condition *push_warning(THD *thd,
|
||||
const Sql_condition_identity *identity,
|
||||
const char* msg);
|
||||
const char* msg,
|
||||
ulong current_row_number);
|
||||
|
||||
/**
|
||||
Add a new SQL-condition to the current list and increment the respective
|
||||
@ -1179,10 +1180,12 @@ public:
|
||||
const char* sqlstate,
|
||||
Sql_condition::enum_warning_level level,
|
||||
const Sql_user_condition_identity &ucid,
|
||||
const char* msg)
|
||||
const char* msg,
|
||||
ulong current_row_number)
|
||||
{
|
||||
Sql_condition_identity tmp(sql_errno_arg, sqlstate, level, ucid);
|
||||
return get_warning_info()->push_warning(thd, &tmp, msg);
|
||||
return get_warning_info()->push_warning(thd, &tmp, msg,
|
||||
current_row_number);
|
||||
}
|
||||
|
||||
Sql_condition *push_warning(THD *thd,
|
||||
@ -1192,7 +1195,7 @@ public:
|
||||
const char* msg)
|
||||
{
|
||||
return push_warning(thd, sqlerrno, sqlstate, level,
|
||||
Sql_user_condition_identity(), msg);
|
||||
Sql_user_condition_identity(), msg, 0);
|
||||
}
|
||||
void mark_sql_conditions_for_removal()
|
||||
{ get_warning_info()->mark_sql_conditions_for_removal(); }
|
||||
|
Reference in New Issue
Block a user