~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/diagnostics_area.h

  • Committer: Jay Pipes
  • Date: 2009-09-15 21:01:42 UTC
  • mto: (1126.2.5 merge)
  • mto: This revision was merged to the branch mainline in revision 1128.
  • Revision ID: jpipes@serialcoder-20090915210142-x8mwiqn1q0vzjspp
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
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
 
 
27
 
namespace drizzled {
 
20
#ifndef DRIZZLED_DIAGNOSTICS_AREA_H
 
21
#define DRIZZLED_DIAGNOSTICS_AREA_H
28
22
 
29
23
/**
30
24
  Stores status of the currently executed statement.
57
51
                     ha_rows found_rows_arg, uint64_t last_insert_id_arg,
58
52
                     const char *message);
59
53
  void set_eof_status(Session *session);
60
 
  void set_error_status(drizzled::error_t sql_errno_arg, const char *message_arg);
 
54
  void set_error_status(uint32_t sql_errno_arg, const char *message_arg);
61
55
 
62
56
  void disable_status();
63
57
 
71
65
  enum_diagnostics_status status() const { return m_status; }
72
66
 
73
67
  const char *message() const;
74
 
  drizzled::error_t sql_errno() const;
 
68
  uint32_t sql_errno() const;
75
69
  uint32_t server_status() const;
76
70
  ha_rows affected_rows() const;
77
71
  ha_rows found_rows() const;
78
72
  uint64_t last_insert_id() const;
79
73
  uint32_t total_warn_count() const;
80
74
 
81
 
  std::list<DRIZZLE_ERROR*> m_warn_list;
82
 
 
83
75
  Diagnostics_area() { reset_diagnostics_area(); }
84
76
 
85
77
private:
89
81
    SQL error number. One of ER_ codes from share/errmsg.txt.
90
82
    Set by set_error_status.
91
83
  */
92
 
  drizzled::error_t m_sql_errno;
 
84
  uint32_t m_sql_errno;
93
85
 
94
86
  /**
95
87
    Copied from session->server_status when the diagnostics area is assigned.
100
92
    Assigned by OK, EOF or ERROR.
101
93
  */
102
94
  uint32_t m_server_status;
103
 
 
104
95
  /**
105
96
    The number of rows affected by the last statement. This is
106
97
    semantically close to session->row_count_func, but has a different
129
120
  enum_diagnostics_status m_status;
130
121
  /**
131
122
    @todo: the following Session members belong here:
132
 
    - warn_count,
 
123
    - warn_list, warn_count,
133
124
  */
134
125
};
135
126
 
136
 
} /* namespace drizzled */
137
 
 
 
127
#endif /* DRIZZLED_DIAGNOSTICS_AREA_H */