diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-10-14 16:52:33 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-05 15:02:53 +0400 |
commit | 4ed804aa4dc6a03d5a983a0aaf71b39e4702e8f3 (patch) | |
tree | be2115e6c59097079db4c75be877dd7f5a4674d1 /sql/sql_error.cc | |
parent | 4d3818d30d97e6fbdb5130d73716401e883c7371 (diff) | |
download | mariadb-git-4ed804aa4dc6a03d5a983a0aaf71b39e4702e8f3.tar.gz |
MDEV-10587 sql_mode=ORACLE: User defined exceptions
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 2e9b1dabea4..745471a1365 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -307,7 +307,8 @@ Diagnostics_area::reset_diagnostics_area() m_can_overwrite_status= FALSE; /** Don't take chances in production */ m_message[0]= '\0'; - m_sql_errno= 0; + Sql_state_errno::clear(); + Sql_user_condition_identity::clear(); m_affected_rows= 0; m_last_insert_id= 0; m_statement_warn_count= 0; @@ -406,6 +407,7 @@ Diagnostics_area::set_error_status(uint sql_errno) set_error_status(sql_errno, ER(sql_errno), mysql_errno_to_sqlstate(sql_errno), + Sql_user_condition_identity(), NULL); } @@ -419,6 +421,7 @@ Diagnostics_area::set_error_status(uint sql_errno) @param sql_errno SQL-condition error number @param message SQL-condition message @param sqlstate SQL-condition state + @param ucid User defined condition identity @param error_condition SQL-condition object representing the error state @note Note, that error_condition may be NULL. It happens if a) OOM error is @@ -429,6 +432,7 @@ void Diagnostics_area::set_error_status(uint sql_errno, const char *message, const char *sqlstate, + const Sql_user_condition_identity &ucid, const Sql_condition *error_condition) { DBUG_ENTER("set_error_status"); @@ -455,7 +459,8 @@ Diagnostics_area::set_error_status(uint sql_errno, return; #endif - set_condition_value(sql_errno, sqlstate); + Sql_state_errno::set(sql_errno, sqlstate); + Sql_user_condition_identity::set(ucid); strmake_buf(m_message, message); get_warning_info()->set_error_condition(error_condition); @@ -647,7 +652,7 @@ void Warning_info::reserve_space(THD *thd, uint count) } Sql_condition *Warning_info::push_warning(THD *thd, - const Sql_state_errno_level *value, + const Sql_condition_identity *value, const char *msg) { Sql_condition *cond= NULL; @@ -657,7 +662,7 @@ Sql_condition *Warning_info::push_warning(THD *thd, if (m_allow_unlimited_warnings || m_warn_list.elements() < thd->variables.max_error_count) { - cond= new (& m_warn_root) Sql_condition(& m_warn_root, value, msg); + cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg); if (cond) m_warn_list.push_back(cond); } |