summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-10-13 18:19:58 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-05 15:02:53 +0400
commit4d3818d30d97e6fbdb5130d73716401e883c7371 (patch)
treef2440171d9faa1c804b5df73f542c17e4a7e755b /sql/sp_rcontext.cc
parent6010662cb328c10b1ef92c3ed43b2b3858c49863 (diff)
downloadmariadb-git-4d3818d30d97e6fbdb5130d73716401e883c7371.tar.gz
MDEV-11037 Diagnostics_area refactoring for user defined exceptions
Part 2: Moving the part of Sql_condition that contain condition items (such as m_class_origin, m_cursor_name, etc) into a separate class Sql_condition_items. This allows to remove duplicate code in different Sql_condition constructors. Also, introducing new Sql_condition constructors and removing the method Sql_condition::set(). All code sequences that called an Sql_condition constructor followed by Sql_condition::set() are now replaced to the new constructor calls. This gives light performance improvement, as the relevant members are now initialized only one time.
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r--sql/sp_rcontext.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 338fe51d251..242e1b122d5 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -242,10 +242,9 @@ bool sp_rcontext::handle_sql_condition(THD *thd,
*/
if (!found_condition)
{
- Sql_condition *condition=
- new (callers_arena->mem_root) Sql_condition(callers_arena->mem_root);
- condition->set(da, Sql_condition::WARN_LEVEL_ERROR, da->message());
- found_condition= condition;
+ found_condition=
+ new (callers_arena->mem_root) Sql_condition(callers_arena->mem_root,
+ da, da->message());
}
}
else if (da->current_statement_warn_count())