diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-10-08 18:44:04 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-10-26 17:29:40 +0200 |
commit | 9bbd328254f1a1e13e9e550900edad5775e0a7bd (patch) | |
tree | 7b2282b926e8a4d12b7beb25c7a97b1fed65cf04 | |
parent | b73b736506109ecf09761e5c2b2693810a0b9ea6 (diff) | |
download | mariadb-git-9bbd328254f1a1e13e9e550900edad5775e0a7bd.tar.gz |
fix RESIGNAL to save and pass the m_row_count too
-rw-r--r-- | mysql-test/main/get_diagnostics.result | 2 | ||||
-rw-r--r-- | sql/sp_rcontext.h | 7 | ||||
-rw-r--r-- | sql/sql_signal.cc | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result index 94ae31d5ee6..090642923ce 100644 --- a/mysql-test/main/get_diagnostics.result +++ b/mysql-test/main/get_diagnostics.result @@ -1598,7 +1598,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT; SELECT @num, @msg; @num @msg -1 Duplicate entry '1' for key 'PRIMARY' +2 Duplicate entry '1' for key 'PRIMARY' DROP PROCEDURE sp; DROP TABLE t1; # Checking more errors diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index 0e0e8921f86..ea669b2d1d8 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -111,15 +111,18 @@ public: /// Text message. char *message; + /** Row number where the condition has happened */ + ulong m_row_number; + /// The constructor. /// /// @param _sql_condition The SQL condition. /// @param arena Query arena for SP - Sql_condition_info(const Sql_condition *_sql_condition, - Query_arena *arena) + Sql_condition_info(const Sql_condition *_sql_condition, Query_arena *arena) :Sql_condition_identity(*_sql_condition) { message= strdup_root(arena->mem_root, _sql_condition->get_message_text()); + m_row_number= _sql_condition->m_row_number; } }; diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc index 6ccc16c53e5..4e86cc4d782 100644 --- a/sql/sql_signal.cc +++ b/sql/sql_signal.cc @@ -441,7 +441,7 @@ bool Sql_cmd_resignal::execute(THD *thd) } Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message, - da->current_row_for_warning()); + signaled->m_row_number); if (m_cond) { |