~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_error.h

  • Committer: Brian Aker
  • Date: 2011-01-16 20:38:08 UTC
  • mto: (2088.1.1 merge)
  • mto: This revision was merged to the branch mainline in revision 2089.
  • Revision ID: brian@gir-3-20110116203808-dl1dvpoarmkug1no
Entire convert over to time_t.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "drizzled/memory/sql_alloc.h"
24
24
#include "drizzled/lex_string.h"
25
25
 
 
26
#include <drizzled/error_t.h>
 
27
 
26
28
#include <bitset>
27
29
 
28
30
namespace drizzled
32
34
{
33
35
public:
34
36
  static const uint32_t NUM_ERRORS= 4;
35
 
  enum enum_warning_level
36
 
  { WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END};
 
37
  enum enum_warning_level {
 
38
    WARN_LEVEL_NOTE,
 
39
    WARN_LEVEL_WARN,
 
40
    WARN_LEVEL_ERROR,
 
41
    WARN_LEVEL_END
 
42
  };
37
43
 
38
 
  uint32_t code;
 
44
  drizzled::error_t code;
39
45
  enum_warning_level level;
40
46
  char *msg;
41
47
 
42
 
  DRIZZLE_ERROR(Session *session, uint32_t code_arg, enum_warning_level level_arg,
43
 
              const char *msg_arg)
44
 
    :code(code_arg), level(level_arg)
 
48
  DRIZZLE_ERROR(Session *session,
 
49
                drizzled::error_t code_arg,
 
50
                enum_warning_level level_arg,
 
51
                const char *msg_arg) :
 
52
    code(code_arg),
 
53
    level(level_arg)
45
54
  {
46
55
    if (msg_arg)
47
56
      set_msg(session, msg_arg);
48
57
  }
 
58
 
49
59
  void set_msg(Session *session, const char *msg_arg);
50
60
};
51
61
 
52
62
DRIZZLE_ERROR *push_warning(Session *session, DRIZZLE_ERROR::enum_warning_level level,
53
 
                          uint32_t code, const char *msg);
 
63
                            drizzled::error_t code, const char *msg);
 
64
 
54
65
void push_warning_printf(Session *session, DRIZZLE_ERROR::enum_warning_level level,
55
 
                         uint32_t code, const char *format, ...);
 
66
                         drizzled::error_t code, const char *format, ...);
 
67
 
56
68
void drizzle_reset_errors(Session *session, bool force);
57
69
bool show_warnings(Session *session, 
58
70
                   std::bitset<DRIZZLE_ERROR::NUM_ERRORS> &levels_to_show);