My Project
|
00001 /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; version 2 of the License. 00006 00007 This program is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 GNU General Public License for more details. 00011 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software Foundation, 00014 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 00015 00016 #ifndef SQL_SIGNAL_H 00017 #define SQL_SIGNAL_H 00018 00023 class Sql_cmd_common_signal : public Sql_cmd 00024 { 00025 protected: 00031 Sql_cmd_common_signal(const sp_condition_value *cond, 00032 const Set_signal_information& set) 00033 : Sql_cmd(), 00034 m_cond(cond), 00035 m_set_signal_information(set) 00036 {} 00037 00038 virtual ~Sql_cmd_common_signal() 00039 {} 00040 00049 static void assign_defaults(Sql_condition *cond, 00050 bool set_level_code, 00051 Sql_condition::enum_warning_level level, 00052 int sqlcode); 00053 00060 void eval_defaults(THD *thd, Sql_condition *cond); 00061 00068 int eval_signal_informations(THD *thd, Sql_condition *cond); 00069 00076 bool raise_condition(THD *thd, Sql_condition *cond); 00077 00082 const sp_condition_value *m_cond; 00083 00088 Set_signal_information m_set_signal_information; 00089 }; 00090 00094 class Sql_cmd_signal : public Sql_cmd_common_signal 00095 { 00096 public: 00102 Sql_cmd_signal(const sp_condition_value *cond, 00103 const Set_signal_information& set) 00104 : Sql_cmd_common_signal(cond, set) 00105 {} 00106 00107 virtual ~Sql_cmd_signal() 00108 {} 00109 00110 virtual enum_sql_command sql_command_code() const 00111 { 00112 return SQLCOM_SIGNAL; 00113 } 00114 00115 virtual bool execute(THD *thd); 00116 }; 00117 00121 class Sql_cmd_resignal : public Sql_cmd_common_signal 00122 { 00123 public: 00129 Sql_cmd_resignal(const sp_condition_value *cond, 00130 const Set_signal_information& set) 00131 : Sql_cmd_common_signal(cond, set) 00132 {} 00133 00134 virtual ~Sql_cmd_resignal() 00135 {} 00136 00137 virtual enum_sql_command sql_command_code() const 00138 { 00139 return SQLCOM_RESIGNAL; 00140 } 00141 00142 virtual bool execute(THD *thd); 00143 }; 00144 00145 #endif 00146