MySQL 5.6.14 Source Code Document
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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
37
struct
row_events_statements
38
{
40
ulonglong
m_thread_internal_id
;
42
ulonglong
m_event_id
;
44
ulonglong
m_end_event_id
;
46
ulonglong
m_nesting_event_id
;
48
enum_event_type
m_nesting_event_type
;
50
const
char
*
m_name
;
52
uint
m_name_length
;
54
ulonglong
m_timer_start
;
56
ulonglong
m_timer_end
;
58
ulonglong
m_timer_wait
;
60
ulonglong
m_lock_time
;
62
char
m_source
[
COL_SOURCE_SIZE
];
64
uint
m_source_length
;
66
char
m_sqltext
[
COL_INFO_SIZE
];
68
PFS_digest_row
m_digest
;
70
uint
m_sqltext_length
;
72
char
m_current_schema_name
[NAME_LEN];
74
uint
m_current_schema_name_length
;
75
77
char
m_message_text
[MYSQL_ERRMSG_SIZE+1];
79
uint
m_sql_errno
;
81
char
m_sqlstate
[SQLSTATE_LENGTH];
83
uint
m_error_count
;
85
uint
m_warning_count
;
87
ulonglong
m_rows_affected
;
89
ulonglong
m_rows_sent
;
91
ulonglong
m_rows_examined
;
93
ulonglong
m_created_tmp_disk_tables
;
95
ulonglong
m_created_tmp_tables
;
97
ulonglong
m_select_full_join
;
99
ulonglong
m_select_full_range_join
;
101
ulonglong
m_select_range
;
103
ulonglong
m_select_range_check
;
105
ulonglong
m_select_scan
;
107
ulonglong
m_sort_merge_passes
;
109
ulonglong
m_sort_range
;
111
ulonglong
m_sort_rows
;
113
ulonglong
m_sort_scan
;
115
ulonglong
m_no_index_used
;
117
ulonglong
m_no_good_index_used
;
118
};
119
121
struct
pos_events_statements_current
:
public
PFS_double_index
122
{
123
pos_events_statements_current
()
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
141
struct
pos_events_statements_history
:
public
PFS_double_index
142
{
143
pos_events_statements_history
()
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
164
class
table_events_statements_common
:
public
PFS_engine_table
165
{
166
protected
:
167
virtual
int
read_row_values
(
TABLE
*
table
,
168
unsigned
char
*
buf
,
169
Field
**fields,
170
bool
read_all);
171
172
table_events_statements_common
(
const
PFS_engine_table_share
*share,
void
*pos);
173
174
~
table_events_statements_common
()
175
{}
176
177
void
make_row
(
PFS_events_statements
*
statement
);
178
180
row_events_statements
m_row
;
182
bool
m_row_exists
;
183
};
184
186
class
table_events_statements_current
:
public
table_events_statements_common
187
{
188
public
:
190
static
PFS_engine_table_share
m_share
;
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
:
200
table_events_statements_current
();
201
202
public
:
203
~
table_events_statements_current
()
204
{}
205
206
private
:
207
friend
class
table_events_statements_history
;
208
friend
class
table_events_statements_history_long
;
209
211
static
THR_LOCK
m_table_lock;
217
static
TABLE_FIELD_DEF
m_field_def;
218
220
pos_events_statements_current
m_pos;
222
pos_events_statements_current
m_next_pos;
223
};
224
226
class
table_events_statements_history
:
public
table_events_statements_common
227
{
228
public
:
230
static
PFS_engine_table_share
m_share
;
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
:
240
table_events_statements_history
();
241
242
public
:
243
~
table_events_statements_history
()
244
{}
245
246
private
:
248
static
THR_LOCK
m_table_lock;
249
251
pos_events_statements_history
m_pos;
253
pos_events_statements_history
m_next_pos;
254
};
255
257
class
table_events_statements_history_long
:
public
table_events_statements_common
258
{
259
public
:
261
static
PFS_engine_table_share
m_share
;
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
:
271
table_events_statements_history_long
();
272
273
public
:
274
~
table_events_statements_history_long
()
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
storage
perfschema
table_events_statements.h
Generated on Sat Nov 9 2013 01:28:40 for MySQL 5.6.14 Source Code Document by
1.8.1.2