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