The world's most popular open source database
00001 /* Copyright (C) 2000-2003 MySQL AB 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; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 class MYSQL_ERROR: public Sql_alloc 00018 { 00019 public: 00020 enum enum_warning_level 00021 { WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END}; 00022 00023 uint code; 00024 enum_warning_level level; 00025 char *msg; 00026 00027 MYSQL_ERROR(THD *thd, uint code_arg, enum_warning_level level_arg, 00028 const char *msg_arg) 00029 :code(code_arg), level(level_arg) 00030 { 00031 if (msg_arg) 00032 set_msg(thd, msg_arg); 00033 } 00034 void set_msg(THD *thd, const char *msg_arg); 00035 }; 00036 00037 MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, 00038 uint code, const char *msg); 00039 void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level, 00040 uint code, const char *format, ...); 00041 void mysql_reset_errors(THD *thd, bool force); 00042 bool mysqld_show_warnings(THD *thd, ulong levels_to_show); 00043 00044 extern const LEX_STRING warning_level_names[];
1.4.7

