1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-10587 sql_mode=ORACLE: User defined exceptions

This commit is contained in:
Alexander Barkov
2016-10-14 16:52:33 +04:00
parent 4d3818d30d
commit 4ed804aa4d
12 changed files with 655 additions and 113 deletions

View File

@ -3939,8 +3939,42 @@ private:
raise_condition(uint sql_errno,
const char* sqlstate,
Sql_condition::enum_warning_level level,
const char* msg)
{
return raise_condition(sql_errno, sqlstate, level,
Sql_user_condition_identity(), msg);
}
/**
Raise a generic or a user defined SQL condition.
@param ucid - the user condition identity
(or an empty identity if not a user condition)
@param sql_errno - the condition error number
@param sqlstate - the condition SQLSTATE
@param level - the condition level
@param msg - the condition message text
@return The condition raised, or NULL
*/
Sql_condition*
raise_condition(uint sql_errno,
const char* sqlstate,
Sql_condition::enum_warning_level level,
const Sql_user_condition_identity &ucid,
const char* msg);
Sql_condition*
raise_condition(const Sql_condition *cond)
{
Sql_condition *raised= raise_condition(cond->get_sql_errno(),
cond->get_sqlstate(),
cond->get_level(),
*cond/*Sql_user_condition_identity*/,
cond->get_message_text());
if (raised)
raised->copy_opt_attributes(cond);
return raised;
}
public:
/** Overloaded to guard query/query_length fields */
virtual void set_statement(Statement *stmt);