1 | /* Copyright (c) 2008, 2015, 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 PFS_COLUMN_TYPES_H |
17 | #define PFS_COLUMN_TYPES_H |
18 | |
19 | /** |
20 | @file storage/perfschema/pfs_column_types.h |
21 | Data types for columns used in the performance schema tables (declarations) |
22 | */ |
23 | |
24 | /** Size of the OBJECT_SCHEMA columns. */ |
25 | #define COL_OBJECT_SCHEMA_SIZE 64 |
26 | |
27 | /** |
28 | Size of the extended OBJECT_NAME columns. |
29 | 'Extended' columns are used when the object name also represents |
30 | the name of a non SQL object, such as a file name. |
31 | Size in bytes of: |
32 | - performance_schema.events_waits_current (OBJECT_NAME) |
33 | - performance_schema.events_waits_history (OBJECT_NAME) |
34 | - performance_schema.events_waits_history_long (OBJECT_NAME) |
35 | */ |
36 | #define COL_OBJECT_NAME_EXTENDED_SIZE 512 |
37 | |
38 | /** Size of the OBJECT_NAME columns. */ |
39 | #define COL_OBJECT_NAME_SIZE 64 |
40 | |
41 | /** Size of the INDEX_NAME columns. */ |
42 | #define COL_INDEX_NAME_SIZE 64 |
43 | |
44 | /** |
45 | Size of INFO columns. |
46 | Size in bytes of: |
47 | - performance_schema.events_statement_current (INFO) |
48 | - performance_schema.events_statement_history (INFO) |
49 | - performance_schema.events_statement_history_long (INFO) |
50 | */ |
51 | #define COL_INFO_SIZE 1024 |
52 | |
53 | /** Size of the SOURCE columns. */ |
54 | #define COL_SOURCE_SIZE 64 |
55 | |
56 | /** Size of the DIGEST columns. */ |
57 | #define COL_DIGEST_SIZE 64 |
58 | |
59 | /** Size of the DIGEST_TEXT columns. */ |
60 | #define COL_DIGEST_TEXT_SIZE 1024 |
61 | |
62 | /** |
63 | Enum values for the TIMER_NAME columns. |
64 | This enum is found in the following tables: |
65 | - performance_schema.setup_timer (TIMER_NAME) |
66 | - performance_schema.performance_timer (TIMER_NAME) |
67 | */ |
68 | enum enum_timer_name |
69 | { |
70 | TIMER_NAME_CYCLE= 1, |
71 | TIMER_NAME_NANOSEC= 2, |
72 | TIMER_NAME_MICROSEC= 3, |
73 | TIMER_NAME_MILLISEC= 4, |
74 | TIMER_NAME_TICK= 5 |
75 | }; |
76 | |
77 | /** Integer, first value of @sa enum_timer_name. */ |
78 | #define FIRST_TIMER_NAME (static_cast<int> (TIMER_NAME_CYCLE)) |
79 | /** Integer, last value of @sa enum_timer_name. */ |
80 | #define LAST_TIMER_NAME (static_cast<int> (TIMER_NAME_TICK)) |
81 | /** Integer, number of values of @sa enum_timer_name. */ |
82 | #define COUNT_TIMER_NAME (LAST_TIMER_NAME - FIRST_TIMER_NAME + 1) |
83 | |
84 | /** |
85 | Enum values for the various YES/NO columns. |
86 | This enum is found in the following tables: |
87 | - performance_schema.setup_instruments (ENABLED) |
88 | - performance_schema.setup_instruments (TIMED) |
89 | - performance_schema.setup_consumers (ENABLED) |
90 | */ |
91 | enum enum_yes_no |
92 | { |
93 | ENUM_YES= 1, |
94 | ENUM_NO= 2 |
95 | }; |
96 | |
97 | /** |
98 | Enum values for the various OPERATION columns. |
99 | This enum is found in the following tables: |
100 | - performance_schema.events_waits_current (OPERATION) |
101 | - performance_schema.events_waits_history (OPERATION) |
102 | - performance_schema.events_waits_history_long (OPERATION) |
103 | */ |
104 | enum enum_operation_type |
105 | { |
106 | /* Mutex operations */ |
107 | OPERATION_TYPE_LOCK= 1, |
108 | OPERATION_TYPE_TRYLOCK= 2, |
109 | |
110 | /* Rwlock operations */ |
111 | OPERATION_TYPE_READLOCK= 3, |
112 | OPERATION_TYPE_WRITELOCK= 4, |
113 | OPERATION_TYPE_TRYREADLOCK= 5, |
114 | OPERATION_TYPE_TRYWRITELOCK= 6, |
115 | |
116 | /* Cond operations */ |
117 | OPERATION_TYPE_WAIT= 7, |
118 | OPERATION_TYPE_TIMEDWAIT= 8, |
119 | |
120 | /* File operations */ |
121 | OPERATION_TYPE_FILECREATE= 9, |
122 | OPERATION_TYPE_FILECREATETMP= 10, |
123 | OPERATION_TYPE_FILEOPEN= 11, |
124 | OPERATION_TYPE_FILESTREAMOPEN= 12, |
125 | OPERATION_TYPE_FILECLOSE= 13, |
126 | OPERATION_TYPE_FILESTREAMCLOSE= 14, |
127 | OPERATION_TYPE_FILEREAD= 15, |
128 | OPERATION_TYPE_FILEWRITE= 16, |
129 | OPERATION_TYPE_FILESEEK= 17, |
130 | OPERATION_TYPE_FILETELL= 18, |
131 | OPERATION_TYPE_FILEFLUSH= 19, |
132 | OPERATION_TYPE_FILESTAT= 20, |
133 | OPERATION_TYPE_FILEFSTAT= 21, |
134 | OPERATION_TYPE_FILECHSIZE= 22, |
135 | OPERATION_TYPE_FILEDELETE= 23, |
136 | OPERATION_TYPE_FILERENAME= 24, |
137 | OPERATION_TYPE_FILESYNC= 25, |
138 | |
139 | /* Table io operations */ |
140 | OPERATION_TYPE_TABLE_FETCH= 26, |
141 | OPERATION_TYPE_TABLE_WRITE_ROW= 27, |
142 | OPERATION_TYPE_TABLE_UPDATE_ROW= 28, |
143 | OPERATION_TYPE_TABLE_DELETE_ROW= 29, |
144 | |
145 | /* Table lock operations */ |
146 | OPERATION_TYPE_TL_READ_NORMAL= 30, |
147 | OPERATION_TYPE_TL_READ_WITH_SHARED_LOCKS= 31, |
148 | OPERATION_TYPE_TL_READ_HIGH_PRIORITY= 32, |
149 | OPERATION_TYPE_TL_READ_NO_INSERTS= 33, |
150 | OPERATION_TYPE_TL_WRITE_ALLOW_WRITE= 34, |
151 | OPERATION_TYPE_TL_WRITE_CONCURRENT_INSERT= 35, |
152 | OPERATION_TYPE_TL_WRITE_DELAYED= 36, |
153 | OPERATION_TYPE_TL_WRITE_LOW_PRIORITY= 37, |
154 | OPERATION_TYPE_TL_WRITE_NORMAL= 38, |
155 | OPERATION_TYPE_TL_READ_EXTERNAL= 39, |
156 | OPERATION_TYPE_TL_WRITE_EXTERNAL= 40, |
157 | |
158 | /* Socket operations */ |
159 | OPERATION_TYPE_SOCKETCREATE = 41, |
160 | OPERATION_TYPE_SOCKETCONNECT = 42, |
161 | OPERATION_TYPE_SOCKETBIND = 43, |
162 | OPERATION_TYPE_SOCKETCLOSE = 44, |
163 | OPERATION_TYPE_SOCKETSEND = 45, |
164 | OPERATION_TYPE_SOCKETRECV = 46, |
165 | OPERATION_TYPE_SOCKETSENDTO = 47, |
166 | OPERATION_TYPE_SOCKETRECVFROM = 48, |
167 | OPERATION_TYPE_SOCKETSENDMSG = 49, |
168 | OPERATION_TYPE_SOCKETRECVMSG = 50, |
169 | OPERATION_TYPE_SOCKETSEEK = 51, |
170 | OPERATION_TYPE_SOCKETOPT = 52, |
171 | OPERATION_TYPE_SOCKETSTAT = 53, |
172 | OPERATION_TYPE_SOCKETSHUTDOWN = 54, |
173 | OPERATION_TYPE_SOCKETSELECT = 55, |
174 | |
175 | /* Idle operation */ |
176 | OPERATION_TYPE_IDLE= 56 |
177 | }; |
178 | /** Integer, first value of @sa enum_operation_type. */ |
179 | #define FIRST_OPERATION_TYPE (static_cast<int> (OPERATION_TYPE_LOCK)) |
180 | /** Integer, last value of @sa enum_operation_type. */ |
181 | #define LAST_OPERATION_TYPE (static_cast<int> (OPERATION_TYPE_IDLE)) |
182 | /** Integer, number of values of @sa enum_operation_type. */ |
183 | #define COUNT_OPERATION_TYPE (LAST_OPERATION_TYPE - FIRST_OPERATION_TYPE + 1) |
184 | |
185 | /** |
186 | Enum values for the various OBJECT_TYPE columns. |
187 | */ |
188 | enum enum_object_type |
189 | { |
190 | OBJECT_TYPE_TABLE= 1, |
191 | OBJECT_TYPE_TEMPORARY_TABLE= 2 |
192 | }; |
193 | /** Integer, first value of @sa enum_object_type. */ |
194 | #define FIRST_OBJECT_TYPE (static_cast<int> (OBJECT_TYPE_TABLE)) |
195 | /** Integer, last value of @sa enum_object_type. */ |
196 | #define LAST_OBJECT_TYPE (static_cast<int> (OBJECT_TYPE_TEMPORARY_TABLE)) |
197 | /** Integer, number of values of @sa enum_object_type. */ |
198 | #define COUNT_OBJECT_TYPE (LAST_OBJECT_TYPE - FIRST_OBJECT_TYPE + 1) |
199 | |
200 | /** |
201 | Enum values for the NESTING_EVENT_TYPE columns. |
202 | This enum is found in the following tables: |
203 | - performance_schema.events_waits_current (NESTING_EVENT_TYPE) |
204 | - performance_schema.events_stages_current (NESTING_EVENT_TYPE) |
205 | - performance_schema.events_statements_current (NESTING_EVENT_TYPE) |
206 | */ |
207 | enum enum_event_type |
208 | { |
209 | EVENT_TYPE_STATEMENT= 1, |
210 | EVENT_TYPE_STAGE= 2, |
211 | EVENT_TYPE_WAIT= 3 |
212 | }; |
213 | |
214 | /** Integer, first value of @sa enum_event_type. */ |
215 | #define FIRST_EVENT_TYPE (static_cast<int> (EVENT_TYPE_STATEMENT)) |
216 | /** Integer, last value of @sa enum_event_type. */ |
217 | #define LAST_EVENT_TYPE (static_cast<int> (EVENT_TYPE_WAIT)) |
218 | /** Integer, number of values of @sa enum_event_type. */ |
219 | #define COUNT_EVENT_TYPE (LAST_EVENT_TYPE - FIRST_EVENT_TYPE + 1) |
220 | |
221 | #endif |
222 | |
223 | |