summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-10-12 18:16:38 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-05 15:02:53 +0400
commit6010662cb328c10b1ef92c3ed43b2b3858c49863 (patch)
treec0927233efb1168b4018f2a59d099caafc4343de /sql/sp_rcontext.h
parentffca1e48301a30ae9c3e9c338293e31914182ed2 (diff)
downloadmariadb-git-6010662cb328c10b1ef92c3ed43b2b3858c49863.tar.gz
MDEV-11037 Diagnostics_area refactoring for user defined exceptions
Diffstat (limited to 'sql/sp_rcontext.h')
-rw-r--r--sql/sp_rcontext.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index b6b0d4de0c3..d2e1f5fec58 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -120,18 +120,9 @@ public:
/// standard SQL-condition processing (Diagnostics_area should contain an
/// object for active SQL-condition, not just information stored in DA's
/// fields).
- class Sql_condition_info : public Sql_alloc
+ class Sql_condition_info : public Sql_alloc, public Sql_state_errno_level
{
public:
- /// SQL error code.
- uint sql_errno;
-
- /// Error level.
- Sql_condition::enum_warning_level level;
-
- /// SQLSTATE.
- char sql_state[SQLSTATE_LENGTH + 1];
-
/// Text message.
char *message;
@@ -141,12 +132,8 @@ public:
/// @param arena Query arena for SP
Sql_condition_info(const Sql_condition *_sql_condition,
Query_arena *arena)
- :sql_errno(_sql_condition->get_sql_errno()),
- level(_sql_condition->get_level())
+ :Sql_state_errno_level(*_sql_condition)
{
- memcpy(sql_state, _sql_condition->get_sqlstate(), SQLSTATE_LENGTH);
- sql_state[SQLSTATE_LENGTH]= '\0';
-
message= strdup_root(arena->mem_root, _sql_condition->get_message_text());
}
};