~drizzle-trunk/drizzle/development

390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; version 2 of the License.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
1 by brian
clean slate
19
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
20
21
575.1.6 by Monty Taylor
Cleaned up some headers for PCH.
22
#ifndef DRIZZLED_SQL_ERROR_H
23
#define DRIZZLED_SQL_ERROR_H
24
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
25
#include <drizzled/memory/sql_alloc.h>
26
#include <drizzled/lex_string.h>
584.1.13 by Monty Taylor
Split out a little more code. Removed table_list.h from common_includes.
27
2087.3.1 by Brian Aker
Entire convert over to time_t.
28
#include <drizzled/error_t.h>
29
1100.3.35 by Padraig O'Sullivan
Updated mysql_show_warnings to take a std::bitset instead of a uint32_t to
30
#include <bitset>
31
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
32
#include <drizzled/visibility.h>
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
33
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
34
namespace drizzled
35
{
36
37
class DRIZZLE_ERROR: public memory::SqlAlloc
1 by brian
clean slate
38
{
39
public:
1100.3.35 by Padraig O'Sullivan
Updated mysql_show_warnings to take a std::bitset instead of a uint32_t to
40
  static const uint32_t NUM_ERRORS= 4;
2087.3.1 by Brian Aker
Entire convert over to time_t.
41
  enum enum_warning_level {
42
    WARN_LEVEL_NOTE,
43
    WARN_LEVEL_WARN,
44
    WARN_LEVEL_ERROR,
45
    WARN_LEVEL_END
46
  };
1 by brian
clean slate
47
2087.3.1 by Brian Aker
Entire convert over to time_t.
48
  drizzled::error_t code;
1 by brian
clean slate
49
  enum_warning_level level;
50
  char *msg;
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
51
2087.3.1 by Brian Aker
Entire convert over to time_t.
52
  DRIZZLE_ERROR(Session *session,
53
                drizzled::error_t code_arg,
54
                enum_warning_level level_arg,
55
                const char *msg_arg) :
56
    code(code_arg),
57
    level(level_arg)
1 by brian
clean slate
58
  {
59
    if (msg_arg)
520.1.22 by Brian Aker
Second pass of thd cleanup
60
      set_msg(session, msg_arg);
1 by brian
clean slate
61
  }
2087.3.1 by Brian Aker
Entire convert over to time_t.
62
520.1.22 by Brian Aker
Second pass of thd cleanup
63
  void set_msg(Session *session, const char *msg_arg);
1 by brian
clean slate
64
};
65
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
66
DRIZZLED_API DRIZZLE_ERROR *push_warning(Session *session, DRIZZLE_ERROR::enum_warning_level level,
2087.3.1 by Brian Aker
Entire convert over to time_t.
67
                            drizzled::error_t code, const char *msg);
68
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
69
DRIZZLED_API void push_warning_printf(Session *session, DRIZZLE_ERROR::enum_warning_level level,
2087.3.1 by Brian Aker
Entire convert over to time_t.
70
                         drizzled::error_t code, const char *format, ...);
71
520.1.22 by Brian Aker
Second pass of thd cleanup
72
void drizzle_reset_errors(Session *session, bool force);
2026.2.1 by Monty Taylor
Renamed things prefixed mysql_ or mysqld_
73
bool show_warnings(Session *session, 
74
                   std::bitset<DRIZZLE_ERROR::NUM_ERRORS> &levels_to_show);
1 by brian
clean slate
75
76
extern const LEX_STRING warning_level_names[];
575.1.6 by Monty Taylor
Cleaned up some headers for PCH.
77
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
78
} /* namespace drizzled */
79
575.1.6 by Monty Taylor
Cleaned up some headers for PCH.
80
#endif /* DRIZZLED_SQL_ERROR_H */