drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
diagnostics_area.h
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems, Inc.
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 */
19
20#pragma once
21
22#include <drizzled/base.h>
23#include <drizzled/error_t.h>
24#include <drizzled/sql_error.h>
25#include <drizzled/sql_list.h>
26
27namespace drizzled {
28
35class Diagnostics_area
36{
37public:
51
52 bool is_sent;
55
56 void set_ok_status(Session *session, ha_rows affected_rows_arg,
57 ha_rows found_rows_arg, uint64_t last_insert_id_arg,
58 const char *message);
59 void set_eof_status(Session *session);
60 void set_error_status(drizzled::error_t sql_errno_arg, const char *message_arg);
61
62 void disable_status();
63
65
66 bool is_set() const { return m_status != DA_EMPTY; }
67 bool is_error() const { return m_status == DA_ERROR; }
68 bool is_eof() const { return m_status == DA_EOF; }
69 bool is_ok() const { return m_status == DA_OK; }
70 bool is_disabled() const { return m_status == DA_DISABLED; }
71 enum_diagnostics_status status() const { return m_status; }
72
73 const char *message() const;
74 drizzled::error_t sql_errno() const;
75 uint32_t server_status() const;
76 ha_rows affected_rows() const;
77 ha_rows found_rows() const;
78 uint64_t last_insert_id() const;
79 uint32_t total_warn_count() const;
80
81 std::list<DRIZZLE_ERROR*> m_warn_list;
82
83 Diagnostics_area() { reset_diagnostics_area(); }
84
85private:
87 char m_message[DRIZZLE_ERRMSG_SIZE];
92 drizzled::error_t m_sql_errno;
93
103
134};
135
136} /* namespace drizzled */
137
drizzled::error_t m_sql_errno
void set_ok_status(Session *session, ha_rows affected_rows_arg, ha_rows found_rows_arg, uint64_t last_insert_id_arg, const char *message)
char m_message[DRIZZLE_ERRMSG_SIZE]
void set_error_status(drizzled::error_t sql_errno_arg, const char *message_arg)
void set_eof_status(Session *session)
TODO: Rename this file - func.h is stupid.