~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/diagnostics_area.h

  • Committer: Mark Atwood
  • Date: 2011-10-27 05:08:12 UTC
  • mfrom: (2445.1.11 rf)
  • Revision ID: me@mark.atwood.name-20111027050812-1icvs72lb0u4xdc4
mergeĀ lp:~olafvdspek/drizzle/refactor8

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_DIAGNOSTICS_AREA_H
21
 
#define DRIZZLED_DIAGNOSTICS_AREA_H
22
 
 
23
 
namespace drizzled
24
 
{
 
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
 
 
27
namespace drizzled {
25
28
 
26
29
/**
27
30
  Stores status of the currently executed statement.
54
57
                     ha_rows found_rows_arg, uint64_t last_insert_id_arg,
55
58
                     const char *message);
56
59
  void set_eof_status(Session *session);
57
 
  void set_error_status(uint32_t sql_errno_arg, const char *message_arg);
 
60
  void set_error_status(drizzled::error_t sql_errno_arg, const char *message_arg);
58
61
 
59
62
  void disable_status();
60
63
 
68
71
  enum_diagnostics_status status() const { return m_status; }
69
72
 
70
73
  const char *message() const;
71
 
  uint32_t sql_errno() const;
 
74
  drizzled::error_t sql_errno() const;
72
75
  uint32_t server_status() const;
73
76
  ha_rows affected_rows() const;
74
77
  ha_rows found_rows() const;
75
78
  uint64_t last_insert_id() const;
76
79
  uint32_t total_warn_count() const;
77
80
 
 
81
  std::list<DRIZZLE_ERROR*> m_warn_list;
 
82
 
78
83
  Diagnostics_area() { reset_diagnostics_area(); }
79
84
 
80
85
private:
84
89
    SQL error number. One of ER_ codes from share/errmsg.txt.
85
90
    Set by set_error_status.
86
91
  */
87
 
  uint32_t m_sql_errno;
 
92
  drizzled::error_t m_sql_errno;
88
93
 
89
94
  /**
90
95
    Copied from session->server_status when the diagnostics area is assigned.
95
100
    Assigned by OK, EOF or ERROR.
96
101
  */
97
102
  uint32_t m_server_status;
 
103
 
98
104
  /**
99
105
    The number of rows affected by the last statement. This is
100
106
    semantically close to session->row_count_func, but has a different
123
129
  enum_diagnostics_status m_status;
124
130
  /**
125
131
    @todo: the following Session members belong here:
126
 
    - warn_list, warn_count,
 
132
    - warn_count,
127
133
  */
128
134
};
129
135
 
130
136
} /* namespace drizzled */
131
137
 
132
 
#endif /* DRIZZLED_DIAGNOSTICS_AREA_H */