MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_events_statements.h
Go to the documentation of this file.
1 /* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15 
16 #ifndef TABLE_EVENTS_STATEMENTS_H
17 #define TABLE_EVENTS_STATEMENTS_H
18 
24 #include "pfs_column_types.h"
25 #include "pfs_engine_table.h"
26 #include "pfs_events_statements.h"
27 #include "table_helper.h"
28 
29 struct PFS_thread;
30 
38 {
42  ulonglong m_event_id;
44  ulonglong m_end_event_id;
46  ulonglong m_nesting_event_id;
50  const char *m_name;
54  ulonglong m_timer_start;
56  ulonglong m_timer_end;
58  ulonglong m_timer_wait;
60  ulonglong m_lock_time;
72  char m_current_schema_name[NAME_LEN];
75 
77  char m_message_text[MYSQL_ERRMSG_SIZE+1];
81  char m_sqlstate[SQLSTATE_LENGTH];
87  ulonglong m_rows_affected;
89  ulonglong m_rows_sent;
91  ulonglong m_rows_examined;
97  ulonglong m_select_full_join;
101  ulonglong m_select_range;
105  ulonglong m_select_scan;
109  ulonglong m_sort_range;
111  ulonglong m_sort_rows;
113  ulonglong m_sort_scan;
115  ulonglong m_no_index_used;
118 };
119 
122 {
124  : PFS_double_index(0, 0)
125  {}
126 
127  inline void reset(void)
128  {
129  m_index_1= 0;
130  m_index_2= 0;
131  }
132 
133  inline void next_thread(void)
134  {
135  m_index_1++;
136  m_index_2= 0;
137  }
138 };
139 
142 {
144  : PFS_double_index(0, 0)
145  {}
146 
147  inline void reset(void)
148  {
149  m_index_1= 0;
150  m_index_2= 0;
151  }
152 
153  inline void next_thread(void)
154  {
155  m_index_1++;
156  m_index_2= 0;
157  }
158 };
159 
165 {
166 protected:
167  virtual int read_row_values(TABLE *table,
168  unsigned char *buf,
169  Field **fields,
170  bool read_all);
171 
173 
175  {}
176 
178 
183 };
184 
187 {
188 public:
191  static PFS_engine_table* create();
192  static int delete_all_rows();
193 
194  virtual int rnd_init(bool scan);
195  virtual int rnd_next();
196  virtual int rnd_pos(const void *pos);
197  virtual void reset_position(void);
198 
199 protected:
201 
202 public:
204  {}
205 
206 private:
207  friend class table_events_statements_history;
209 
211  static THR_LOCK m_table_lock;
217  static TABLE_FIELD_DEF m_field_def;
218 
223 };
224 
227 {
228 public:
231  static PFS_engine_table* create();
232  static int delete_all_rows();
233 
234  virtual int rnd_init(bool scan);
235  virtual int rnd_next();
236  virtual int rnd_pos(const void *pos);
237  virtual void reset_position(void);
238 
239 protected:
241 
242 public:
244  {}
245 
246 private:
248  static THR_LOCK m_table_lock;
249 
254 };
255 
258 {
259 public:
262  static PFS_engine_table* create();
263  static int delete_all_rows();
264 
265  virtual int rnd_init(bool scan);
266  virtual int rnd_next();
267  virtual int rnd_pos(const void *pos);
268  virtual void reset_position(void);
269 
270 protected:
272 
273 public:
275  {}
276 
277 private:
279  static THR_LOCK m_table_lock;
280 
282  PFS_simple_index m_pos;
284  PFS_simple_index m_next_pos;
285 };
286 
288 #endif