17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_SQL_ERROR_H
21
#define DRIZZLED_SQL_ERROR_H
23
#include "drizzled/memory/sql_alloc.h"
24
#include "drizzled/lex_string.h"
31
class DRIZZLE_ERROR: public memory::SqlAlloc
20
class DRIZZLE_ERROR: public Sql_alloc
34
static const uint32_t NUM_ERRORS= 4;
35
23
enum enum_warning_level
36
24
{ WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END};
39
27
enum_warning_level level;
42
DRIZZLE_ERROR(Session *session, uint32_t code_arg, enum_warning_level level_arg,
30
DRIZZLE_ERROR(THD *thd, uint32_t code_arg, enum_warning_level level_arg,
43
31
const char *msg_arg)
44
32
:code(code_arg), level(level_arg)
47
set_msg(session, msg_arg);
35
set_msg(thd, msg_arg);
49
void set_msg(Session *session, const char *msg_arg);
37
void set_msg(THD *thd, const char *msg_arg);
52
DRIZZLE_ERROR *push_warning(Session *session, DRIZZLE_ERROR::enum_warning_level level,
40
DRIZZLE_ERROR *push_warning(THD *thd, DRIZZLE_ERROR::enum_warning_level level,
53
41
uint32_t code, const char *msg);
54
void push_warning_printf(Session *session, DRIZZLE_ERROR::enum_warning_level level,
42
void push_warning_printf(THD *thd, DRIZZLE_ERROR::enum_warning_level level,
55
43
uint32_t code, const char *format, ...);
56
void drizzle_reset_errors(Session *session, bool force);
57
bool mysqld_show_warnings(Session *session,
58
std::bitset<DRIZZLE_ERROR::NUM_ERRORS> &levels_to_show);
44
void drizzle_reset_errors(THD *thd, bool force);
45
bool mysqld_show_warnings(THD *thd, uint32_t levels_to_show);
60
47
extern const LEX_STRING warning_level_names[];
62
} /* namespace drizzled */
64
#endif /* DRIZZLED_SQL_ERROR_H */