diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-09-20 15:30:15 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-05 15:02:50 +0400 |
commit | ccb91eb3ce7bf9b5223931699b8de36154c330ad (patch) | |
tree | 3d4e84a01f5e97179ef2a5213c561ba233b60418 /sql/sp_pcontext.h | |
parent | c2c45c55cef121bbb0dcb841723fecf0e0676c36 (diff) | |
download | mariadb-git-ccb91eb3ce7bf9b5223931699b8de36154c330ad.tar.gz |
MDEV-10839 sql_mode=ORACLE: Predefined exceptions: TOO_MANY_ROWS, NO_DATA_FOUND, DUP_VAL_ON_INDEX
Diffstat (limited to 'sql/sp_pcontext.h')
-rw-r--r-- | sql/sp_pcontext.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h index 877e43e96c0..808143d832c 100644 --- a/sql/sp_pcontext.h +++ b/sql/sp_pcontext.h @@ -198,6 +198,19 @@ public: name(_name), value(_value) { } + sp_condition(const char *name_arg, size_t name_length_arg, + sp_condition_value *value_arg) + :value(value_arg) + { + name.str= (char *) name_arg; + name.length= name_length_arg; + } + bool eq_name(const LEX_STRING str) const + { + return my_strnncoll(system_charset_info, + (const uchar *) name.str, name.length, + (const uchar *) str.str, str.length) == 0; + } }; /////////////////////////////////////////////////////////////////////////// @@ -454,6 +467,16 @@ public: /// See comment for find_variable() above. sp_condition_value *find_condition(const LEX_STRING name, bool current_scope_only) const; + + sp_condition_value * + find_declared_or_predefined_condition(const LEX_STRING name) const + { + sp_condition_value *p= find_condition(name, false); + if (p) + return p; + return find_predefined_condition(name); + } + bool declare_condition(THD *thd, const LEX_STRING name, sp_condition_value *val) { @@ -540,6 +563,8 @@ private: sp_pcontext(const sp_pcontext &); void operator=(sp_pcontext &); + sp_condition_value *find_predefined_condition(const LEX_STRING name) const; + private: /// m_max_var_index -- number of variables (including all types of arguments) /// in this context including all children contexts. |