MySQL 8.0.39
Source Code Documentation
table_helper.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25#ifndef PFS_TABLE_HELPER_H
26#define PFS_TABLE_HELPER_H
27
28/**
29 @file storage/perfschema/table_helper.h
30 Helpers to implement a performance schema table.
31*/
32
33#include <assert.h>
34#include <stddef.h>
35#include <sys/types.h>
36
37#include "lex_string.h"
38
39#include "my_inttypes.h"
50
51struct PFS_host;
52struct PFS_user;
53struct PFS_account;
54struct PFS_schema_name;
55struct PFS_object_name;
56struct PFS_routine_name;
57struct PFS_program;
58class System_variable;
59class Status_variable;
60struct User_variable;
61struct PFS_events_waits;
62struct PFS_table;
65struct PFS_setup_actor;
66struct PFS_setup_object;
67class Json_wrapper;
68
69/**
70 @file storage/perfschema/table_helper.h
71 Performance schema table helpers (declarations).
72*/
73
74/**
75 @addtogroup performance_schema_tables
76 @{
77*/
78
79/**
80 Helper, assign a value to a @c tinyint field.
81 @param f the field to set
82 @param value the value to assign
83*/
84void set_field_tiny(Field *f, long value);
85
86/**
87 Helper, assign a value to a @c unsigned tinyint field.
88 @param f the field to set
89 @param value the value to assign
90*/
91void set_field_utiny(Field *f, ulong value);
92
93/**
94 Helper, read a value from an @c tinyint field.
95 @param f the field to read
96 @return the field value
97*/
98long get_field_tiny(Field *f);
99
100ulong get_field_utiny(Field *f);
101
102/**
103 Helper, assign a value to a @c short field.
104 @param f the field to set
105 @param value the value to assign
106*/
107void set_field_short(Field *f, long value);
108
109/**
110 Helper, assign a value to a @c unsigned short field.
111 @param f the field to set
112 @param value the value to assign
113*/
114void set_field_ushort(Field *f, ulong value);
115
116/**
117 Helper, read a value from an @c smallint field.
118 @param f the field to read
119 @return the field value
120*/
121long get_field_short(Field *f);
122
123ulong get_field_ushort(Field *f);
124
125/**
126 Helper, assign a value to a @c medium field.
127 @param f the field to set
128 @param value the value to assign
129*/
130void set_field_medium(Field *f, long value);
131
132/**
133 Helper, assign a value to a @c unsigned medium field.
134 @param f the field to set
135 @param value the value to assign
136*/
137void set_field_umedium(Field *f, ulong value);
138
139/**
140 Helper, read a value from an @c mediumint field.
141 @param f the field to read
142 @return the field value
143*/
144long get_field_medium(Field *f);
145
146ulong get_field_umedium(Field *f);
147
148/**
149 Helper, assign a value to a @c long field.
150 @param f the field to set
151 @param value the value to assign
152*/
153void set_field_long(Field *f, long value);
154
155/**
156 Helper, assign a value to a @c ulong field.
157 @param f the field to set
158 @param value the value to assign
159*/
160void set_field_ulong(Field *f, ulong value);
161
162/**
163 Helper, read a value from a @c long field.
164 @param f the field to read
165 @return the field value
166*/
167long get_field_long(Field *f);
168
169ulong get_field_ulong(Field *f);
170
171/**
172 Helper, assign a value to a @c longlong field.
173 @param f the field to set
174 @param value the value to assign
175*/
176void set_field_longlong(Field *f, longlong value);
177
178/**
179 Helper, assign a value to a @c ulonglong field.
180 @param f the field to set
181 @param value the value to assign
182*/
183void set_field_ulonglong(Field *f, ulonglong value);
184
186
187/**
188 Helper, read a value from an @c ulonglong field.
189 @param f the field to read
190 @return the field value
191*/
193
194/**
195 Helper, assign a value to a @c decimal field.
196 @param f the field to set
197 @param value the value to assign
198*/
199void set_field_decimal(Field *f, double value);
200
201/**
202 Helper, read a value from a @c decimal field.
203 @param f the field to read
204 @return the field value
205*/
206double get_field_decimal(Field *f);
207
208/**
209 Helper, assign a value to a @c float field.
210 @param f the field to set
211 @param value the value to assign
212*/
213void set_field_float(Field *f, double value);
214
215/**
216 Helper, read a value from a @c float field.
217 @param f the field to read
218 @return the field value
219*/
220double get_field_float(Field *f);
221
222/**
223 Helper, assign a value to a @c double field.
224 @param f the field to set
225 @param value the value to assign
226*/
227void set_field_double(Field *f, double value);
228
229/**
230 Helper, read a value from a @c double field.
231 @param f the field to read
232 @return the field value
233*/
234double get_field_double(Field *f);
235
236/**
237 Helper, assign a value to a @code char utf8mb4 @endcode field.
238 @param f the field to set
239 @param str the string to assign
240 @param len the length of the string to assign
241*/
242void set_field_char_utf8mb4(Field *f, const char *str, uint len);
243
244/**
245 Helper, read a value from a @code char utf8mb4 @endcode field.
246 @param f the field to read
247 @param[out] val the field value
248 @param[out] len field value length
249 @return the field value
250*/
251char *get_field_char_utf8mb4(Field *f, char *val, uint *len);
252
253/**
254 Helper, read a value from a @code char utf8mb4 @endcode field.
255 @param f the field to read
256 @param[out] val the field value
257 @return the field value
258*/
260
261/**
262 Helper, assign a value to a @code varchar utf8mb4 @endcode field.
263 @param f the field to set
264 @param cs the string character set
265 @param str the string to assign
266 @param len the length of the string to assign
267*/
268void set_field_varchar(Field *f, const CHARSET_INFO *cs, const char *str,
269 uint len);
270
271/**
272 Helper, read a value from a @code varchar utf8mb4 @endcode field.
273 @param f the field to read
274 @param[out] val the field value
275 @return the field value
276*/
278
279/**
280 Helper, read a value from a @code varchar utf8mb4 @endcode field.
281 @param f the field to read
282 @param[out] val the field value
283 @param[out] len field value length
284 @return the field value
285*/
286char *get_field_varchar_utf8mb4(Field *f, char *val, uint *len);
287
288/**
289 Helper, assign a value to a @code varchar utf8mb4 @endcode field.
290 @param f the field to set
291 @param str the string to assign
292*/
293void set_field_varchar_utf8mb4(Field *f, const char *str);
294
295/**
296 Helper, assign a value to a @code varchar utf8mb4 @endcode field.
297 @param f the field to set
298 @param str the string to assign
299 @param len the length of the string to assign
300*/
301void set_field_varchar_utf8mb4(Field *f, const char *str, uint len);
302
303/**
304 Helper, assign a value to a text/blob field.
305 @param f the field to set
306 @param val the value to assign
307 @param len the length of the string to assign
308*/
309void set_field_blob(Field *f, const char *val, size_t len);
310
311/**
312 Helper, assign a value to a text field.
313 @param f the field to set
314 @param val the value to assign
315 @param len the length of the string to assign
316 @param cs the charset of the string
317*/
318void set_field_text(Field *f, const char *val, size_t len,
319 const CHARSET_INFO *cs);
320/**
321 Helper, read a value from a @c blob field.
322 @param f the field to read
323 @param[out] val the field value
324 @param[out] len field value length
325 @return the field value
326*/
327char *get_field_blob(Field *f, char *val, uint *len);
328
329/**
330 Helper, assign a value to an @c enum field.
331 @param f the field to set
332 @param value the value to assign
333*/
334void set_field_enum(Field *f, ulonglong value);
335
336/**
337 Helper, read a value from an @c enum field.
338 @param f the field to read
339 @return the field value
340*/
342
343/**
344 Helper, assign a value to a @c set field.
345 @param f the field to set
346 @param value the value to assign
347*/
348void set_field_set(Field *f, ulonglong value);
349
350/**
351 Helper, read a value from a @c set field.
352 @param f the field to read
353 @return the field value
354*/
356
357/**
358 Helper, assign a value to a @c date field.
359 @param f the field to set
360 @param value the value to assign
361 @param len length of the value
362*/
363void set_field_date(Field *f, const char *value, uint len);
364
365/**
366 Helper, read a value from an @c date field.
367 @param f the field to read
368 @param[out] val the field value
369 @param[out] len field value length
370 @return the field value
371*/
372char *get_field_date(Field *f, char *val, uint *len);
373
374/**
375 Helper, assign a value to a @c time field.
376 @param f the field to set
377 @param value the value to assign
378 @param len length of the value
379*/
380void set_field_time(Field *f, const char *value, uint len);
381
382/**
383 Helper, read a value from an @c time field.
384 @param f the field to read
385 @param[out] val the field value
386 @param[out] len field value length
387 @return the field value
388*/
389char *get_field_time(Field *f, char *val, uint *len);
390
391/**
392 Helper, assign a value to a @c datetime field.
393 @param f the field to set
394 @param value the value to assign
395 @param len length of the value
396*/
397void set_field_datetime(Field *f, const char *value, uint len);
398
399/**
400 Helper, read a value from an @c datetime field.
401 @param f the field to read
402 @param[out] val the field value
403 @param[out] len field value length
404 @return the field value
405*/
406char *get_field_datetime(Field *f, char *val, uint *len);
407
408/**
409 Helper, assign a value to a @c timestamp field.
410 @param f the field to set
411 @param value the value to assign
412*/
413void set_field_timestamp(Field *f, ulonglong value);
414
415/**
416 Helper, assign a value to a @c timestamp field.
417 @param f the field to set
418 @param value the value to assign
419 @param len length of the value
420*/
421void set_field_timestamp(Field *f, const char *value, uint len);
422
423/**
424 Helper, read a value from an @c timestamp field.
425 @param f the field to read
426 @param[out] val the field value
427 @param[out] len field value length
428 @return the field value
429*/
430char *get_field_timestamp(Field *f, char *val, uint *len);
431
432/**
433 Helper, assign a value to a @c year field.
434 @param f the field to set
435 @param value the value to assign
436*/
437void set_field_year(Field *f, ulong value);
438
439/**
440 Helper, read a value from an @c year field.
441 @param f the field to read
442 @return the field value
443*/
444ulong get_field_year(Field *f);
445
446/**
447 Helper, assign a value to a JSON field.
448 @param f the field to set
449 @param json the value to assign
450*/
451void set_field_json(Field *f, const Json_wrapper *json);
452
454void set_field_schema_name(Field *f, const PFS_schema_name *schema);
455
457void set_field_object_name(Field *f, const PFS_object_name *object);
458
460void set_field_routine_name(Field *f, const PFS_routine_name *object);
461
462/**
463 Helper, format sql text for output.
464
465 @param source_sqltext raw sqltext, possibly truncated
466 @param source_length length of source_sqltext
467 @param source_cs character set of source_sqltext
468 @param truncated true if source_sqltext was truncated
469 @param sqltext sqltext formatted for output
470 */
471void format_sqltext(const char *source_sqltext, size_t source_length,
472 const CHARSET_INFO *source_cs, bool truncated,
473 String &sqltext);
474
475/**
476 Create a SOURCE column from source file and line.
477
478 @param source_file source file name pointer from __FILE__
479 @param source_line line number
480 @param row_buffer target string buffer
481 @param row_buffer_size size of target buffer
482 @param row_length string length of combined source file and line
483*/
484void make_source_column(const char *source_file, size_t source_line,
485 char row_buffer[], size_t row_buffer_size,
486 uint &row_length);
487
488/** Name space, internal views used within table setup_instruments. */
490 static const uint FIRST_INSTRUMENT = 1;
491
492 static const uint FIRST_VIEW = 1;
493 static const uint VIEW_MUTEX = 1;
494 static const uint VIEW_RWLOCK = 2;
495 static const uint VIEW_COND = 3;
496 static const uint VIEW_FILE = 4;
497 static const uint VIEW_TABLE = 5;
498 static const uint VIEW_SOCKET = 6;
499 static const uint VIEW_IDLE = 7;
500 static const uint VIEW_METADATA = 8;
501 static const uint LAST_VIEW = 8;
502
503 /*
504 THREAD are displayed in table setup_threads
505 instead of setup_instruments.
506 */
507
508 static const uint VIEW_STAGE = 9;
509 static const uint VIEW_STATEMENT = 10;
510 static const uint VIEW_TRANSACTION = 11;
511 static const uint VIEW_BUILTIN_MEMORY = 12;
512 static const uint VIEW_MEMORY = 13;
513 static const uint VIEW_ERROR = 14;
514
515 static const uint LAST_INSTRUMENT = 14;
516};
517
518/** Name space, internal views used within object summaries. */
520 static const uint FIRST_VIEW = 1;
521 static const uint VIEW_TABLE = 1;
522 static const uint VIEW_PROGRAM = 2;
523 static const uint LAST_VIEW = 2;
524};
525
526/** Row fragment for column HOST. */
528 /** Column HOST. */
530
531 /** Build a row from a memory buffer. */
532 int make_row(PFS_host *pfs);
533 /** Set a table field from the row. */
534 void set_field(Field *f);
535 void set_nullable_field(Field *f);
536};
537
538/** Row fragment for column USER. */
540 /** Column USER. */
542
543 /** Build a row from a memory buffer. */
544 int make_row(PFS_user *pfs);
545 /** Set a table field from the row. */
546 void set_field(Field *f);
547 void set_nullable_field(Field *f);
548};
549
550/** Row fragment for columns USER, HOST. */
552 /** Column USER. */
554 /** Column HOST. */
556
557 /** Build a row from a memory buffer. */
559 /** Set a table field from the row. */
560 void set_field(uint index, Field *f);
561 void set_nullable_field(uint index, Field *f);
562};
563
564/** Row fragment for columns DIGEST, DIGEST_TEXT. */
566 /** Column SCHEMA_NAME. */
568 /** Column DIGEST. */
570 /** Length in bytes of @c m_digest. */
572 /** Column DIGEST_TEXT. */
574
575 /** Build a row from a memory buffer. */
577 /** Set a table field from the row. */
578 void set_field(uint index, Field *f);
579};
580
581/** Row fragment for column EVENT_NAME. */
583 /** Column EVENT_NAME. */
584 const char *m_name;
585 /** Length in bytes of @c m_name. */
587
588 /** Build a row from a memory buffer. */
590 m_name = pfs->m_name.str();
591 m_name_length = pfs->m_name.length();
592 return 0;
593 }
594
595 /** Set a table field from the row. */
596 inline void set_field(Field *f) {
598 }
599};
600
601/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
603 /** Column OBJECT_TYPE. */
605 /** Column SCHEMA_NAME. */
607 /** Column OBJECT_NAME. */
609
610 /** Build a row from a memory buffer. */
613 /** Set a table field from the row. */
614 void set_field(uint index, Field *f);
615 void set_nullable_field(uint index, Field *f);
616};
617
618/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
620 /** Column OBJECT_TYPE. */
622 /** Column SCHEMA_NAME. */
624 /** Column OBJECT_NAME. */
626
627 /** Set a table field from the row. */
628 void set_field(uint index, Field *f);
629 void set_nullable_field(uint index, Field *f);
630};
631
632/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, COLUMN_NAME.
633 */
635 /** Column OBJECT_TYPE. */
637 /** Column SCHEMA_NAME. */
639 /** Length in bytes of @c m_schema_name. */
641 /** Column OBJECT_NAME. */
643 /** Length in bytes of @c m_object_name. */
645 /** Column OBJECT_NAME. */
647 /** Length in bytes of @c m_column_name. */
649
650 /** Build a row from a memory buffer. */
651 int make_row(const MDL_key *mdl);
652 /** Set a table field from the row. */
653 void set_nullable_field(uint index, Field *f);
654};
655
656/**
657 Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
658 */
661 /** Column INDEX_NAME. */
663 /** Length in bytes of @c m_index_name. */
665
666 /** Build a row from a memory buffer. */
667 int make_index_name(PFS_table_share_index *pfs_index, uint table_index);
669 uint table_index);
670 /** Set a table field from the row. */
671 void set_field(uint index, Field *f);
672 void set_nullable_field(uint index, Field *f);
673};
674
675/**
676 Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
677 */
681
682 /** Set a table field from the row. */
683 void set_field(uint index, Field *f);
684 void set_nullable_field(uint index, Field *f);
685};
686
687/** Row fragment for single statistics columns (COUNT, SUM, MIN, AVG, MAX) */
689 /** Column COUNT_STAR. */
691 /** Column SUM_TIMER_WAIT. */
693 /** Column MIN_TIMER_WAIT. */
695 /** Column AVG_TIMER_WAIT. */
697 /** Column MAX_TIMER_WAIT. */
699
700 inline void reset() {
701 m_count = 0;
702 m_sum = 0;
703 m_min = 0;
704 m_avg = 0;
705 m_max = 0;
706 }
707
708 /** Build a row with timer fields from a memory buffer. */
709 inline void set(time_normalizer *normalizer, const PFS_single_stat *stat) {
710 m_count = stat->m_count;
711
712 if ((m_count != 0) && stat->has_timed_stats()) {
713 m_sum = normalizer->wait_to_pico(stat->m_sum);
714 m_min = normalizer->wait_to_pico(stat->m_min);
715 m_max = normalizer->wait_to_pico(stat->m_max);
716 m_avg = normalizer->wait_to_pico(stat->m_sum / m_count);
717 } else {
718 m_sum = 0;
719 m_min = 0;
720 m_avg = 0;
721 m_max = 0;
722 }
723 }
724
725 /** Set a table field from the row. */
726 void set_field(uint index, Field *f) {
727 switch (index) {
728 case 0: /* COUNT */
730 break;
731 case 1: /* SUM */
733 break;
734 case 2: /* MIN */
736 break;
737 case 3: /* AVG */
739 break;
740 case 4: /* MAX */
742 break;
743 default:
744 assert(false);
745 }
746 }
747};
748
749/** Row fragment for timer and byte count stats. Corresponds to PFS_byte_stat */
753
754 /** Build a row with timer and byte count fields from a memory buffer. */
755 inline void set(time_normalizer *normalizer, const PFS_byte_stat *stat) {
756 m_waits.set(normalizer, stat);
757 m_bytes = stat->m_bytes;
758 }
759};
760
761/** Row fragment for table I/O statistics columns. */
770
771 /** Build a row from a memory buffer. */
772 inline void set(time_normalizer *normalizer, const PFS_table_io_stat *stat) {
773 PFS_single_stat all_read;
774 PFS_single_stat all_write;
776
777 m_fetch.set(normalizer, &stat->m_fetch);
778
779 all_read.aggregate(&stat->m_fetch);
780
781 m_insert.set(normalizer, &stat->m_insert);
782 m_update.set(normalizer, &stat->m_update);
783 m_delete.set(normalizer, &stat->m_delete);
784
785 all_write.aggregate(&stat->m_insert);
786 all_write.aggregate(&stat->m_update);
787 all_write.aggregate(&stat->m_delete);
788
789 all.aggregate(&all_read);
790 all.aggregate(&all_write);
791
792 m_all_read.set(normalizer, &all_read);
793 m_all_write.set(normalizer, &all_write);
794 m_all.set(normalizer, &all);
795 }
796};
797
798/** Row fragment for table lock statistics columns. */
813
814 /** Build a row from a memory buffer. */
815 inline void set(time_normalizer *normalizer,
816 const PFS_table_lock_stat *stat) {
817 PFS_single_stat all_read;
818 PFS_single_stat all_write;
820
821 m_read_normal.set(normalizer, &stat->m_stat[PFS_TL_READ]);
822 m_read_with_shared_locks.set(normalizer,
824 m_read_high_priority.set(normalizer,
827 m_read_external.set(normalizer, &stat->m_stat[PFS_TL_READ_EXTERNAL]);
828
829 all_read.aggregate(&stat->m_stat[PFS_TL_READ]);
832 all_read.aggregate(&stat->m_stat[PFS_TL_READ_NO_INSERT]);
833 all_read.aggregate(&stat->m_stat[PFS_TL_READ_EXTERNAL]);
834
835 m_write_allow_write.set(normalizer,
838 normalizer, &stat->m_stat[PFS_TL_WRITE_CONCURRENT_INSERT]);
839 m_write_low_priority.set(normalizer,
841 m_write_normal.set(normalizer, &stat->m_stat[PFS_TL_WRITE]);
843
844 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_ALLOW_WRITE]);
846 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_LOW_PRIORITY]);
847 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE]);
848 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_EXTERNAL]);
849
850 all.aggregate(&all_read);
851 all.aggregate(&all_write);
852
853 m_all_read.set(normalizer, &all_read);
854 m_all_write.set(normalizer, &all_write);
855 m_all.set(normalizer, &all);
856 }
857};
858
859/** Row fragment for stage statistics columns. */
862
863 /** Build a row from a memory buffer. */
864 inline void set(time_normalizer *normalizer, const PFS_stage_stat *stat) {
865 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
866 }
867
868 /** Set a table field from the row. */
869 void set_field(uint index, Field *f) { m_timer1_row.set_field(index, f); }
870};
871
872/** Row fragment for statement statistics columns. */
894 /**
895 CPU TIME.
896 Expressed in DISPLAY units (picoseconds).
897 */
902
903 /** Build a row from a memory buffer. */
904 inline void set(time_normalizer *normalizer, const PFS_statement_stat *stat) {
905 if (stat->m_timer1_stat.m_count != 0) {
906 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
907
912 m_rows_sent = stat->m_rows_sent;
923 m_sort_rows = stat->m_sort_rows;
924 m_sort_scan = stat->m_sort_scan;
931 } else {
933
934 m_error_count = 0;
935 m_warning_count = 0;
936 m_lock_time = 0;
937 m_rows_affected = 0;
938 m_rows_sent = 0;
939 m_rows_examined = 0;
944 m_select_range = 0;
946 m_select_scan = 0;
948 m_sort_range = 0;
949 m_sort_rows = 0;
950 m_sort_scan = 0;
951 m_no_index_used = 0;
953 m_cpu_time = 0;
957 }
958 }
959
960 /** Set a table field from the row. */
961 void set_field(uint index, Field *f);
962};
963
964/** Row fragment for stored program statistics. */
967
968 /** Build a row from a memory buffer. */
969 inline void set(time_normalizer *normalizer, const PFS_sp_stat *stat) {
970 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
971 }
972
973 /** Set a table field from the row. */
974 inline void set_field(uint index, Field *f) {
975 m_timer1_row.set_field(index, f);
976 }
977};
978
979/** Row fragment for transaction statistics columns. */
987
988 /** Build a row from a memory buffer. */
989 inline void set(time_normalizer *normalizer,
990 const PFS_transaction_stat *stat) {
991 /* Combine read write/read only stats */
993 all.aggregate(&stat->m_read_only_stat);
994 all.aggregate(&stat->m_read_write_stat);
995
996 m_timer1_row.set(normalizer, &all);
997 m_read_write_row.set(normalizer, &stat->m_read_write_stat);
998 m_read_only_row.set(normalizer, &stat->m_read_only_stat);
999 }
1000
1001 /** Set a table field from the row. */
1002 void set_field(uint index, Field *f);
1003};
1004
1005/** Row fragment for error statistics columns. */
1012
1013 /** Build a row from a memory buffer. */
1014 inline void set(const PFS_error_single_stat *stat, uint error_index) {
1015 m_count = stat->m_count;
1017 m_error_index = error_index;
1018 m_first_seen = stat->m_first_seen;
1019 m_last_seen = stat->m_last_seen;
1020 }
1021
1022 /** Set a table field from the row. */
1023 void set_field(uint index, Field *f, server_error *temp_error);
1024};
1025
1026/** Row fragment for connection statistics. */
1029
1030 inline void set(const PFS_connection_stat *stat) { m_stat = *stat; }
1031
1032 /** Set a table field from the row. */
1033 void set_field(uint index, Field *f);
1034};
1035
1036void set_field_object_type(Field *f, enum_object_type object_type);
1037void set_field_lock_type(Field *f, PFS_TL_LOCK_TYPE lock_type);
1038void set_field_mdl_type(Field *f, opaque_mdl_type mdl_type);
1039void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration);
1040void set_field_mdl_status(Field *f, opaque_mdl_status mdl_status);
1043
1044/** Row fragment for socket I/O statistics columns. */
1050
1051 inline void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat) {
1053
1054 m_read.set(normalizer, &stat->m_read);
1055 m_write.set(normalizer, &stat->m_write);
1056 m_misc.set(normalizer, &stat->m_misc);
1057
1058 /* Combine stats for all operations */
1059 all.aggregate(&stat->m_read);
1060 all.aggregate(&stat->m_write);
1061 all.aggregate(&stat->m_misc);
1062
1063 m_all.set(normalizer, &all);
1064 }
1065};
1066
1067/** Row fragment for file I/O statistics columns. */
1073
1074 inline void set(time_normalizer *normalizer, const PFS_file_io_stat *stat) {
1076
1077 m_read.set(normalizer, &stat->m_read);
1078 m_write.set(normalizer, &stat->m_write);
1079 m_misc.set(normalizer, &stat->m_misc);
1080
1081 /* Combine stats for all operations */
1082 all.aggregate(&stat->m_read);
1083 all.aggregate(&stat->m_write);
1084 all.aggregate(&stat->m_misc);
1085
1086 m_all.set(normalizer, &all);
1087 }
1088};
1089
1090/** Row fragment for memory statistics columns. */
1093
1094 /** Build a row from a memory buffer. */
1095 inline void set(const PFS_memory_monitoring_stat *stat) { m_stat = *stat; }
1096
1097 /** Set a table field from the row. */
1098 void set_field(uint index, Field *f);
1099};
1100
1106
1107 /** Build a row from a memory buffer. */
1108 void set(const PFS_session_all_memory_stat *stat);
1109
1110 /** Set a table field from the row. */
1111 void set_field(uint index, Field *f);
1112};
1113
1115 public:
1117 m_str[0] = '\0';
1118 m_length = 0;
1119 }
1120
1121 int make_row(const char *str, size_t length);
1122
1125};
1126
1128 public:
1129 /** Set the row from a status variable. */
1130 int make_row(const Status_variable *var);
1131
1132 /** Set the row from a system variable. */
1133 int make_row(const System_variable *var);
1134
1135 /** Set a table field from the row. */
1136 void set_field(Field *f);
1137
1138 const char *get_str() const { return m_str; }
1139 uint get_length() const { return m_length; }
1140
1141 private:
1142 int make_row(const CHARSET_INFO *cs, const char *str, size_t length);
1143
1144 char m_str[1024];
1147};
1148
1150 public:
1152
1155 }
1156
1158
1159 int make_row(const char *val, size_t length);
1160
1161 const char *get_value() const { return m_value; }
1162
1163 size_t get_value_length() const { return m_value_length; }
1164
1165 void clear();
1166
1167 private:
1168 char *m_value;
1170};
1171
1173 public:
1174 explicit PFS_key_long(const char *name)
1176
1177 ~PFS_key_long() override = default;
1178
1180 enum ha_rkey_function find_flag,
1181 bool &is_null, long *key_value) {
1182 return reader.read_long(find_flag, is_null, key_value);
1183 }
1184
1185 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1186 m_find_flag = stateless_read(reader, find_flag, m_is_null, &m_key_value);
1187 }
1188
1189 static bool stateless_match(bool record_null, long record_value,
1190 bool m_is_null, long m_key_value,
1191 enum ha_rkey_function find_flag);
1192
1193 protected:
1194 bool do_match(bool record_null, long record_value) {
1195 return stateless_match(record_null, record_value, m_is_null, m_key_value,
1196 m_find_flag);
1197 }
1198
1199 private:
1201};
1202
1204 public:
1205 explicit PFS_key_ulong(const char *name)
1207
1208 ~PFS_key_ulong() override = default;
1209
1211 enum ha_rkey_function find_flag,
1212 bool &is_null, ulong *key_value) {
1213 return reader.read_ulong(find_flag, is_null, key_value);
1214 }
1215
1216 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1217 m_find_flag = reader.read_ulong(find_flag, m_is_null, &m_key_value);
1218 }
1219
1220 static bool stateless_match(bool record_null, ulong record_value,
1221 bool m_is_null, ulong m_key_value,
1222 enum ha_rkey_function find_flag);
1223
1224 protected:
1225 bool do_match(bool record_null, ulong record_value);
1226
1227 private:
1229};
1230
1232 public:
1233 explicit PFS_key_longlong(const char *name)
1235
1236 ~PFS_key_longlong() override = default;
1237
1238 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1239 m_find_flag = reader.read_longlong(find_flag, m_is_null, &m_key_value);
1240 }
1241
1242 static bool stateless_match(bool record_null, longlong record_value,
1244 enum ha_rkey_function find_flag);
1245
1246 protected:
1247 bool do_match(bool record_null, longlong record_value) {
1248 return stateless_match(record_null, record_value, m_is_null, m_key_value,
1249 m_find_flag);
1250 }
1251
1252 private:
1254};
1255
1257 public:
1258 explicit PFS_key_ulonglong(const char *name)
1260
1261 ~PFS_key_ulonglong() override = default;
1262
1263 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1264 m_find_flag = reader.read_ulonglong(find_flag, m_is_null, &m_key_value);
1265 }
1266
1267 static bool stateless_match(bool record_null, ulonglong record_value,
1269 enum ha_rkey_function find_flag);
1270
1271 protected:
1272 bool do_match(bool record_null, ulonglong record_value);
1273
1274 private:
1276};
1277
1279 public:
1280 explicit PFS_key_thread_id(const char *name) : PFS_key_ulonglong(name) {}
1281
1282 ~PFS_key_thread_id() override = default;
1283
1285 bool match(const PFS_thread *pfs);
1286 bool match_owner(const PFS_table *pfs);
1287 bool match_owner(const PFS_socket *pfs);
1288 bool match_owner(const PFS_mutex *pfs);
1289 bool match_owner(const PFS_prepared_stmt *pfs);
1290 bool match_owner(const PFS_metadata_lock *pfs);
1291 bool match_writer(const PFS_rwlock *pfs);
1292};
1293
1295 public:
1296 explicit PFS_key_event_id(const char *name) : PFS_key_ulonglong(name) {}
1297
1298 ~PFS_key_event_id() override = default;
1299
1300 bool match(ulonglong event_id);
1301 bool match(const PFS_events *pfs);
1302 bool match(const PFS_events_waits *pfs);
1303 bool match_owner(const PFS_table *pfs);
1304 bool match_owner(const PFS_prepared_stmt *pfs);
1305 bool match_owner(const PFS_metadata_lock *pfs);
1306};
1307
1309 public:
1311
1312 ~PFS_key_processlist_id() override = default;
1313
1314 bool match(const PFS_thread *pfs);
1315};
1316
1318 public:
1321
1323
1324 bool match(ulonglong engine_transaction_id);
1325};
1326
1328 public:
1330
1331 ~PFS_key_thread_os_id() override = default;
1332
1333 bool match(const PFS_thread *pfs);
1334};
1335
1337 public:
1339
1340 ~PFS_key_statement_id() override = default;
1341
1342 bool match(const PFS_prepared_stmt *pfs);
1343};
1344
1346 public:
1347 explicit PFS_key_worker_id(const char *name) : PFS_key_ulonglong(name) {}
1348
1349 ~PFS_key_worker_id() override = default;
1350
1351 bool match_not_null(ulonglong worker_id);
1352};
1353
1355 public:
1356 explicit PFS_key_socket_id(const char *name) : PFS_key_long(name) {}
1357
1358 ~PFS_key_socket_id() override = default;
1359
1360 bool match(const PFS_socket *pfs);
1361};
1362
1364 public:
1365 explicit PFS_key_port(const char *name) : PFS_key_long(name) {}
1366
1367 ~PFS_key_port() override = default;
1368
1369 bool match(const PFS_socket *pfs);
1370
1371 /**
1372 match port number
1373
1374 @param port port number to match
1375 */
1376 bool match(uint port);
1377};
1378
1380 public:
1381 explicit PFS_key_error_number(const char *name) : PFS_key_long(name) {}
1382
1383 ~PFS_key_error_number() override = default;
1384
1385 bool match_error_index(uint error_index);
1386};
1387
1389 public:
1390 explicit PFS_key_pstring(const char *name) : PFS_engine_key(name) {}
1391
1392 ~PFS_key_pstring() override = default;
1393
1395 enum ha_rkey_function find_flag,
1396 bool &is_null, char *key_value,
1397 uint *key_value_length,
1398 uint key_value_max_length) {
1399 if (reader.get_key_type() == HA_KEYTYPE_TEXT) {
1400 return (reader.read_text_utf8(find_flag, is_null, key_value,
1401 key_value_length, key_value_max_length));
1402 }
1403 return (reader.read_varchar_utf8(find_flag, is_null, key_value,
1404 key_value_length, key_value_max_length));
1405 }
1406
1407 static bool stateless_match(bool record_null, const char *record_string,
1408 size_t record_string_length,
1409 const char *m_key_value,
1410 size_t m_key_value_length, bool m_is_null,
1412
1413 protected:
1414 bool do_match(bool record_null, const char *record_value,
1415 size_t record_value_length);
1416 bool do_match_prefix(bool record_null, const char *record_value,
1417 size_t record_value_length);
1418};
1419
1420template <int SIZE>
1422 public:
1423 explicit PFS_key_string(const char *name)
1425
1426 ~PFS_key_string() override = default;
1427
1428 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1429 m_find_flag = stateless_read(reader, find_flag, m_is_null, m_key_value,
1431 }
1432
1433 protected:
1434 bool do_match(bool record_null, const char *record_value,
1435 size_t record_value_length) {
1436 return stateless_match(record_null, record_value, record_value_length,
1438 m_find_flag);
1439 }
1440 bool do_match_prefix(bool record_null, const char *record_string,
1441 size_t record_string_length);
1442
1443 private:
1446};
1447
1448class PFS_key_thread_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1449 public:
1450 explicit PFS_key_thread_name(const char *name) : PFS_key_string(name) {}
1451
1452 ~PFS_key_thread_name() override = default;
1453
1454 bool match(const PFS_thread *pfs);
1455 bool match(const PFS_thread_class *klass);
1456};
1457
1458class PFS_key_event_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1459 public:
1460 explicit PFS_key_event_name(const char *name) : PFS_key_string(name) {}
1461
1462 ~PFS_key_event_name() override = default;
1463
1464 bool match(const PFS_instr_class *pfs);
1465 bool match(const PFS_mutex *pfs);
1466 bool match(const PFS_rwlock *pfs);
1467 bool match(const PFS_cond *pfs);
1468 bool match(const PFS_file *pfs);
1469 bool match(const PFS_socket *pfs);
1470 bool match_view(uint view);
1471};
1472
1473class PFS_key_user : public PFS_key_string<USERNAME_LENGTH> {
1474 public:
1475 explicit PFS_key_user(const char *name) : PFS_key_string(name) {}
1476
1477 ~PFS_key_user() override = default;
1478
1479 bool match(const PFS_thread *pfs);
1480 bool match(const PFS_user *pfs);
1481 bool match(const PFS_account *pfs);
1482 bool match(const PFS_setup_actor *pfs);
1483};
1484
1485class PFS_key_host : public PFS_key_string<HOSTNAME_LENGTH> {
1486 public:
1487 explicit PFS_key_host(const char *name) : PFS_key_string(name) {}
1488
1489 ~PFS_key_host() override = default;
1490
1491 bool match(const PFS_thread *pfs);
1492 bool match(const PFS_host *pfs);
1493 bool match(const PFS_account *pfs);
1494 bool match(const PFS_setup_actor *pfs);
1495 bool match(const char *host, size_t hostname_length);
1496};
1497
1498class PFS_key_role : public PFS_key_string<ROLENAME_LENGTH> {
1499 public:
1500 explicit PFS_key_role(const char *name) : PFS_key_string(name) {}
1501
1502 ~PFS_key_role() override = default;
1503
1504 bool match(const PFS_setup_actor *pfs);
1505};
1506
1507class PFS_key_schema : public PFS_key_string<NAME_CHAR_LEN> {
1508 public:
1509 explicit PFS_key_schema(const char *schema) : PFS_key_string(schema) {}
1510
1511 ~PFS_key_schema() override = default;
1512
1514};
1515
1516class PFS_key_digest : public PFS_key_string<MAX_KEY_LENGTH> {
1517 public:
1518 explicit PFS_key_digest(const char *digest) : PFS_key_string(digest) {}
1519
1520 ~PFS_key_digest() override = default;
1521
1523};
1524
1526 public:
1527 explicit PFS_key_bucket_number(const char *name) : PFS_key_ulong(name) {}
1528
1529 ~PFS_key_bucket_number() override = default;
1530
1531 bool match(ulong value);
1532};
1533
1534/* Generic NAME key */
1535class PFS_key_name : public PFS_key_string<NAME_CHAR_LEN> {
1536 public:
1537 explicit PFS_key_name(const char *name) : PFS_key_string(name) {}
1538
1539 ~PFS_key_name() override = default;
1540
1541 bool match(const LEX_CSTRING *name);
1542 bool match(const char *name, size_t name_length);
1543 bool match_not_null(const LEX_STRING *name);
1544 bool match_not_null(const char *name, size_t name_length);
1545};
1546
1547class PFS_key_group_name : public PFS_key_string<NAME_CHAR_LEN> {
1548 public:
1549 explicit PFS_key_group_name(const char *name) : PFS_key_string(name) {}
1550
1551 ~PFS_key_group_name() override = default;
1552
1553 bool match(const LEX_STRING *name);
1554 bool match(const char *name, size_t name_length);
1555 bool match(PFS_thread *pfs);
1556};
1557
1558class PFS_key_variable_name : public PFS_key_string<NAME_CHAR_LEN> {
1559 public:
1560 explicit PFS_key_variable_name(const char *name) : PFS_key_string(name) {}
1561
1562 ~PFS_key_variable_name() override = default;
1563
1564 bool match(const System_variable *pfs);
1565 bool match(const Status_variable *pfs);
1566 bool match(const PFS_variable_name_row *pfs);
1567};
1568
1569// FIXME: 32
1571 public:
1572 explicit PFS_key_engine_name(const char *name) : PFS_key_string(name) {}
1573
1574 ~PFS_key_engine_name() override = default;
1575
1576 bool match(const char *engine_name, size_t length);
1577};
1578
1579// FIXME: 128
1581 public:
1583
1584 ~PFS_key_engine_lock_id() override = default;
1585
1586 bool match(const char *engine_lock_id, size_t length);
1587};
1588
1589class PFS_key_ip : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> // FIXME
1590// <INET6_ADDRSTRLEN+1>
1591// fails on freebsd
1592{
1593 public:
1594 explicit PFS_key_ip(const char *name) : PFS_key_string(name) {}
1595
1596 ~PFS_key_ip() override = default;
1597
1598 bool match(const PFS_socket *pfs);
1599 bool match(const char *ip, size_t ip_length);
1600};
1601
1602class PFS_key_statement_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1603 public:
1605
1606 ~PFS_key_statement_name() override = default;
1607
1608 bool match(const PFS_prepared_stmt *pfs);
1609};
1610
1612 : public PFS_key_string<1350> // FIXME FN_REFLEN or FN_REFLEN_SE
1613{
1614 public:
1615 explicit PFS_key_file_name(const char *name) : PFS_key_string(name) {}
1616
1617 ~PFS_key_file_name() override = default;
1618
1619 bool match(const PFS_file *pfs);
1620};
1621
1622class PFS_key_object_schema : public PFS_key_string<NAME_CHAR_LEN> {
1623 public:
1624 explicit PFS_key_object_schema(const char *name) : PFS_key_string(name) {}
1625
1626 ~PFS_key_object_schema() override = default;
1627
1628 bool match(const PFS_table_share *share);
1629 bool match(const PFS_program *pfs);
1630 bool match(const PFS_prepared_stmt *pfs);
1631 bool match(const PFS_object_row *pfs);
1632 bool match(const PFS_column_row *pfs);
1633 bool match(const PFS_setup_object *pfs);
1634 bool match(const char *schema_name, size_t schema_name_length);
1635};
1636
1637class PFS_key_object_name : public PFS_key_string<NAME_CHAR_LEN> {
1638 public:
1639 explicit PFS_key_object_name(const char *name) : PFS_key_string(name) {}
1640
1641 ~PFS_key_object_name() override = default;
1642
1643 bool match(const PFS_table_share *share);
1644 bool match(const PFS_program *pfs);
1645 bool match(const PFS_prepared_stmt *pfs);
1646 bool match(const PFS_object_row *pfs);
1647 bool match(const PFS_column_row *pfs);
1648 bool match(const PFS_index_row *pfs);
1649 bool match(const PFS_setup_object *pfs);
1650 bool match(const char *object_name, size_t object_name_length);
1651};
1652
1653class PFS_key_column_name : public PFS_key_string<NAME_CHAR_LEN> {
1654 public:
1655 explicit PFS_key_column_name(const char *name) : PFS_key_string(name) {}
1656
1657 ~PFS_key_column_name() override = default;
1658
1659 bool match(const PFS_column_row *pfs);
1660};
1661
1663 public:
1664 explicit PFS_key_object_type(const char *name)
1666
1667 ~PFS_key_object_type() override = default;
1668
1669 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override;
1670
1671 bool match(enum_object_type object_type);
1672 bool match(const PFS_object_row *pfs);
1673 bool match(const PFS_column_row *pfs);
1674 bool match(const PFS_program *pfs);
1675
1676 private:
1677 bool do_match(bool record_null, enum_object_type record_value);
1679};
1680
1682 public:
1683 explicit PFS_key_object_type_enum(const char *name)
1685
1686 ~PFS_key_object_type_enum() override = default;
1687
1688 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override;
1689
1690 bool match(enum_object_type object_type);
1691 bool match(const PFS_prepared_stmt *pfs);
1692 bool match(const PFS_object_row *pfs);
1693 bool match(const PFS_program *pfs);
1694
1695 private:
1696 bool do_match(bool record_null, enum_object_type record_value);
1698};
1699
1701 public:
1702 explicit PFS_key_object_instance(const char *name)
1704
1705 ~PFS_key_object_instance() override = default;
1706
1707 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1708 ulonglong object_instance_begin{0};
1709 m_find_flag =
1710 reader.read_ulonglong(find_flag, m_is_null, &object_instance_begin);
1711 m_identity = (void *)object_instance_begin;
1712 }
1713
1714 bool match(const PFS_table *pfs);
1715 bool match(const PFS_mutex *pfs);
1716 bool match(const PFS_rwlock *pfs);
1717 bool match(const PFS_cond *pfs);
1718 bool match(const PFS_file *pfs);
1719 bool match(const PFS_socket *pfs);
1720 bool match(const PFS_prepared_stmt *pfs);
1721 bool match(const PFS_metadata_lock *pfs);
1722
1723 const void *m_identity;
1724};
1725
1726/** @} */
1727
1728#endif
Definition: field.h:575
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1161
Definition: pfs_engine_table.h:268
bool m_is_null
Definition: pfs_engine_table.h:281
enum ha_rkey_function m_find_flag
Definition: pfs_engine_table.h:280
Definition: table_helper.h:1525
PFS_key_bucket_number(const char *name)
Definition: table_helper.h:1527
~PFS_key_bucket_number() override=default
bool match(ulong value)
Definition: table_helper.cc:2151
Definition: table_helper.h:1653
~PFS_key_column_name() override=default
PFS_key_column_name(const char *name)
Definition: table_helper.h:1655
bool match(const PFS_column_row *pfs)
Definition: table_helper.cc:2455
Definition: table_helper.h:1516
PFS_key_digest(const char *digest)
Definition: table_helper.h:1518
bool match(PFS_statements_digest_stat *pfs)
Definition: table_helper.cc:2142
~PFS_key_digest() override=default
Definition: table_helper.h:1580
~PFS_key_engine_lock_id() override=default
bool match(const char *engine_lock_id, size_t length)
Definition: table_helper.cc:2205
PFS_key_engine_lock_id(const char *name)
Definition: table_helper.h:1582
Definition: table_helper.h:1570
PFS_key_engine_name(const char *name)
Definition: table_helper.h:1572
~PFS_key_engine_name() override=default
bool match(const char *engine_name, size_t length)
Definition: table_helper.cc:2201
Definition: table_helper.h:1317
~PFS_key_engine_transaction_id() override=default
PFS_key_engine_transaction_id(const char *name)
Definition: table_helper.h:1319
bool match(ulonglong engine_transaction_id)
Definition: table_helper.cc:1891
Definition: table_helper.h:1379
bool match_error_index(uint error_index)
Definition: table_helper.cc:1932
~PFS_key_error_number() override=default
PFS_key_error_number(const char *name)
Definition: table_helper.h:1381
Definition: table_helper.h:1294
bool match(ulonglong event_id)
Definition: table_helper.cc:1856
PFS_key_event_id(const char *name)
Definition: table_helper.h:1296
~PFS_key_event_id() override=default
bool match_owner(const PFS_table *pfs)
Definition: table_helper.cc:1871
Definition: table_helper.h:1458
bool match(const PFS_instr_class *pfs)
Definition: table_helper.cc:1955
PFS_key_event_name(const char *name)
Definition: table_helper.h:1460
bool match_view(uint view)
Definition: table_helper.cc:2000
~PFS_key_event_name() override=default
Definition: table_helper.h:1613
bool match(const PFS_file *pfs)
Definition: table_helper.cc:2231
PFS_key_file_name(const char *name)
Definition: table_helper.h:1615
~PFS_key_file_name() override=default
Definition: table_helper.h:1547
bool match(const LEX_STRING *name)
Definition: table_helper.cc:2173
~PFS_key_group_name() override=default
PFS_key_group_name(const char *name)
Definition: table_helper.h:1549
Definition: table_helper.h:1485
~PFS_key_host() override=default
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:2101
PFS_key_host(const char *name)
Definition: table_helper.h:1487
Definition: table_helper.h:1592
~PFS_key_ip() override=default
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:2209
PFS_key_ip(const char *name)
Definition: table_helper.h:1594
Definition: table_helper.h:1172
PFS_key_long(const char *name)
Definition: table_helper.h:1174
long m_key_value
Definition: table_helper.h:1200
bool do_match(bool record_null, long record_value)
Definition: table_helper.h:1194
static enum ha_rkey_function stateless_read(PFS_key_reader &reader, enum ha_rkey_function find_flag, bool &is_null, long *key_value)
Definition: table_helper.h:1179
~PFS_key_long() override=default
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1185
static bool stateless_match(bool record_null, long record_value, bool m_is_null, long m_key_value, enum ha_rkey_function find_flag)
Definition: table_helper.cc:1632
Definition: table_helper.h:1231
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1238
~PFS_key_longlong() override=default
PFS_key_longlong(const char *name)
Definition: table_helper.h:1233
static bool stateless_match(bool record_null, longlong record_value, bool m_is_null, longlong m_key_value, enum ha_rkey_function find_flag)
Definition: table_helper.cc:1644
bool do_match(bool record_null, longlong record_value)
Definition: table_helper.h:1247
longlong m_key_value
Definition: table_helper.h:1253
Definition: table_helper.h:1535
~PFS_key_name() override=default
bool match(const LEX_CSTRING *name)
Definition: table_helper.cc:2155
PFS_key_name(const char *name)
Definition: table_helper.h:1537
bool match_not_null(const LEX_STRING *name)
Definition: table_helper.cc:2165
Definition: table_helper.h:1700
PFS_key_object_instance(const char *name)
Definition: table_helper.h:1702
~PFS_key_object_instance() override=default
bool match(const PFS_table *pfs)
Definition: table_helper.cc:2460
const void * m_identity
Definition: table_helper.h:1723
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1707
Definition: table_helper.h:1637
~PFS_key_object_name() override=default
PFS_key_object_name(const char *name)
Definition: table_helper.h:1639
bool match(const PFS_table_share *share)
Definition: table_helper.cc:2412
Definition: table_helper.h:1622
PFS_key_object_schema(const char *name)
Definition: table_helper.h:1624
bool match(const PFS_table_share *share)
Definition: table_helper.cc:2374
~PFS_key_object_schema() override=default
Definition: table_helper.h:1681
enum_object_type m_object_type
Definition: table_helper.h:1697
~PFS_key_object_type_enum() override=default
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.cc:2306
PFS_key_object_type_enum(const char *name)
Definition: table_helper.h:1683
bool do_match(bool record_null, enum_object_type record_value)
Definition: table_helper.cc:2339
bool match(enum_object_type object_type)
Definition: table_helper.cc:2319
Definition: table_helper.h:1662
PFS_key_object_type(const char *name)
Definition: table_helper.h:1664
enum_object_type m_object_type
Definition: table_helper.h:1678
bool do_match(bool record_null, enum_object_type record_value)
Definition: table_helper.cc:2271
bool match(enum_object_type object_type)
Definition: table_helper.cc:2251
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.cc:2235
~PFS_key_object_type() override=default
Definition: table_helper.h:1363
~PFS_key_port() override=default
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:1914
PFS_key_port(const char *name)
Definition: table_helper.h:1365
Definition: table_helper.h:1308
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1886
PFS_key_processlist_id(const char *name)
Definition: table_helper.h:1310
~PFS_key_processlist_id() override=default
Definition: table_helper.h:1388
bool do_match(bool record_null, const char *record_value, size_t record_value_length)
bool do_match_prefix(bool record_null, const char *record_value, size_t record_value_length)
PFS_key_pstring(const char *name)
Definition: table_helper.h:1390
~PFS_key_pstring() override=default
static bool stateless_match(bool record_null, const char *record_string, size_t record_string_length, const char *m_key_value, size_t m_key_value_length, bool m_is_null, enum ha_rkey_function m_find_flag)
Definition: table_helper.cc:1725
static enum ha_rkey_function stateless_read(PFS_key_reader &reader, enum ha_rkey_function find_flag, bool &is_null, char *key_value, uint *key_value_length, uint key_value_max_length)
Definition: table_helper.h:1394
Definition: table_helper.h:1498
PFS_key_role(const char *name)
Definition: table_helper.h:1500
bool match(const PFS_setup_actor *pfs)
Definition: table_helper.cc:2130
~PFS_key_role() override=default
Definition: table_helper.h:1507
bool match(const PFS_statements_digest_stat *pfs)
Definition: table_helper.cc:2136
~PFS_key_schema() override=default
PFS_key_schema(const char *schema)
Definition: table_helper.h:1509
Definition: table_helper.h:1354
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:1909
~PFS_key_socket_id() override=default
PFS_key_socket_id(const char *name)
Definition: table_helper.h:1356
Definition: table_helper.h:1336
bool match(const PFS_prepared_stmt *pfs)
Definition: table_helper.cc:1900
PFS_key_statement_id(const char *name)
Definition: table_helper.h:1338
~PFS_key_statement_id() override=default
Definition: table_helper.h:1602
~PFS_key_statement_name() override=default
bool match(const PFS_prepared_stmt *pfs)
Definition: table_helper.cc:2227
PFS_key_statement_name(const char *name)
Definition: table_helper.h:1604
Definition: table_helper.h:1421
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1428
PFS_key_string(const char *name)
Definition: table_helper.h:1423
bool do_match_prefix(bool record_null, const char *record_string, size_t record_string_length)
Definition: table_helper.cc:1776
bool do_match(bool record_null, const char *record_value, size_t record_value_length)
Definition: table_helper.h:1434
~PFS_key_string() override=default
char m_key_value[SIZE *FILENAME_CHARSET_MBMAXLEN]
Definition: table_helper.h:1444
uint m_key_value_length
Definition: table_helper.h:1445
Definition: table_helper.h:1278
bool match_owner(const PFS_table *pfs)
Definition: table_helper.cc:1805
~PFS_key_thread_id() override=default
bool match_writer(const PFS_rwlock *pfs)
Definition: table_helper.cc:1846
bool match(ulonglong thread_id)
Definition: table_helper.cc:1795
PFS_key_thread_id(const char *name)
Definition: table_helper.h:1280
Definition: table_helper.h:1448
~PFS_key_thread_name() override=default
PFS_key_thread_name(const char *name)
Definition: table_helper.h:1450
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1942
Definition: table_helper.h:1327
~PFS_key_thread_os_id() override=default
PFS_key_thread_os_id(const char *name)
Definition: table_helper.h:1329
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1895
Definition: table_helper.h:1203
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1216
PFS_key_ulong(const char *name)
Definition: table_helper.h:1205
static bool stateless_match(bool record_null, ulong record_value, bool m_is_null, ulong m_key_value, enum ha_rkey_function find_flag)
Definition: table_helper.cc:1638
static enum ha_rkey_function stateless_read(PFS_key_reader &reader, enum ha_rkey_function find_flag, bool &is_null, ulong *key_value)
Definition: table_helper.h:1210
~PFS_key_ulong() override=default
ulong m_key_value
Definition: table_helper.h:1228
bool do_match(bool record_null, ulong record_value)
Definition: table_helper.cc:1657
Definition: table_helper.h:1256
~PFS_key_ulonglong() override=default
bool do_match(bool record_null, ulonglong record_value)
Definition: table_helper.cc:1691
ulonglong m_key_value
Definition: table_helper.h:1275
PFS_key_ulonglong(const char *name)
Definition: table_helper.h:1258
static bool stateless_match(bool record_null, ulonglong record_value, bool m_is_null, ulonglong m_key_value, enum ha_rkey_function find_flag)
Definition: table_helper.cc:1650
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1263
Definition: table_helper.h:1473
PFS_key_user(const char *name)
Definition: table_helper.h:1475
~PFS_key_user() override=default
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:2077
Definition: table_helper.h:1558
bool match(const System_variable *pfs)
Definition: table_helper.cc:2188
PFS_key_variable_name(const char *name)
Definition: table_helper.h:1560
~PFS_key_variable_name() override=default
Definition: table_helper.h:1345
bool match_not_null(ulonglong worker_id)
Definition: table_helper.cc:1905
~PFS_key_worker_id() override=default
PFS_key_worker_id(const char *name)
Definition: table_helper.h:1347
Status variable derived from SHOW_VAR.
Definition: pfs_variable.h:208
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
System variable derived from sys_var object.
Definition: pfs_variable.h:169
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:689
@ PFS_TL_READ_EXTERNAL
Definition: pfs_stat.h:701
@ PFS_TL_READ_NO_INSERT
Definition: pfs_stat.h:694
@ PFS_TL_WRITE_LOW_PRIORITY
Definition: pfs_stat.h:697
@ PFS_TL_READ
Definition: pfs_stat.h:691
@ PFS_TL_WRITE_EXTERNAL
Definition: pfs_stat.h:702
@ PFS_TL_READ_HIGH_PRIORITY
Definition: pfs_stat.h:693
@ PFS_TL_WRITE_ALLOW_WRITE
Definition: pfs_stat.h:695
@ PFS_TL_WRITE
Definition: pfs_stat.h:698
@ PFS_TL_READ_WITH_SHARED_LOCKS
Definition: pfs_stat.h:692
@ PFS_TL_WRITE_CONCURRENT_INSERT
Definition: pfs_stat.h:696
enum ha_rkey_function read_long(enum ha_rkey_function find_flag, bool &isnull, long *value)
Definition: pfs_engine_table.cc:1319
enum ha_rkey_function read_ulong(enum ha_rkey_function find_flag, bool &isnull, ulong *value)
Definition: pfs_engine_table.cc:1324
enum ha_rkey_function read_text_utf8(enum ha_rkey_function find_flag, bool &isnull, char *buffer, uint *buffer_length, uint buffer_capacity)
Definition: pfs_engine_table.cc:1421
enum ha_rkey_function read_varchar_utf8(enum ha_rkey_function find_flag, bool &isnull, char *buffer, uint *buffer_length, uint buffer_capacity)
Definition: pfs_engine_table.cc:1369
enum ha_rkey_function read_longlong(enum ha_rkey_function find_flag, bool &isnull, longlong *value)
Definition: pfs_engine_table.cc:1329
enum ha_rkey_function read_ulonglong(enum ha_rkey_function find_flag, bool &isnull, ulonglong *value)
Definition: pfs_engine_table.cc:1334
void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration)
Definition: table_helper.cc:1375
double get_field_double(Field *f)
Helper, read a value from a double field.
Definition: table_helper.cc:215
void set_field_float(Field *f, double value)
Helper, assign a value to a float field.
Definition: table_helper.cc:196
void set_field_varchar_utf8mb4(Field *f, const char *str)
Helper, assign a value to a.
Definition: table_helper.cc:269
ulonglong get_field_enum(Field *f)
Helper, read a value from an enum field.
Definition: table_helper.cc:313
void set_field_date(Field *f, const char *value, uint len)
Helper, assign a value to a date field.
Definition: table_helper.cc:333
char * get_field_timestamp(Field *f, char *val, uint *len)
Helper, read a value from an timestamp field.
Definition: table_helper.cc:390
void set_field_utiny(Field *f, ulong value)
Helper, assign a value to a unsigned tinyint field.
Definition: table_helper.cc:64
char * get_field_char_utf8mb4(Field *f, char *val, uint *len)
Helper, read a value from a.
Definition: table_helper.cc:235
void set_field_time(Field *f, const char *value, uint len)
Helper, assign a value to a time field.
Definition: table_helper.cc:350
char * get_field_blob(Field *f, char *val, uint *len)
Helper, read a value from a blob field.
Definition: table_helper.cc:296
void set_field_decimal(Field *f, double value)
Helper, assign a value to a decimal field.
Definition: table_helper.cc:183
void set_field_object_name(Field *f, const PFS_object_name *object)
Definition: table_helper.cc:469
long get_field_tiny(Field *f)
Helper, read a value from an tinyint field.
Definition: table_helper.cc:70
void set_field_ulong(Field *f, ulong value)
Helper, assign a value to a ulong field.
Definition: table_helper.cc:139
void set_field_enum(Field *f, ulonglong value)
Helper, assign a value to an enum field.
Definition: table_helper.cc:307
void make_source_column(const char *source_file, size_t source_line, char row_buffer[], size_t row_buffer_size, uint &row_length)
Create a SOURCE column from source file and line.
Definition: table_helper.cc:572
char * get_field_datetime(Field *f, char *val, uint *len)
Helper, read a value from an datetime field.
Definition: table_helper.cc:373
ulong get_field_ulong(Field *f)
Definition: table_helper.cc:151
void set_field_set(Field *f, ulonglong value)
Helper, assign a value to a set field.
Definition: table_helper.cc:320
void set_field_char_utf8mb4(Field *f, const char *str, uint len)
Helper, assign a value to a.
Definition: table_helper.cc:222
void set_field_xa_state(Field *f, enum_xa_transaction_state xa_state)
Definition: table_helper.cc:1509
void set_field_isolation_level(Field *f, enum_isolation_level iso_level)
Definition: table_helper.cc:1490
void set_field_blob(Field *f, const char *val, size_t len)
Helper, assign a value to a text/blob field.
Definition: table_helper.cc:282
void set_field_lock_type(Field *f, PFS_TL_LOCK_TYPE lock_type)
Definition: table_helper.cc:1290
char * get_field_time(Field *f, char *val, uint *len)
Helper, read a value from an time field.
Definition: table_helper.cc:356
void set_field_varchar(Field *f, const CHARSET_INFO *cs, const char *str, uint len)
Helper, assign a value to a.
Definition: table_helper.cc:246
long get_field_long(Field *f)
Helper, read a value from a long field.
Definition: table_helper.cc:145
void set_field_umedium(Field *f, ulong value)
Helper, assign a value to a unsigned medium field.
Definition: table_helper.cc:114
long get_field_medium(Field *f)
Helper, read a value from an mediumint field.
Definition: table_helper.cc:120
ulong get_field_utiny(Field *f)
Definition: table_helper.cc:76
void set_field_ushort(Field *f, ulong value)
Helper, assign a value to a unsigned short field.
Definition: table_helper.cc:89
void set_field_longlong(Field *f, longlong value)
Helper, assign a value to a longlong field.
Definition: table_helper.cc:158
long get_field_short(Field *f)
Helper, read a value from an smallint field.
Definition: table_helper.cc:95
void set_field_mdl_status(Field *f, opaque_mdl_status mdl_status)
Definition: table_helper.cc:1396
void set_field_year(Field *f, ulong value)
Helper, assign a value to a year field.
Definition: table_helper.cc:409
void set_nullable_field_object_name(Field *f, const PFS_object_name *object)
Definition: table_helper.cc:459
void set_field_double(Field *f, double value)
Helper, assign a value to a double field.
Definition: table_helper.cc:209
void set_field_mdl_type(Field *f, opaque_mdl_type mdl_type)
Definition: table_helper.cc:1330
longlong get_field_longlong(Field *f)
Definition: table_helper.cc:170
void set_nullable_field_schema_name(Field *f, const PFS_schema_name *schema)
Definition: table_helper.cc:428
void set_field_datetime(Field *f, const char *value, uint len)
Helper, assign a value to a datetime field.
Definition: table_helper.cc:367
ulong get_field_ushort(Field *f)
Definition: table_helper.cc:101
void set_field_ulonglong(Field *f, ulonglong value)
Helper, assign a value to a ulonglong field.
Definition: table_helper.cc:164
void set_field_schema_name(Field *f, const PFS_schema_name *schema)
Definition: table_helper.cc:438
double get_field_float(Field *f)
Helper, read a value from a float field.
Definition: table_helper.cc:202
ulong get_field_umedium(Field *f)
Definition: table_helper.cc:126
void format_sqltext(const char *source_sqltext, size_t source_length, const CHARSET_INFO *source_cs, bool truncated, String &sqltext)
Helper, format sql text for output.
Definition: table_helper.cc:535
void set_field_routine_name(Field *f, const PFS_routine_name *object)
Definition: table_helper.cc:500
void set_field_json(Field *f, const Json_wrapper *json)
Helper, assign a value to a JSON field.
Definition: table_helper.cc:422
void set_field_tiny(Field *f, long value)
Helper, assign a value to a tinyint field.
Definition: table_helper.cc:58
void set_field_short(Field *f, long value)
Helper, assign a value to a short field.
Definition: table_helper.cc:83
ulong get_field_year(Field *f)
Helper, read a value from an year field.
Definition: table_helper.cc:415
void set_field_long(Field *f, long value)
Helper, assign a value to a long field.
Definition: table_helper.cc:133
void set_nullable_field_routine_name(Field *f, const PFS_routine_name *object)
Definition: table_helper.cc:490
char * get_field_date(Field *f, char *val, uint *len)
Helper, read a value from an date field.
Definition: table_helper.cc:339
void set_field_timestamp(Field *f, ulonglong value)
Helper, assign a value to a timestamp field.
Definition: table_helper.cc:400
void set_field_object_type(Field *f, enum_object_type object_type)
Definition: table_helper.cc:1283
String * get_field_varchar_utf8mb4(Field *f, String *val)
Helper, read a value from a.
Definition: table_helper.cc:253
ulonglong get_field_ulonglong(Field *f)
Helper, read a value from an ulonglong field.
Definition: table_helper.cc:176
void set_field_medium(Field *f, long value)
Helper, assign a value to a medium field.
Definition: table_helper.cc:108
void set_field_text(Field *f, const char *val, size_t len, const CHARSET_INFO *cs)
Helper, assign a value to a text field.
Definition: table_helper.cc:289
ulonglong get_field_set(Field *f)
Helper, read a value from a set field.
Definition: table_helper.cc:326
double get_field_decimal(Field *f)
Helper, read a value from a decimal field.
Definition: table_helper.cc:189
int opaque_mdl_duration
Definition: psi_mdl_bits.h:42
int opaque_mdl_status
Definition: psi_mdl_bits.h:45
int opaque_mdl_type
Definition: psi_mdl_bits.h:36
@ HA_KEYTYPE_TEXT
Definition: my_base.h:441
ha_rkey_function
Definition: my_base.h:78
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
long long int longlong
Definition: my_inttypes.h:55
static my_thread_id thread_id
Definition: my_thr_init.cc:63
#define NAME_LEN
Definition: mysql_com.h:67
#define NAME_CHAR_LEN
Field/table name length.
Definition: mysql_com.h:60
#define FILENAME_CHARSET_MBMAXLEN
Definition: mysql_com.h:59
const char * host
Definition: mysqladmin.cc:59
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
Definition: commit_order_queue.h:34
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:76
Data types for columns used in the performance schema tables (declarations)
enum_isolation_level
Enum values for transaction isolation level columns.
Definition: pfs_column_types.h:324
enum_xa_transaction_state
Enum values for XA transaction state columns.
Definition: pfs_column_types.h:304
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:222
@ NO_OBJECT_TYPE
Definition: pfs_column_types.h:223
Statement Digest data structures (declarations).
Performance schema tables (declarations).
Events data structures (declarations).
Performance schema instruments metadata (declarations).
Object names (declarations).
Performance schema setup actors (declarations).
Statistics (declarations).
Performance schema timers (declarations).
#define NANOSEC_TO_PICOSEC
Conversion factor, from nano seconds to pico seconds.
Definition: pfs_timer.h:43
#define MICROSEC_TO_PICOSEC
Conversion factor, from micro seconds to pico seconds.
Definition: pfs_timer.h:40
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
#define DIGEST_HASH_TO_STRING_LENGTH
SHA-256 = 32 bytes of binary = 64 printable characters.
Definition: sql_digest.h:54
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
case opt name
Definition: sslopt-case.h:33
Constants and functionality that facilitate working with digests.
Definition: m_ctype.h:385
Metadata lock object key.
Definition: mdl.h:365
Definition: mysql_lex_string.h:40
const char * str
Definition: mysql_lex_string.h:41
size_t length
Definition: mysql_lex_string.h:42
Definition: mysql_lex_string.h:35
Row fragment for columns USER, HOST.
Definition: table_helper.h:551
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:624
PFS_user_name m_user_name
Column USER.
Definition: table_helper.h:553
PFS_host_name m_host_name
Column HOST.
Definition: table_helper.h:555
int make_row(PFS_account *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:618
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:638
Per account statistics.
Definition: pfs_account.h:67
Row fragment for timer and byte count stats.
Definition: table_helper.h:750
void set(time_normalizer *normalizer, const PFS_byte_stat *stat)
Build a row with timer and byte count fields from a memory buffer.
Definition: table_helper.h:755
ulonglong m_bytes
Definition: table_helper.h:752
PFS_stat_row m_waits
Definition: table_helper.h:751
Combined statistic.
Definition: pfs_stat.h:130
ulonglong m_bytes
Byte count statistics.
Definition: pfs_stat.h:132
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, COLUMN_NAME.
Definition: table_helper.h:634
char m_column_name[NAME_LEN]
Column OBJECT_NAME.
Definition: table_helper.h:646
char m_schema_name[NAME_LEN]
Column SCHEMA_NAME.
Definition: table_helper.h:638
size_t m_column_name_length
Length in bytes of m_column_name.
Definition: table_helper.h:648
void set_nullable_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:944
size_t m_schema_name_length
Length in bytes of m_schema_name.
Definition: table_helper.h:640
size_t m_object_name_length
Length in bytes of m_object_name.
Definition: table_helper.h:644
char m_object_name[NAME_LEN]
Column OBJECT_NAME.
Definition: table_helper.h:642
int make_row(const MDL_key *mdl)
Build a row from a memory buffer.
Definition: table_helper.cc:735
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:636
Instrumented condition implementation.
Definition: pfs_instr.h:160
Row fragment for connection statistics.
Definition: table_helper.h:1027
PFS_connection_stat m_stat
Definition: table_helper.h:1028
void set(const PFS_connection_stat *stat)
Definition: table_helper.h:1030
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1263
Connections statistics.
Definition: pfs_stat.h:1227
Row fragment for columns DIGEST, DIGEST_TEXT.
Definition: table_helper.h:565
char m_digest[DIGEST_HASH_TO_STRING_LENGTH+1]
Column DIGEST.
Definition: table_helper.h:569
uint m_digest_length
Length in bytes of m_digest.
Definition: table_helper.h:571
int make_row(PFS_statements_digest_stat *)
Build a row from a memory buffer.
Definition: table_helper.cc:652
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:567
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:689
String m_digest_text
Column DIGEST_TEXT.
Definition: table_helper.h:573
Statistics for a server error.
Definition: pfs_stat.h:495
ulonglong m_last_seen
Definition: pfs_stat.h:500
ulonglong m_count
Definition: pfs_stat.h:496
ulonglong m_handled_count
Definition: pfs_stat.h:497
ulonglong m_first_seen
First and last seen timestamps.
Definition: pfs_stat.h:499
Row fragment for error statistics columns.
Definition: table_helper.h:1006
uint m_error_index
Definition: table_helper.h:1009
ulonglong m_last_seen
Definition: table_helper.h:1011
ulonglong m_count
Definition: table_helper.h:1007
void set(const PFS_error_single_stat *stat, uint error_index)
Build a row from a memory buffer.
Definition: table_helper.h:1014
ulonglong m_first_seen
Definition: table_helper.h:1010
void set_field(uint index, Field *f, server_error *temp_error)
Set a table field from the row.
Definition: table_helper.cc:1207
ulonglong m_handled_count
Definition: table_helper.h:1008
Row fragment for column EVENT_NAME.
Definition: table_helper.h:582
int make_row(PFS_instr_class *pfs)
Build a row from a memory buffer.
Definition: table_helper.h:589
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.h:596
uint m_name_length
Length in bytes of m_name.
Definition: table_helper.h:586
const char * m_name
Column EVENT_NAME.
Definition: table_helper.h:584
A wait event record.
Definition: pfs_events_waits.h:69
An event record.
Definition: pfs_events.h:38
Row fragment for file I/O statistics columns.
Definition: table_helper.h:1068
PFS_byte_stat_row m_write
Definition: table_helper.h:1070
void set(time_normalizer *normalizer, const PFS_file_io_stat *stat)
Definition: table_helper.h:1074
PFS_byte_stat_row m_all
Definition: table_helper.h:1072
PFS_byte_stat_row m_misc
Definition: table_helper.h:1071
PFS_byte_stat_row m_read
Definition: table_helper.h:1069
Statistics for FILE I/O.
Definition: pfs_stat.h:272
PFS_byte_stat m_read
READ statistics.
Definition: pfs_stat.h:274
PFS_byte_stat m_write
WRITE statistics.
Definition: pfs_stat.h:276
PFS_byte_stat m_misc
Miscellaneous statistics.
Definition: pfs_stat.h:278
Instrumented File and FILE implementation.
Definition: pfs_instr.h:177
Definition: pfs_name.h:514
Row fragment for column HOST.
Definition: table_helper.h:527
void set_nullable_field(Field *f)
Definition: table_helper.cc:603
int make_row(PFS_host *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:596
PFS_host_name m_host_name
Column HOST.
Definition: table_helper.h:529
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:601
Per host statistics.
Definition: pfs_host.h:64
Definition: pfs_name.h:449
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:659
PFS_object_row m_object_row
Definition: table_helper.h:660
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1018
size_t m_index_name_length
Length in bytes of m_index_name.
Definition: table_helper.h:664
int make_row(PFS_table_share *pfs, PFS_table_share_index *pfs_index, uint table_index)
Definition: table_helper.cc:1004
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:1037
int make_index_name(PFS_table_share_index *pfs_index, uint table_index)
Build a row from a memory buffer.
Definition: table_helper.cc:979
char m_index_name[NAME_LEN]
Column INDEX_NAME.
Definition: table_helper.h:662
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:678
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:1075
PFS_object_view_row m_object_row
Definition: table_helper.h:679
PFS_index_name_view m_index_name
Definition: table_helper.h:680
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1056
Information for all instrumentation.
Definition: pfs_instr_class.h:205
Name space, internal views used within table setup_instruments.
Definition: table_helper.h:489
static const uint VIEW_IDLE
Definition: table_helper.h:499
static const uint FIRST_INSTRUMENT
Definition: table_helper.h:490
static const uint VIEW_TRANSACTION
Definition: table_helper.h:510
static const uint LAST_VIEW
Definition: table_helper.h:501
static const uint VIEW_COND
Definition: table_helper.h:495
static const uint VIEW_MEMORY
Definition: table_helper.h:512
static const uint FIRST_VIEW
Definition: table_helper.h:492
static const uint VIEW_BUILTIN_MEMORY
Definition: table_helper.h:511
static const uint VIEW_ERROR
Definition: table_helper.h:513
static const uint VIEW_STAGE
Definition: table_helper.h:508
static const uint VIEW_METADATA
Definition: table_helper.h:500
static const uint VIEW_SOCKET
Definition: table_helper.h:498
static const uint VIEW_TABLE
Definition: table_helper.h:497
static const uint VIEW_RWLOCK
Definition: table_helper.h:494
static const uint VIEW_MUTEX
Definition: table_helper.h:493
static const uint LAST_INSTRUMENT
Definition: table_helper.h:515
static const uint VIEW_STATEMENT
Definition: table_helper.h:509
static const uint VIEW_FILE
Definition: table_helper.h:496
PFS_key_reader: Convert key into internal format.
Definition: pfs_engine_table.h:196
ha_base_keytype get_key_type()
Definition: pfs_engine_table.h:251
Definition: pfs_stat.h:991
Row fragment for memory statistics columns.
Definition: table_helper.h:1091
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1416
PFS_memory_monitoring_stat m_stat
Definition: table_helper.h:1092
void set(const PFS_memory_monitoring_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:1095
Instrumented metadata lock implementation.
Definition: pfs_instr.h:316
Instrumented mutex implementation.
Definition: pfs_instr.h:101
Definition: pfs_name.h:378
Definition: pfs_name.h:336
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_helper.h:602
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:888
int make_row(PFS_table_share *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:719
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:872
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:606
PFS_object_name m_object_name
Column OBJECT_NAME.
Definition: table_helper.h:608
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:604
Name space, internal views used within object summaries.
Definition: table_helper.h:519
static const uint LAST_VIEW
Definition: table_helper.h:523
static const uint FIRST_VIEW
Definition: table_helper.h:520
static const uint VIEW_TABLE
Definition: table_helper.h:521
static const uint VIEW_PROGRAM
Definition: table_helper.h:522
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_helper.h:619
PFS_object_name_view m_object_name
Column OBJECT_NAME.
Definition: table_helper.h:625
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:908
PFS_schema_name_view m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:623
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:621
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:924
Definition: pfs_prepared_stmt.h:42
Definition: pfs_program.h:57
Definition: pfs_name.h:285
Instrumented rwlock implementation.
Definition: pfs_instr.h:127
Definition: pfs_name.h:213
Definition: pfs_name.h:186
Definition: table_helper.h:1101
size_t m_total_size
Definition: table_helper.h:1104
size_t m_max_total_size
Definition: table_helper.h:1105
void set(const PFS_session_all_memory_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.cc:1462
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1470
size_t m_controlled_size
Definition: table_helper.h:1102
size_t m_max_controlled_size
Definition: table_helper.h:1103
Definition: pfs_stat.h:1136
A setup_actor record.
Definition: pfs_setup_actor.h:59
A setup_object record.
Definition: pfs_setup_object.h:58
Single statistic.
Definition: pfs_stat.h:52
void aggregate(const PFS_single_stat *stat)
Definition: pfs_stat.h:78
ulonglong m_count
Count of values.
Definition: pfs_stat.h:54
ulonglong m_max
Maximum value.
Definition: pfs_stat.h:60
ulonglong m_min
Minimum value.
Definition: pfs_stat.h:58
bool has_timed_stats() const
Definition: pfs_stat.h:76
ulonglong m_sum
Sum of values.
Definition: pfs_stat.h:56
Row fragment for socket I/O statistics columns.
Definition: table_helper.h:1045
PFS_byte_stat_row m_all
Definition: table_helper.h:1049
PFS_byte_stat_row m_misc
Definition: table_helper.h:1048
PFS_byte_stat_row m_read
Definition: table_helper.h:1046
void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat)
Definition: table_helper.h:1051
PFS_byte_stat_row m_write
Definition: table_helper.h:1047
Statistics for SOCKET I/O.
Definition: pfs_stat.h:839
PFS_byte_stat m_read
READ statistics.
Definition: pfs_stat.h:841
PFS_byte_stat m_misc
Miscellaneous statistics.
Definition: pfs_stat.h:845
PFS_byte_stat m_write
WRITE statistics.
Definition: pfs_stat.h:843
Instrumented socket implementation.
Definition: pfs_instr.h:287
Row fragment for stored program statistics.
Definition: table_helper.h:965
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:974
void set(time_normalizer *normalizer, const PFS_sp_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:969
PFS_stat_row m_timer1_row
Definition: table_helper.h:966
Statistics for stored program usage.
Definition: pfs_stat.h:340
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:341
Row fragment for stage statistics columns.
Definition: table_helper.h:860
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:869
PFS_stat_row m_timer1_row
Definition: table_helper.h:861
void set(time_normalizer *normalizer, const PFS_stage_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:864
Statistics for stage usage.
Definition: pfs_stat.h:323
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:324
Row fragment for single statistics columns (COUNT, SUM, MIN, AVG, MAX)
Definition: table_helper.h:688
ulonglong m_max
Column MAX_TIMER_WAIT.
Definition: table_helper.h:698
ulonglong m_count
Column COUNT_STAR.
Definition: table_helper.h:690
ulonglong m_avg
Column AVG_TIMER_WAIT.
Definition: table_helper.h:696
void set(time_normalizer *normalizer, const PFS_single_stat *stat)
Build a row with timer fields from a memory buffer.
Definition: table_helper.h:709
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:726
ulonglong m_sum
Column SUM_TIMER_WAIT.
Definition: table_helper.h:692
void reset()
Definition: table_helper.h:700
ulonglong m_min
Column MIN_TIMER_WAIT.
Definition: table_helper.h:694
Row fragment for statement statistics columns.
Definition: table_helper.h:873
ulonglong m_rows_affected
Definition: table_helper.h:877
ulonglong m_max_controlled_memory
Definition: table_helper.h:899
ulonglong m_max_total_memory
Definition: table_helper.h:900
ulonglong m_select_full_range_join
Definition: table_helper.h:884
ulonglong m_no_good_index_used
Definition: table_helper.h:893
ulonglong m_sort_scan
Definition: table_helper.h:891
void set(time_normalizer *normalizer, const PFS_statement_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:904
ulonglong m_count_secondary
Definition: table_helper.h:901
ulonglong m_rows_examined
Definition: table_helper.h:880
ulonglong m_cpu_time
CPU TIME.
Definition: table_helper.h:898
ulonglong m_select_scan
Definition: table_helper.h:887
ulonglong m_sort_rows
Definition: table_helper.h:890
ulonglong m_error_count
Definition: table_helper.h:875
ulonglong m_select_full_join
Definition: table_helper.h:883
ulonglong m_created_tmp_disk_tables
Definition: table_helper.h:881
ulonglong m_sort_range
Definition: table_helper.h:889
ulonglong m_lock_time
Definition: table_helper.h:878
ulonglong m_warning_count
Definition: table_helper.h:876
ulonglong m_no_index_used
Definition: table_helper.h:892
ulonglong m_sort_merge_passes
Definition: table_helper.h:888
ulonglong m_select_range_check
Definition: table_helper.h:886
ulonglong m_created_tmp_tables
Definition: table_helper.h:882
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1094
ulonglong m_rows_sent
Definition: table_helper.h:879
ulonglong m_select_range
Definition: table_helper.h:885
PFS_stat_row m_timer1_row
Definition: table_helper.h:874
Statistics for statement usage.
Definition: pfs_stat.h:376
ulonglong m_max_total_memory
Definition: pfs_stat.h:403
ulonglong m_sort_range
Definition: pfs_stat.h:392
ulonglong m_select_range_check
Definition: pfs_stat.h:389
ulonglong m_select_scan
Definition: pfs_stat.h:390
ulonglong m_no_good_index_used
Definition: pfs_stat.h:396
ulonglong m_sort_rows
Definition: pfs_stat.h:393
ulonglong m_lock_time
Definition: pfs_stat.h:381
ulonglong m_created_tmp_disk_tables
Definition: pfs_stat.h:384
ulonglong m_max_controlled_memory
Definition: pfs_stat.h:402
ulonglong m_select_range
Definition: pfs_stat.h:388
ulonglong m_cpu_time
CPU TIME.
Definition: pfs_stat.h:401
ulonglong m_count_secondary
Definition: pfs_stat.h:404
ulonglong m_sort_scan
Definition: pfs_stat.h:394
ulonglong m_select_full_range_join
Definition: pfs_stat.h:387
ulonglong m_select_full_join
Definition: pfs_stat.h:386
ulonglong m_rows_examined
Definition: pfs_stat.h:383
ulonglong m_warning_count
Definition: pfs_stat.h:379
ulonglong m_rows_affected
Definition: pfs_stat.h:380
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:377
ulonglong m_created_tmp_tables
Definition: pfs_stat.h:385
ulonglong m_error_count
Definition: pfs_stat.h:378
ulonglong m_no_index_used
Definition: pfs_stat.h:395
ulonglong m_sort_merge_passes
Definition: pfs_stat.h:391
ulonglong m_rows_sent
Definition: pfs_stat.h:382
A statement digest stat record.
Definition: pfs_digest.h:59
Row fragment for table I/O statistics columns.
Definition: table_helper.h:762
PFS_stat_row m_all_write
Definition: table_helper.h:765
PFS_stat_row m_fetch
Definition: table_helper.h:766
PFS_stat_row m_all
Definition: table_helper.h:763
PFS_stat_row m_delete
Definition: table_helper.h:769
PFS_stat_row m_update
Definition: table_helper.h:768
PFS_stat_row m_all_read
Definition: table_helper.h:764
PFS_stat_row m_insert
Definition: table_helper.h:767
void set(time_normalizer *normalizer, const PFS_table_io_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:772
Single table I/O statistic.
Definition: pfs_stat.h:648
PFS_single_stat m_insert
INSERT statistics.
Definition: pfs_stat.h:653
PFS_single_stat m_fetch
FETCH statistics.
Definition: pfs_stat.h:651
PFS_single_stat m_delete
DELETE statistics.
Definition: pfs_stat.h:657
PFS_single_stat m_update
UPDATE statistics.
Definition: pfs_stat.h:655
Row fragment for table lock statistics columns.
Definition: table_helper.h:799
PFS_stat_row m_write_concurrent_insert
Definition: table_helper.h:809
PFS_stat_row m_read_with_shared_locks
Definition: table_helper.h:804
PFS_stat_row m_all_read
Definition: table_helper.h:801
PFS_stat_row m_all_write
Definition: table_helper.h:802
PFS_stat_row m_write_low_priority
Definition: table_helper.h:810
PFS_stat_row m_read_external
Definition: table_helper.h:807
PFS_stat_row m_read_high_priority
Definition: table_helper.h:805
PFS_stat_row m_read_no_insert
Definition: table_helper.h:806
PFS_stat_row m_write_normal
Definition: table_helper.h:811
PFS_stat_row m_read_normal
Definition: table_helper.h:803
void set(time_normalizer *normalizer, const PFS_table_lock_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:815
PFS_stat_row m_write_allow_write
Definition: table_helper.h:808
PFS_stat_row m_all
Definition: table_helper.h:800
PFS_stat_row m_write_external
Definition: table_helper.h:812
Statistics for table locks.
Definition: pfs_stat.h:710
PFS_single_stat m_stat[COUNT_PFS_TL_LOCK_TYPE]
Definition: pfs_stat.h:711
Index statistics of a table.
Definition: pfs_instr_class.h:385
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:409
Instrumented table implementation.
Definition: pfs_instr.h:193
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:353
Instrumented thread implementation.
Definition: pfs_instr.h:373
Row fragment for transaction statistics columns.
Definition: table_helper.h:980
PFS_stat_row m_read_write_row
Definition: table_helper.h:982
ulonglong m_savepoint_count
Definition: table_helper.h:984
PFS_stat_row m_timer1_row
Definition: table_helper.h:981
PFS_stat_row m_read_only_row
Definition: table_helper.h:983
ulonglong m_release_savepoint_count
Definition: table_helper.h:986
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1178
ulonglong m_rollback_to_savepoint_count
Definition: table_helper.h:985
void set(time_normalizer *normalizer, const PFS_transaction_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:989
Statistics for transaction usage.
Definition: pfs_stat.h:459
PFS_single_stat m_read_write_stat
Definition: pfs_stat.h:460
PFS_single_stat m_read_only_stat
Definition: pfs_stat.h:461
Definition: pfs_name.h:470
Row fragment for column USER.
Definition: table_helper.h:539
PFS_user_name m_user_name
Column USER.
Definition: table_helper.h:541
void set_nullable_field(Field *f)
Definition: table_helper.cc:614
int make_row(PFS_user *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:607
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:612
Definition: table_helper.h:1149
int make_row(const char *val, size_t length)
Definition: table_helper.cc:1579
PFS_user_variable_value_row()
Definition: table_helper.h:1151
void clear()
Definition: table_helper.cc:1573
size_t m_value_length
Definition: table_helper.h:1169
PFS_user_variable_value_row(const PFS_user_variable_value_row &rhs)
Definition: table_helper.h:1153
char * m_value
Definition: table_helper.h:1168
const char * get_value() const
Definition: table_helper.h:1161
size_t get_value_length() const
Definition: table_helper.h:1163
~PFS_user_variable_value_row()
Definition: table_helper.h:1157
Per user statistics.
Definition: pfs_user.h:63
Definition: table_helper.h:1114
PFS_variable_name_row()
Definition: table_helper.h:1116
char m_str[NAME_CHAR_LEN+1]
Definition: table_helper.h:1123
int make_row(const char *str, size_t length)
Definition: table_helper.cc:1534
uint m_length
Definition: table_helper.h:1124
Definition: table_helper.h:1127
const CHARSET_INFO * m_charset
Definition: table_helper.h:1146
uint get_length() const
Definition: table_helper.h:1139
int make_row(const Status_variable *var)
Set the row from a status variable.
Definition: table_helper.cc:1548
char m_str[1024]
Definition: table_helper.h:1144
const char * get_str() const
Definition: table_helper.h:1138
uint m_length
Definition: table_helper.h:1145
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:1569
Definition: table_uvar_by_thread.h:56
A record describing an error message.
Definition: derror.h:39
A time normalizer.
Definition: pfs_timer.h:119
ulonglong wait_to_pico(ulonglong wait) const
Convert a wait from timer units to pico seconds.
Definition: pfs_timer.h:142
unsigned int uint
Definition: uca9-dump.cc:75
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:871