Commit 9bbd3282 authored by Sergei Golubchik's avatar Sergei Golubchik

fix RESIGNAL to save and pass the m_row_count too

parent b73b7365
...@@ -1598,7 +1598,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ...@@ -1598,7 +1598,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT; GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT;
SELECT @num, @msg; SELECT @num, @msg;
@num @msg @num @msg
1 Duplicate entry '1' for key 'PRIMARY' 2 Duplicate entry '1' for key 'PRIMARY'
DROP PROCEDURE sp; DROP PROCEDURE sp;
DROP TABLE t1; DROP TABLE t1;
# Checking more errors # Checking more errors
......
...@@ -111,15 +111,18 @@ class sp_rcontext : public Sql_alloc ...@@ -111,15 +111,18 @@ class sp_rcontext : public Sql_alloc
/// Text message. /// Text message.
char *message; char *message;
/** Row number where the condition has happened */
ulong m_row_number;
/// The constructor. /// The constructor.
/// ///
/// @param _sql_condition The SQL condition. /// @param _sql_condition The SQL condition.
/// @param arena Query arena for SP /// @param arena Query arena for SP
Sql_condition_info(const Sql_condition *_sql_condition, Sql_condition_info(const Sql_condition *_sql_condition, Query_arena *arena)
Query_arena *arena)
:Sql_condition_identity(*_sql_condition) :Sql_condition_identity(*_sql_condition)
{ {
message= strdup_root(arena->mem_root, _sql_condition->get_message_text()); message= strdup_root(arena->mem_root, _sql_condition->get_message_text());
m_row_number= _sql_condition->m_row_number;
} }
}; };
......
...@@ -441,7 +441,7 @@ bool Sql_cmd_resignal::execute(THD *thd) ...@@ -441,7 +441,7 @@ bool Sql_cmd_resignal::execute(THD *thd)
} }
Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message, Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message,
da->current_row_for_warning()); signaled->m_row_number);
if (m_cond) if (m_cond)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment