MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_events_stages.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_STAGES_H
17 #define TABLE_EVENTS_STAGES_H
18 
24 #include "pfs_column_types.h"
25 #include "pfs_engine_table.h"
26 #include "pfs_events_stages.h"
27 
28 struct PFS_thread;
29 
37 {
41  ulonglong m_event_id;
43  ulonglong m_end_event_id;
45  ulonglong m_nesting_event_id;
49  const char *m_name;
53  ulonglong m_timer_start;
55  ulonglong m_timer_end;
57  ulonglong m_timer_wait;
62 };
63 
66 {
68  : PFS_double_index(0, 0)
69  {}
70 
71  inline void reset(void)
72  {
73  m_index_1= 0;
74  m_index_2= 0;
75  }
76 
77  inline void next_thread(void)
78  {
79  m_index_1++;
80  m_index_2= 0;
81  }
82 };
83 
89 {
90 protected:
91  virtual int read_row_values(TABLE *table,
92  unsigned char *buf,
93  Field **fields,
94  bool read_all);
95 
96  table_events_stages_common(const PFS_engine_table_share *share, void *pos);
97 
99  {}
100 
101  void make_row(PFS_events_stages *stage);
102 
107 };
108 
111 {
112 public:
115  static PFS_engine_table* create();
116  static int delete_all_rows();
117 
118  virtual int rnd_init(bool scan);
119  virtual int rnd_next();
120  virtual int rnd_pos(const void *pos);
121  virtual void reset_position(void);
122 
123 protected:
125 
126 public:
128  {}
129 
130 private:
131  friend class table_events_stages_history;
133 
135  static THR_LOCK m_table_lock;
141  static TABLE_FIELD_DEF m_field_def;
142 
144  PFS_simple_index m_pos;
146  PFS_simple_index m_next_pos;
147 };
148 
151 {
152 public:
155  static PFS_engine_table* create();
156  static int delete_all_rows();
157 
158  virtual int rnd_init(bool scan);
159  virtual int rnd_next();
160  virtual int rnd_pos(const void *pos);
161  virtual void reset_position(void);
162 
163 protected:
165 
166 public:
168  {}
169 
170 private:
172  static THR_LOCK m_table_lock;
173 
177  pos_events_stages_history m_next_pos;
178 };
179 
182 {
183 public:
186  static PFS_engine_table* create();
187  static int delete_all_rows();
188 
189  virtual int rnd_init(bool scan);
190  virtual int rnd_next();
191  virtual int rnd_pos(const void *pos);
192  virtual void reset_position(void);
193 
194 protected:
196 
197 public:
199  {}
200 
201 private:
203  static THR_LOCK m_table_lock;
204 
206  PFS_simple_index m_pos;
208  PFS_simple_index m_next_pos;
209 };
210 
212 #endif