MySQL 8.0.29
Source Code Documentation
pfs_column_types.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
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, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef PFS_COLUMN_TYPES_H
24#define PFS_COLUMN_TYPES_H
25
26#include <stddef.h>
27
28/**
29 @file storage/perfschema/pfs_column_types.h
30 Data types for columns used in the performance schema tables (declarations)
31*/
32
33/** Size of the OBJECT_SCHEMA columns, in characters. */
34#define COL_OBJECT_SCHEMA_CHAR_SIZE 64
35/** Size of the OBJECT_SCHEMA columns, in bytes. */
36#define COL_OBJECT_SCHEMA_SIZE (COL_OBJECT_SCHEMA_CHAR_SIZE * 1)
37
38/**
39 Size of the extended OBJECT_NAME columns, in characters.
40 'Extended' columns are used when the object name also represents
41 the name of a non SQL object, such as a file name.
42 Size in bytes of:
43 - performance_schema.events_waits_current (OBJECT_NAME)
44 - performance_schema.events_waits_history (OBJECT_NAME)
45 - performance_schema.events_waits_history_long (OBJECT_NAME)
46*/
47#define COL_OBJECT_NAME_EXTENDED_CHAR_SIZE 512
48/** Size of the extended OBJECT_NAME columns, in bytes. */
49#define COL_OBJECT_NAME_EXTENDED_SIZE (COL_OBJECT_NAME_EXTENDED_CHAR_SIZE * 1)
50
51/** Size of the OBJECT_NAME columns, in characters. */
52#define COL_OBJECT_NAME_CHAR_SIZE 64
53/** Size of the OBJECT_NAME columns, in bytes. */
54#define COL_OBJECT_NAME_SIZE (COL_OBJECT_NAME_CHAR_SIZE * 1)
55
56/** Size of the INDEX_NAME columns, in characters. */
57#define COL_INDEX_NAME_CHAR_SIZE 64
58/** Size of the INDEX_NAME columns, in bytes. */
59#define COL_INDEX_NAME_SIZE (COL_INDEX_NAME_CHAR_SIZE * 1)
60
61/**
62 Size of INFO columns, in characters.
63 Size of:
64 - performance_schema.events_statement_current (INFO)
65 - performance_schema.events_statement_history (INFO)
66 - performance_schema.events_statement_history_long (INFO)
67*/
68#define COL_INFO_CHAR_SIZE 1024
69/** Size of INFO columns, in bytes. */
70#define COL_INFO_SIZE (COL_INFO_CHAR_SIZE * 1)
71
72/** Size of the SOURCE columns, in characters. */
73#define COL_SOURCE_CHAR_SIZE 64
74/** Size of the SOURCE columns, in bytes. */
75#define COL_SOURCE_SIZE (COL_SOURCE_CHAR_SIZE * 1)
76
77/**
78 Enum values for the TIMER_NAME columns.
79 This enum is found in the following tables:
80 - performance_schema.performance_timer (TIMER_NAME)
81*/
88};
89
90/** Integer, first value of @sa enum_timer_name. */
91#define FIRST_TIMER_NAME (static_cast<int>(TIMER_NAME_CYCLE))
92/** Integer, last value of @sa enum_timer_name. */
93#define LAST_TIMER_NAME (static_cast<int>(TIMER_NAME_THREAD_CPU))
94/** Integer, number of values of @sa enum_timer_name. */
95#define COUNT_TIMER_NAME (LAST_TIMER_NAME - FIRST_TIMER_NAME + 1)
96
97/**
98 Enum values for the various YES/NO columns.
99 This enum is found in the following tables:
100 - performance_schema.setup_instruments (ENABLED)
101 - performance_schema.setup_instruments (TIMED)
102 - performance_schema.setup_consumers (ENABLED)
103*/
104enum enum_yes_no { ENUM_YES = 1, ENUM_NO = 2 };
105
106/**
107 Enum values for the various EXECUTION_ENGINE columns.
108 This enum is found in the following tables:
109 - performance_schema.threads
110 - performance_schema.processlist
111 - performance_schema.events_statements_current
112 - performance_schema.events_statements_history
113 - performance_schema.events_statements_history_long
114*/
116
117/**
118 Enum values for the various OPERATION columns.
119 This enum is found in the following tables:
120 - performance_schema.events_waits_current (OPERATION)
121 - performance_schema.events_waits_history (OPERATION)
122 - performance_schema.events_waits_history_long (OPERATION)
123*/
125 /* Mutex operations */
128
129 /* Rwlock operations (RW-lock) */
135
136 /* Rwlock operations (SX-lock) */
146
147 /* Cond operations */
150
151 /* File operations */
169
170 /* Table I/O operations */
175
176 /* Table lock operations */
187
188 /* Socket operations */
204
205 /* Idle operation */
207
208 /* Metadata lock operation */
211/** Integer, first value of @sa enum_operation_type. */
212#define FIRST_OPERATION_TYPE (static_cast<int>(OPERATION_TYPE_LOCK))
213/** Integer, last value of @sa enum_operation_type. */
214#define LAST_OPERATION_TYPE (static_cast<int>(OPERATION_TYPE_METADATA))
215/** Integer, number of values of @sa enum_operation_type. */
216#define COUNT_OPERATION_TYPE (LAST_OPERATION_TYPE - FIRST_OPERATION_TYPE + 1)
217
218/**
219 Enum values for the various OBJECT_TYPE columns.
220*/
221enum enum_object_type : char {
223
224 /* Advertised in SQL ENUM */
225
231
232 /* Not advertised in SQL ENUM, only displayed as VARCHAR */
233
249/** Integer, first value of @sa enum_object_type. */
250#define FIRST_OBJECT_TYPE (static_cast<int>(OBJECT_TYPE_EVENT))
251/** Integer, last value of @sa enum_object_type. */
252#define LAST_OBJECT_TYPE (static_cast<int>(OBJECT_TYPE_CHECK_CONSTRAINT))
253/** Integer, number of values of @sa enum_object_type. */
254#define COUNT_OBJECT_TYPE (LAST_OBJECT_TYPE - FIRST_OBJECT_TYPE + 1)
255
256void object_type_to_string(enum_object_type object_type, const char **string,
257 size_t *length);
258
259void string_to_object_type(const char *string, size_t length,
260 enum_object_type *object_type);
261
262/**
263 Enum values for the NESTING_EVENT_TYPE columns.
264 This enum is found in the following tables:
265 - performance_schema.events_waits_current (NESTING_EVENT_TYPE)
266 - performance_schema.events_stages_current (NESTING_EVENT_TYPE)
267 - performance_schema.events_statements_current (NESTING_EVENT_TYPE)
268*/
275
276/** Integer, first value of @sa enum_event_type. */
277#define FIRST_EVENT_TYPE (static_cast<int>(EVENT_TYPE_TRANSACTION))
278/** Integer, last value of @sa enum_event_type. */
279#define LAST_EVENT_TYPE (static_cast<int>(EVENT_TYPE_WAIT))
280/** Integer, number of values of @sa enum_event_type. */
281#define COUNT_EVENT_TYPE (LAST_EVENT_TYPE - FIRST_EVENT_TYPE + 1)
282
283/**
284 Enum values for transaction state columns.
285*/
291
292/** Integer, first value of @sa enum_transaction_state. */
293#define FIRST_TRANS_STATE (static_cast<int>(TRANS_STATE_ACTIVE))
294/** Integer, last value of @sa enum_transaction_state. */
295#define LAST_TRANS_STATE (static_cast<int>(TRANS_STATE_ROLLED_BACK))
296/** Integer, number of values of @sa enum_transaction_state. */
297#define COUNT_TRANS_STATE (LAST_TRANS_STATE - FIRST_TRANS_STATE + 1)
298
299/**
300 Enum values for XA transaction state columns. Enums 1-5 match those used by
301 the server. See XID_STATE::enum xa_states in xa.h.
302*/
311
312/** Integer, first value of @sa enum_xa_transaction_state. */
313#define FIRST_TRANS_STATE_XA (static_cast<int>(TRANS_STATE_XA_NOTR))
314/** Integer, last value of @sa enum_xa_transaction_state. */
315#define LAST_TRANS_STATE_XA (static_cast<int>(TRANS_STATE_XA_COMMITTED))
316/** Integer, number of values of @sa enum_xa_transaction_state. */
317#define COUNT_TRANS_STATE_XA (LAST_TRANS_STATE_XA - FIRST_TRANS_STATE_XA + 1)
318
319/**
320 Enum values for transaction isolation level columns.
321 See enum_tx_isolation in handler.h.
322*/
329
330/** Integer, first value of @sa enum_isolation_level. */
331#define FIRST_TRANS_LEVEL (static_cast<int>(TRANS_LEVEL_READ_UNCOMMITTED))
332/** Integer, last value of @sa enum_isolation_level. */
333#define LAST_TRANS_LEVEL (static_cast<int>(TRANS_LEVEL_SERIALIZABLE))
334/** Integer, number of values of @sa enum_isolation_level. */
335#define COUNT_TRANS_LEVEL (LAST_TRANS_LEVEL - FIRST_TRANS_LEVEL + 1)
336
337/**
338 Enum values for transaction acces mode columns.
339*/
344
345/** Integer, first value of @sa enum_transaction_mode. */
346#define FIRST_TRANS_MODE (static_cast<int>(TRANS_MODE_READ_WRITE))
347/** Integer, last value of @sa enum_transaction_mode. */
348#define LAST_TRANS_MODE (static_cast<int>(TRANS_MODE_READ_ONLY))
349/** Integer, number of values of @sa enum_transaction_mode. */
350#define COUNT_TRANS_MODE (LAST_TRANS_MODE - FIRST_TRANS_MODE + 1)
351
352/* Flags exposed in setup_instruments.properties */
353#define INSTR_PROPERTIES_SET_SINGLETON (1 << 0)
354#define INSTR_PROPERTIES_SET_PROGRESS (1 << 1)
355#define INSTR_PROPERTIES_SET_USER (1 << 2)
356#define INSTR_PROPERTIES_SET_GLOBAL_STAT (1 << 3)
357#define INSTR_PROPERTIES_SET_MUTABLE (1 << 4)
358
359/* Flags exposed in setup_threads.properties */
360#define THREAD_PROPERTIES_SET_SINGLETON (1 << 0)
361#define THREAD_PROPERTIES_SET_USER (1 << 1)
362
363#endif
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
enum_isolation_level
Enum values for transaction isolation level columns.
Definition: pfs_column_types.h:323
@ TRANS_LEVEL_REPEATABLE_READ
Definition: pfs_column_types.h:326
@ TRANS_LEVEL_READ_COMMITTED
Definition: pfs_column_types.h:325
@ TRANS_LEVEL_READ_UNCOMMITTED
Definition: pfs_column_types.h:324
@ TRANS_LEVEL_SERIALIZABLE
Definition: pfs_column_types.h:327
enum_transaction_state
Enum values for transaction state columns.
Definition: pfs_column_types.h:286
@ TRANS_STATE_ACTIVE
Definition: pfs_column_types.h:287
@ TRANS_STATE_ROLLED_BACK
Definition: pfs_column_types.h:289
@ TRANS_STATE_COMMITTED
Definition: pfs_column_types.h:288
void string_to_object_type(const char *string, size_t length, enum_object_type *object_type)
Definition: pfs_column_types.cc:81
enum_transaction_mode
Enum values for transaction acces mode columns.
Definition: pfs_column_types.h:340
@ TRANS_MODE_READ_ONLY
Definition: pfs_column_types.h:341
@ TRANS_MODE_READ_WRITE
Definition: pfs_column_types.h:342
enum_event_type
Enum values for the NESTING_EVENT_TYPE columns.
Definition: pfs_column_types.h:269
@ EVENT_TYPE_WAIT
Definition: pfs_column_types.h:273
@ EVENT_TYPE_TRANSACTION
Definition: pfs_column_types.h:270
@ EVENT_TYPE_STATEMENT
Definition: pfs_column_types.h:271
@ EVENT_TYPE_STAGE
Definition: pfs_column_types.h:272
enum_xa_transaction_state
Enum values for XA transaction state columns.
Definition: pfs_column_types.h:303
@ TRANS_STATE_XA_PREPARED
Definition: pfs_column_types.h:307
@ TRANS_STATE_XA_ROLLBACK_ONLY
Definition: pfs_column_types.h:308
@ TRANS_STATE_XA_COMMITTED
Definition: pfs_column_types.h:309
@ TRANS_STATE_XA_ACTIVE
Definition: pfs_column_types.h:305
@ TRANS_STATE_XA_IDLE
Definition: pfs_column_types.h:306
@ TRANS_STATE_XA_NOTR
Definition: pfs_column_types.h:304
enum_yes_no
Enum values for the various YES/NO columns.
Definition: pfs_column_types.h:104
@ ENUM_YES
Definition: pfs_column_types.h:104
@ ENUM_NO
Definition: pfs_column_types.h:104
enum_executed_on_engine
Enum values for the various EXECUTION_ENGINE columns.
Definition: pfs_column_types.h:115
@ ENUM_PRIMARY
Definition: pfs_column_types.h:115
@ ENUM_SECONDARY
Definition: pfs_column_types.h:115
enum_timer_name
Enum values for the TIMER_NAME columns.
Definition: pfs_column_types.h:82
@ TIMER_NAME_MICROSEC
Definition: pfs_column_types.h:85
@ TIMER_NAME_MILLISEC
Definition: pfs_column_types.h:86
@ TIMER_NAME_THREAD_CPU
Definition: pfs_column_types.h:87
@ TIMER_NAME_CYCLE
Definition: pfs_column_types.h:83
@ TIMER_NAME_NANOSEC
Definition: pfs_column_types.h:84
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:221
@ OBJECT_TYPE_FUNCTION
Definition: pfs_column_types.h:227
@ OBJECT_TYPE_SRID
Definition: pfs_column_types.h:241
@ OBJECT_TYPE_COLUMN_STATISTICS
Definition: pfs_column_types.h:243
@ OBJECT_TYPE_PROCEDURE
Definition: pfs_column_types.h:228
@ OBJECT_TYPE_CHECK_CONSTRAINT
Definition: pfs_column_types.h:247
@ OBJECT_TYPE_LOCKING_SERVICE
Definition: pfs_column_types.h:240
@ OBJECT_TYPE_TABLESPACE
Definition: pfs_column_types.h:239
@ OBJECT_TYPE_ACL_CACHE
Definition: pfs_column_types.h:242
@ OBJECT_TYPE_TABLE
Definition: pfs_column_types.h:229
@ OBJECT_TYPE_BACKUP_LOCK
Definition: pfs_column_types.h:244
@ OBJECT_TYPE_TRIGGER
Definition: pfs_column_types.h:230
@ NO_OBJECT_TYPE
Definition: pfs_column_types.h:222
@ OBJECT_TYPE_GLOBAL
Definition: pfs_column_types.h:235
@ OBJECT_TYPE_RESOURCE_GROUPS
Definition: pfs_column_types.h:245
@ OBJECT_TYPE_TEMPORARY_TABLE
Definition: pfs_column_types.h:234
@ OBJECT_TYPE_EVENT
Definition: pfs_column_types.h:226
@ OBJECT_TYPE_COMMIT
Definition: pfs_column_types.h:237
@ OBJECT_TYPE_SCHEMA
Definition: pfs_column_types.h:236
@ OBJECT_TYPE_FOREIGN_KEY
Definition: pfs_column_types.h:246
@ OBJECT_TYPE_USER_LEVEL_LOCK
Definition: pfs_column_types.h:238
enum_operation_type
Enum values for the various OPERATION columns.
Definition: pfs_column_types.h:124
@ OPERATION_TYPE_FILESTAT
Definition: pfs_column_types.h:163
@ OPERATION_TYPE_TL_WRITE_CONCURRENT_INSERT
Definition: pfs_column_types.h:182
@ OPERATION_TYPE_SOCKETSHUTDOWN
Definition: pfs_column_types.h:202
@ OPERATION_TYPE_SOCKETSELECT
Definition: pfs_column_types.h:203
@ OPERATION_TYPE_TL_READ_EXTERNAL
Definition: pfs_column_types.h:185
@ OPERATION_TYPE_SOCKETCONNECT
Definition: pfs_column_types.h:190
@ OPERATION_TYPE_FILEDELETE
Definition: pfs_column_types.h:166
@ OPERATION_TYPE_TRYSHAREDLOCK
Definition: pfs_column_types.h:140
@ OPERATION_TYPE_TL_WRITE_LOW_PRIORITY
Definition: pfs_column_types.h:183
@ OPERATION_TYPE_SOCKETSTAT
Definition: pfs_column_types.h:201
@ OPERATION_TYPE_FILESYNC
Definition: pfs_column_types.h:168
@ OPERATION_TYPE_TRYWRITELOCK
Definition: pfs_column_types.h:133
@ OPERATION_TYPE_TABLE_DELETE_ROW
Definition: pfs_column_types.h:174
@ OPERATION_TYPE_EXCLUSIVEUNLOCK
Definition: pfs_column_types.h:145
@ OPERATION_TYPE_TL_WRITE_EXTERNAL
Definition: pfs_column_types.h:186
@ OPERATION_TYPE_SOCKETCREATE
Definition: pfs_column_types.h:189
@ OPERATION_TYPE_SOCKETRECVFROM
Definition: pfs_column_types.h:196
@ OPERATION_TYPE_TL_WRITE_ALLOW_WRITE
Definition: pfs_column_types.h:181
@ OPERATION_TYPE_WAIT
Definition: pfs_column_types.h:148
@ OPERATION_TYPE_SHAREDLOCK
Definition: pfs_column_types.h:137
@ OPERATION_TYPE_SOCKETRECV
Definition: pfs_column_types.h:194
@ OPERATION_TYPE_FILECREATETMP
Definition: pfs_column_types.h:153
@ OPERATION_TYPE_TL_READ_NO_INSERTS
Definition: pfs_column_types.h:180
@ OPERATION_TYPE_TRYREADLOCK
Definition: pfs_column_types.h:132
@ OPERATION_TYPE_UNLOCK
Definition: pfs_column_types.h:134
@ OPERATION_TYPE_SOCKETSENDTO
Definition: pfs_column_types.h:195
@ OPERATION_TYPE_FILECHSIZE
Definition: pfs_column_types.h:165
@ OPERATION_TYPE_FILEREAD
Definition: pfs_column_types.h:158
@ OPERATION_TYPE_FILERENAME
Definition: pfs_column_types.h:167
@ OPERATION_TYPE_READLOCK
Definition: pfs_column_types.h:130
@ OPERATION_TYPE_TRYLOCK
Definition: pfs_column_types.h:127
@ OPERATION_TYPE_TRYEXCLUSIVELOCK
Definition: pfs_column_types.h:142
@ OPERATION_TYPE_TL_READ_HIGH_PRIORITY
Definition: pfs_column_types.h:179
@ OPERATION_TYPE_TABLE_UPDATE_ROW
Definition: pfs_column_types.h:173
@ OPERATION_TYPE_FILECLOSE
Definition: pfs_column_types.h:156
@ OPERATION_TYPE_SOCKETOPT
Definition: pfs_column_types.h:200
@ OPERATION_TYPE_TL_READ_WITH_SHARED_LOCKS
Definition: pfs_column_types.h:178
@ OPERATION_TYPE_SOCKETSEND
Definition: pfs_column_types.h:193
@ OPERATION_TYPE_LOCK
Definition: pfs_column_types.h:126
@ OPERATION_TYPE_FILEWRITE
Definition: pfs_column_types.h:159
@ OPERATION_TYPE_FILETELL
Definition: pfs_column_types.h:161
@ OPERATION_TYPE_FILEFLUSH
Definition: pfs_column_types.h:162
@ OPERATION_TYPE_FILESTREAMOPEN
Definition: pfs_column_types.h:155
@ OPERATION_TYPE_SOCKETSENDMSG
Definition: pfs_column_types.h:197
@ OPERATION_TYPE_FILEFSTAT
Definition: pfs_column_types.h:164
@ OPERATION_TYPE_TRYSHAREDEXCLUSIVELOCK
Definition: pfs_column_types.h:141
@ OPERATION_TYPE_SOCKETBIND
Definition: pfs_column_types.h:191
@ OPERATION_TYPE_SOCKETRECVMSG
Definition: pfs_column_types.h:198
@ OPERATION_TYPE_TL_READ_NORMAL
Definition: pfs_column_types.h:177
@ OPERATION_TYPE_TABLE_FETCH
Definition: pfs_column_types.h:171
@ OPERATION_TYPE_FILESEEK
Definition: pfs_column_types.h:160
@ OPERATION_TYPE_SHAREDEXCLUSIVELOCK
Definition: pfs_column_types.h:138
@ OPERATION_TYPE_SOCKETCLOSE
Definition: pfs_column_types.h:192
@ OPERATION_TYPE_TABLE_WRITE_ROW
Definition: pfs_column_types.h:172
@ OPERATION_TYPE_SOCKETSEEK
Definition: pfs_column_types.h:199
@ OPERATION_TYPE_FILECREATE
Definition: pfs_column_types.h:152
@ OPERATION_TYPE_METADATA
Definition: pfs_column_types.h:209
@ OPERATION_TYPE_SHAREDEXCLUSIVEUNLOCK
Definition: pfs_column_types.h:144
@ OPERATION_TYPE_WRITELOCK
Definition: pfs_column_types.h:131
@ OPERATION_TYPE_IDLE
Definition: pfs_column_types.h:206
@ OPERATION_TYPE_TIMEDWAIT
Definition: pfs_column_types.h:149
@ OPERATION_TYPE_TL_WRITE_NORMAL
Definition: pfs_column_types.h:184
@ OPERATION_TYPE_SHAREDUNLOCK
Definition: pfs_column_types.h:143
@ OPERATION_TYPE_FILEOPEN
Definition: pfs_column_types.h:154
@ OPERATION_TYPE_FILESTREAMCLOSE
Definition: pfs_column_types.h:157
@ OPERATION_TYPE_EXCLUSIVELOCK
Definition: pfs_column_types.h:139
void object_type_to_string(enum_object_type object_type, const char **string, size_t *length)
Definition: pfs_column_types.cc:62