MySQL 9.6.0
Source Code Documentation
table_helper.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2025, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, 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*/
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*/
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*/
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*/
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
366void set_field_date_by_daynr(Field *f, ulong daynr);
367
368/**
369 Helper, read a value from an @c date field.
370 @param f the field to read
371 @param[out] val the field value
372 @param[out] len field value length
373 @return the field value
374*/
375char *get_field_date(Field *f, char *val, uint *len);
376
377/**
378 Helper, assign a value to a @c time field.
379 @param f the field to set
380 @param value the value to assign
381 @param len length of the value
382*/
383void set_field_time(Field *f, const char *value, uint len);
384
385/**
386 Helper, read a value from an @c time field.
387 @param f the field to read
388 @param[out] val the field value
389 @param[out] len field value length
390 @return the field value
391*/
392char *get_field_time(Field *f, char *val, uint *len);
393
394/**
395 Helper, assign a value to a @c datetime field.
396 @param f the field to set
397 @param value the value to assign
398 @param len length of the value
399*/
400void set_field_datetime(Field *f, const char *value, uint len);
401
402/**
403 Helper, read a value from an @c datetime field.
404 @param f the field to read
405 @param[out] val the field value
406 @param[out] len field value length
407 @return the field value
408*/
409char *get_field_datetime(Field *f, char *val, uint *len);
410
411/**
412 Helper, assign a value to a @c timestamp field.
413 @param f the field to set
414 @param value the value to assign
415*/
417
418/**
419 Helper, assign a value to a @c timestamp field.
420 @param f the field to set
421 @param value the value to assign
422 @param len length of the value
423*/
424void set_field_timestamp(Field *f, const char *value, uint len);
425
426/**
427 Helper, read a value from an @c timestamp field.
428 @param f the field to read
429 @param[out] val the field value
430 @param[out] len field value length
431 @return the field value
432*/
433char *get_field_timestamp(Field *f, char *val, uint *len);
434
435/**
436 Helper, assign a value to a @c year field.
437 @param f the field to set
438 @param value the value to assign
439*/
440void set_field_year(Field *f, ulong value);
441
442/**
443 Helper, read a value from an @c year field.
444 @param f the field to read
445 @return the field value
446*/
447ulong get_field_year(Field *f);
448
449/**
450 Helper, assign a value to a JSON field.
451 @param f the field to set
452 @param json the value to assign
453*/
454void set_field_json(Field *f, const Json_wrapper *json);
455
457void set_field_schema_name(Field *f, const PFS_schema_name *schema);
458
460void set_field_object_name(Field *f, const PFS_object_name *object);
461
463void set_field_routine_name(Field *f, const PFS_routine_name *object);
464
465/**
466 Helper, format sql text for output.
467
468 @param source_sqltext raw sqltext, possibly truncated
469 @param source_length length of source_sqltext
470 @param source_cs character set of source_sqltext
471 @param truncated true if source_sqltext was truncated
472 @param sqltext sqltext formatted for output
473 */
474void format_sqltext(const char *source_sqltext, size_t source_length,
475 const CHARSET_INFO *source_cs, bool truncated,
476 String &sqltext);
477
478/**
479 Create a SOURCE column from source file and line.
480
481 @param source_file source file name pointer from __FILE__
482 @param source_line line number
483 @param row_buffer target string buffer
484 @param row_buffer_size size of target buffer
485 @param row_length string length of combined source file and line
486*/
487void make_source_column(const char *source_file, size_t source_line,
488 char row_buffer[], size_t row_buffer_size,
489 uint &row_length);
490
491/** Name space, internal views used within table setup_instruments. */
493 static const uint FIRST_INSTRUMENT = 1;
494
495 static const uint FIRST_VIEW = 1;
496 static const uint VIEW_MUTEX = 1;
497 static const uint VIEW_RWLOCK = 2;
498 static const uint VIEW_COND = 3;
499 static const uint VIEW_FILE = 4;
500 static const uint VIEW_TABLE = 5;
501 static const uint VIEW_SOCKET = 6;
502 static const uint VIEW_IDLE = 7;
503 static const uint VIEW_METADATA = 8;
504 static const uint LAST_VIEW = 8;
505
506 /*
507 THREAD are displayed in table setup_threads
508 instead of setup_instruments.
509 */
510
511 static const uint VIEW_STAGE = 9;
512 static const uint VIEW_STATEMENT = 10;
513 static const uint VIEW_TRANSACTION = 11;
514 static const uint VIEW_BUILTIN_MEMORY = 12;
515 static const uint VIEW_MEMORY = 13;
516 static const uint VIEW_ERROR = 14;
517
518 static const uint LAST_INSTRUMENT = 14;
519};
520
521/** Name space, internal views used within object summaries. */
523 static const uint FIRST_VIEW = 1;
524 static const uint VIEW_TABLE = 1;
525 static const uint VIEW_PROGRAM = 2;
526 static const uint LAST_VIEW = 2;
527};
528
529/** Row fragment for column HOST. */
531 /** Column HOST. */
533
534 /** Build a row from a memory buffer. */
535 int make_row(PFS_host *pfs);
536 /** Set a table field from the row. */
537 void set_field(Field *f);
538 void set_nullable_field(Field *f);
539};
540
541/** Row fragment for column USER. */
543 /** Column USER. */
545
546 /** Build a row from a memory buffer. */
547 int make_row(PFS_user *pfs);
548 /** Set a table field from the row. */
549 void set_field(Field *f);
550 void set_nullable_field(Field *f);
551};
552
553/** Row fragment for columns USER, HOST. */
555 /** Column USER. */
557 /** Column HOST. */
559
560 /** Build a row from a memory buffer. */
562 /** Set a table field from the row. */
563 void set_field(uint index, Field *f);
564 void set_nullable_field(uint index, Field *f);
565};
566
567/** Row fragment for columns DIGEST, DIGEST_TEXT. */
569 /** Column SCHEMA_NAME. */
571 /** Column DIGEST. */
573 /** Length in bytes of @c m_digest. */
575 /** Column DIGEST_TEXT. */
577
578 /** Build a row from a memory buffer. */
580 /** Set a table field from the row. */
581 void set_field(uint index, Field *f);
582};
583
584/** Row fragment for column EVENT_NAME. */
586 /** Column EVENT_NAME. */
587 const char *m_name;
588 /** Length in bytes of @c m_name. */
590
591 /** Build a row from a memory buffer. */
593 m_name = pfs->m_name.str();
594 m_name_length = pfs->m_name.length();
595 return 0;
596 }
597
598 /** Set a table field from the row. */
599 inline void set_field(Field *f) {
601 }
602};
603
604/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
606 /** Column OBJECT_TYPE. */
608 /** Column SCHEMA_NAME. */
610 /** Column OBJECT_NAME. */
612
613 /** Build a row from a memory buffer. */
616 /** Set a table field from the row. */
617 void set_field(uint index, Field *f);
618 void set_nullable_field(uint index, Field *f);
619};
620
621/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
623 /** Column OBJECT_TYPE. */
625 /** Column SCHEMA_NAME. */
627 /** Column OBJECT_NAME. */
629
630 /** Set a table field from the row. */
631 void set_field(uint index, Field *f);
632 void set_nullable_field(uint index, Field *f);
633};
634
635/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, COLUMN_NAME.
636 */
638 /** Column OBJECT_TYPE. */
640 /** Column SCHEMA_NAME. */
642 /** Length in bytes of @c m_schema_name. */
644 /** Column OBJECT_NAME. */
646 /** Length in bytes of @c m_object_name. */
648 /** Column OBJECT_NAME. */
650 /** Length in bytes of @c m_column_name. */
652
653 /** Build a row from a memory buffer. */
654 int make_row(const MDL_key *mdl);
655 /** Set a table field from the row. */
656 void set_nullable_field(uint index, Field *f);
657};
658
659/**
660 Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
661 */
664 /** Column INDEX_NAME. */
666 /** Length in bytes of @c m_index_name. */
668
669 /** Build a row from a memory buffer. */
670 int make_index_name(PFS_table_share_index *pfs_index, uint table_index);
672 uint table_index);
673 /** Set a table field from the row. */
674 void set_field(uint index, Field *f);
675 void set_nullable_field(uint index, Field *f);
676};
677
678/**
679 Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
680 */
684
685 /** Set a table field from the row. */
686 void set_field(uint index, Field *f);
687 void set_nullable_field(uint index, Field *f);
688};
689
690/** Row fragment for single statistics columns (COUNT, SUM, MIN, AVG, MAX) */
692 /** Column COUNT_STAR. */
694 /** Column SUM_TIMER_WAIT. */
696 /** Column MIN_TIMER_WAIT. */
698 /** Column AVG_TIMER_WAIT. */
700 /** Column MAX_TIMER_WAIT. */
702
703 inline void reset() {
704 m_count = 0;
705 m_sum = 0;
706 m_min = 0;
707 m_avg = 0;
708 m_max = 0;
709 }
710
711 /** Build a row with timer fields from a memory buffer. */
712 inline void set(time_normalizer *normalizer, const PFS_single_stat *stat) {
713 m_count = stat->m_count;
714
715 if ((m_count != 0) && stat->has_timed_stats()) {
716 m_sum = normalizer->wait_to_pico(stat->m_sum);
717 m_min = normalizer->wait_to_pico(stat->m_min);
718 m_max = normalizer->wait_to_pico(stat->m_max);
719 m_avg = normalizer->wait_to_pico(stat->m_sum / m_count);
720 } else {
721 m_sum = 0;
722 m_min = 0;
723 m_avg = 0;
724 m_max = 0;
725 }
726 }
727
728 /** Set a table field from the row. */
729 void set_field(uint index, Field *f) {
730 switch (index) {
731 case 0: /* COUNT */
733 break;
734 case 1: /* SUM */
736 break;
737 case 2: /* MIN */
739 break;
740 case 3: /* AVG */
742 break;
743 case 4: /* MAX */
745 break;
746 default:
747 assert(false);
748 }
749 }
750};
751
752/** Row fragment for timer and byte count stats. Corresponds to PFS_byte_stat */
756
757 /** Build a row with timer and byte count fields from a memory buffer. */
758 inline void set(time_normalizer *normalizer, const PFS_byte_stat *stat) {
759 m_waits.set(normalizer, stat);
760 m_bytes = stat->m_bytes;
761 }
762};
763
764/** Row fragment for table I/O statistics columns. */
773
774 /** Build a row from a memory buffer. */
775 inline void set(time_normalizer *normalizer, const PFS_table_io_stat *stat) {
776 PFS_single_stat all_read;
777 PFS_single_stat all_write;
779
780 m_fetch.set(normalizer, &stat->m_fetch);
781
782 all_read.aggregate(&stat->m_fetch);
783
784 m_insert.set(normalizer, &stat->m_insert);
785 m_update.set(normalizer, &stat->m_update);
786 m_delete.set(normalizer, &stat->m_delete);
787
788 all_write.aggregate(&stat->m_insert);
789 all_write.aggregate(&stat->m_update);
790 all_write.aggregate(&stat->m_delete);
791
792 all.aggregate(&all_read);
793 all.aggregate(&all_write);
794
795 m_all_read.set(normalizer, &all_read);
796 m_all_write.set(normalizer, &all_write);
797 m_all.set(normalizer, &all);
798 }
799};
800
801/** Row fragment for table lock statistics columns. */
816
817 /** Build a row from a memory buffer. */
818 inline void set(time_normalizer *normalizer,
819 const PFS_table_lock_stat *stat) {
820 PFS_single_stat all_read;
821 PFS_single_stat all_write;
823
824 m_read_normal.set(normalizer, &stat->m_stat[PFS_TL_READ]);
825 m_read_with_shared_locks.set(normalizer,
827 m_read_high_priority.set(normalizer,
830 m_read_external.set(normalizer, &stat->m_stat[PFS_TL_READ_EXTERNAL]);
831
832 all_read.aggregate(&stat->m_stat[PFS_TL_READ]);
835 all_read.aggregate(&stat->m_stat[PFS_TL_READ_NO_INSERT]);
836 all_read.aggregate(&stat->m_stat[PFS_TL_READ_EXTERNAL]);
837
838 m_write_allow_write.set(normalizer,
841 normalizer, &stat->m_stat[PFS_TL_WRITE_CONCURRENT_INSERT]);
842 m_write_low_priority.set(normalizer,
844 m_write_normal.set(normalizer, &stat->m_stat[PFS_TL_WRITE]);
846
847 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_ALLOW_WRITE]);
849 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_LOW_PRIORITY]);
850 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE]);
851 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_EXTERNAL]);
852
853 all.aggregate(&all_read);
854 all.aggregate(&all_write);
855
856 m_all_read.set(normalizer, &all_read);
857 m_all_write.set(normalizer, &all_write);
858 m_all.set(normalizer, &all);
859 }
860};
861
862/** Row fragment for stage statistics columns. */
865
866 /** Build a row from a memory buffer. */
867 inline void set(time_normalizer *normalizer, const PFS_stage_stat *stat) {
868 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
869 }
870
871 /** Set a table field from the row. */
873};
874
875/** Row fragment for statement statistics columns. */
897 /**
898 CPU TIME.
899 Expressed in DISPLAY units (picoseconds).
900 */
905
906 /** Build a row from a memory buffer. */
907 inline void set(time_normalizer *normalizer, const PFS_statement_stat *stat) {
908 if (stat->m_timer1_stat.m_count != 0) {
909 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
910
915 m_rows_sent = stat->m_rows_sent;
926 m_sort_rows = stat->m_sort_rows;
927 m_sort_scan = stat->m_sort_scan;
934 } else {
936
937 m_error_count = 0;
938 m_warning_count = 0;
939 m_lock_time = 0;
940 m_rows_affected = 0;
941 m_rows_sent = 0;
942 m_rows_examined = 0;
947 m_select_range = 0;
949 m_select_scan = 0;
951 m_sort_range = 0;
952 m_sort_rows = 0;
953 m_sort_scan = 0;
954 m_no_index_used = 0;
956 m_cpu_time = 0;
960 }
961 }
962
963 /** Set a table field from the row. */
964 void set_field(uint index, Field *f);
965};
966
967/** Row fragment for stored program statistics. */
970
971 /** Build a row from a memory buffer. */
972 inline void set(time_normalizer *normalizer, const PFS_sp_stat *stat) {
973 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
974 }
975
976 /** Set a table field from the row. */
977 inline void set_field(uint index, Field *f) {
979 }
980};
981
982/** Row fragment for transaction statistics columns. */
990
991 /** Build a row from a memory buffer. */
992 inline void set(time_normalizer *normalizer,
993 const PFS_transaction_stat *stat) {
994 /* Combine read write/read only stats */
996 all.aggregate(&stat->m_read_only_stat);
997 all.aggregate(&stat->m_read_write_stat);
998
999 m_timer1_row.set(normalizer, &all);
1000 m_read_write_row.set(normalizer, &stat->m_read_write_stat);
1001 m_read_only_row.set(normalizer, &stat->m_read_only_stat);
1002 }
1003
1004 /** Set a table field from the row. */
1005 void set_field(uint index, Field *f);
1006};
1007
1008/** Row fragment for error statistics columns. */
1015
1016 /** Build a row from a memory buffer. */
1017 inline void set(const PFS_error_single_stat *stat, uint error_index) {
1018 m_count = stat->m_count;
1020 m_error_index = error_index;
1021 m_first_seen = stat->m_first_seen;
1022 m_last_seen = stat->m_last_seen;
1023 }
1024
1025 /** Set a table field from the row. */
1026 void set_field(uint index, Field *f, server_error *temp_error);
1027};
1028
1029/** Row fragment for connection statistics. */
1032
1033 inline void set(const PFS_connection_stat *stat) { m_stat = *stat; }
1034
1035 /** Set a table field from the row. */
1036 void set_field(uint index, Field *f);
1037};
1038
1039void set_field_object_type(Field *f, enum_object_type object_type);
1040void set_field_lock_type(Field *f, PFS_TL_LOCK_TYPE lock_type);
1041void set_field_mdl_type(Field *f, opaque_mdl_type mdl_type);
1042void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration);
1043void set_field_mdl_status(Field *f, opaque_mdl_status mdl_status);
1046
1047/** Row fragment for socket I/O statistics columns. */
1053
1054 inline void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat) {
1056
1057 m_read.set(normalizer, &stat->m_read);
1058 m_write.set(normalizer, &stat->m_write);
1059 m_misc.set(normalizer, &stat->m_misc);
1060
1061 /* Combine stats for all operations */
1062 all.aggregate(&stat->m_read);
1063 all.aggregate(&stat->m_write);
1064 all.aggregate(&stat->m_misc);
1065
1066 m_all.set(normalizer, &all);
1067 }
1068};
1069
1070/** Row fragment for file I/O statistics columns. */
1076
1077 inline void set(time_normalizer *normalizer, const PFS_file_io_stat *stat) {
1079
1080 m_read.set(normalizer, &stat->m_read);
1081 m_write.set(normalizer, &stat->m_write);
1082 m_misc.set(normalizer, &stat->m_misc);
1083
1084 /* Combine stats for all operations */
1085 all.aggregate(&stat->m_read);
1086 all.aggregate(&stat->m_write);
1087 all.aggregate(&stat->m_misc);
1088
1089 m_all.set(normalizer, &all);
1090 }
1091};
1092
1093/** Row fragment for memory statistics columns. */
1096
1097 /** Build a row from a memory buffer. */
1098 inline void set(const PFS_memory_monitoring_stat *stat) { m_stat = *stat; }
1099
1100 /** Set a table field from the row. */
1101 void set_field(uint index, Field *f);
1102};
1103
1109
1110 /** Build a row from a memory buffer. */
1111 void set(const PFS_session_all_memory_stat *stat);
1112
1113 /** Set a table field from the row. */
1114 void set_field(uint index, Field *f);
1115};
1116
1118 public:
1120 m_str[0] = '\0';
1121 m_length = 0;
1122 }
1123
1124 int make_row(const char *str, size_t length);
1125
1128};
1129
1131 public:
1132 /** Set the row from a status variable. */
1133 int make_row(const Status_variable *var);
1134
1135 /** Set the row from a system variable. */
1136 int make_row(const System_variable *var);
1137
1138 /** Set a table field from the row. */
1139 void set_field(Field *f);
1140
1141 const char *get_str() const { return m_str; }
1142 uint get_length() const { return m_length; }
1143
1144 private:
1145 int make_row(const CHARSET_INFO *cs, const char *str, size_t length);
1146
1147 char m_str[1024];
1148 uint m_length{0};
1149 const CHARSET_INFO *m_charset{nullptr};
1150};
1151
1153 public:
1155
1158 }
1159
1161
1162 int make_row(const char *val, size_t length);
1163
1164 const char *get_value() const { return m_value; }
1165
1166 size_t get_value_length() const { return m_value_length; }
1167
1168 void clear();
1169
1170 private:
1171 char *m_value;
1173};
1174
1176 public:
1177 explicit PFS_key_long(const char *name)
1179
1180 ~PFS_key_long() override = default;
1181
1183 enum ha_rkey_function find_flag,
1184 bool &is_null, long *key_value) {
1185 return reader.read_long(find_flag, is_null, key_value);
1186 }
1187
1188 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1189 m_find_flag = stateless_read(reader, find_flag, m_is_null, &m_key_value);
1190 }
1191
1192 static bool stateless_match(bool record_null, long record_value,
1193 bool m_is_null, long m_key_value,
1194 enum ha_rkey_function find_flag);
1195
1196 protected:
1197 bool do_match(bool record_null, long record_value) {
1198 return stateless_match(record_null, record_value, m_is_null, m_key_value,
1199 m_find_flag);
1200 }
1201
1202 private:
1204};
1205
1207 public:
1208 explicit PFS_key_ulong(const char *name)
1210
1211 ~PFS_key_ulong() override = default;
1212
1214 enum ha_rkey_function find_flag,
1215 bool &is_null, ulong *key_value) {
1216 return reader.read_ulong(find_flag, is_null, key_value);
1217 }
1218
1219 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1220 m_find_flag = reader.read_ulong(find_flag, m_is_null, &m_key_value);
1221 }
1222
1223 static bool stateless_match(bool record_null, ulong record_value,
1224 bool m_is_null, ulong m_key_value,
1225 enum ha_rkey_function find_flag);
1226
1227 protected:
1228 bool do_match(bool record_null, ulong record_value);
1229
1230 private:
1232};
1233
1235 public:
1236 explicit PFS_key_longlong(const char *name)
1238
1239 ~PFS_key_longlong() override = default;
1240
1241 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1242 m_find_flag = reader.read_longlong(find_flag, m_is_null, &m_key_value);
1243 }
1244
1245 static bool stateless_match(bool record_null, longlong record_value,
1247 enum ha_rkey_function find_flag);
1248
1249 protected:
1250 bool do_match(bool record_null, longlong record_value) {
1251 return stateless_match(record_null, record_value, m_is_null, m_key_value,
1252 m_find_flag);
1253 }
1254
1255 private:
1257};
1258
1260 public:
1261 explicit PFS_key_ulonglong(const char *name)
1263
1264 ~PFS_key_ulonglong() override = default;
1265
1266 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1267 m_find_flag = reader.read_ulonglong(find_flag, m_is_null, &m_key_value);
1268 }
1269
1270 static bool stateless_match(bool record_null, ulonglong record_value,
1272 enum ha_rkey_function find_flag);
1273
1274 protected:
1275 bool do_match(bool record_null, ulonglong record_value);
1276
1277 private:
1279};
1280
1282 public:
1283 explicit PFS_key_thread_id(const char *name) : PFS_key_ulonglong(name) {}
1284
1285 ~PFS_key_thread_id() override = default;
1286
1288 bool match(const PFS_thread *pfs);
1289 bool match_owner(const PFS_table *pfs);
1290 bool match_owner(const PFS_socket *pfs);
1291 bool match_owner(const PFS_mutex *pfs);
1292 bool match_owner(const PFS_prepared_stmt *pfs);
1293 bool match_owner(const PFS_metadata_lock *pfs);
1294 bool match_writer(const PFS_rwlock *pfs);
1295};
1296
1298 public:
1299 explicit PFS_key_event_id(const char *name) : PFS_key_ulonglong(name) {}
1300
1301 ~PFS_key_event_id() override = default;
1302
1303 bool match(ulonglong event_id);
1304 bool match(const PFS_events *pfs);
1305 bool match(const PFS_events_waits *pfs);
1306 bool match_owner(const PFS_table *pfs);
1307 bool match_owner(const PFS_prepared_stmt *pfs);
1308 bool match_owner(const PFS_metadata_lock *pfs);
1309};
1310
1312 public:
1314
1315 ~PFS_key_processlist_id() override = default;
1316
1317 bool match(const PFS_thread *pfs);
1318};
1319
1321 public:
1324
1326
1327 bool match(ulonglong engine_transaction_id);
1328};
1329
1331 public:
1333
1334 ~PFS_key_thread_os_id() override = default;
1335
1336 bool match(const PFS_thread *pfs);
1337};
1338
1340 public:
1342
1343 ~PFS_key_statement_id() override = default;
1344
1345 bool match(const PFS_prepared_stmt *pfs);
1346};
1347
1349 public:
1350 explicit PFS_key_worker_id(const char *name) : PFS_key_ulonglong(name) {}
1351
1352 ~PFS_key_worker_id() override = default;
1353
1354 bool match_not_null(ulonglong worker_id);
1355};
1356
1358 public:
1359 explicit PFS_key_socket_id(const char *name) : PFS_key_long(name) {}
1360
1361 ~PFS_key_socket_id() override = default;
1362
1363 bool match(const PFS_socket *pfs);
1364};
1365
1367 public:
1368 explicit PFS_key_port(const char *name) : PFS_key_long(name) {}
1369
1370 ~PFS_key_port() override = default;
1371
1372 bool match(const PFS_socket *pfs);
1373
1374 /**
1375 match port number
1376
1377 @param port port number to match
1378 */
1379 bool match(uint port);
1380};
1381
1383 public:
1384 explicit PFS_key_error_number(const char *name) : PFS_key_long(name) {}
1385
1386 ~PFS_key_error_number() override = default;
1387
1388 bool match_error_index(uint error_index);
1389};
1390
1392 public:
1393 explicit PFS_key_pstring(const char *name) : PFS_engine_key(name) {}
1394
1395 ~PFS_key_pstring() override = default;
1396
1398 enum ha_rkey_function find_flag,
1399 bool &is_null, char *key_value,
1400 uint *key_value_length,
1401 uint key_value_max_length) {
1402 if (reader.get_key_type() == HA_KEYTYPE_TEXT) {
1403 return (reader.read_text_utf8(find_flag, is_null, key_value,
1404 key_value_length, key_value_max_length));
1405 }
1406 return (reader.read_varchar_utf8(find_flag, is_null, key_value,
1407 key_value_length, key_value_max_length));
1408 }
1409
1410 static bool stateless_match(bool record_null, const char *record_string,
1411 size_t record_string_length,
1412 const char *m_key_value,
1413 size_t m_key_value_length, bool m_is_null,
1415
1416 protected:
1417 bool do_match(bool record_null, const char *record_value,
1418 size_t record_value_length);
1419 bool do_match_prefix(bool record_null, const char *record_value,
1420 size_t record_value_length);
1421};
1422
1423template <int SIZE>
1425 public:
1426 explicit PFS_key_string(const char *name)
1428 m_key_value[0] = '\0';
1429 }
1430
1431 ~PFS_key_string() override = default;
1432
1433 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1434 m_find_flag = stateless_read(reader, find_flag, m_is_null, m_key_value,
1436 }
1437
1438 void get_exact_key_value(bool &is_null, const char *&key_value,
1439 size_t &key_value_length) {
1442 key_value = m_key_value;
1443 key_value_length = m_key_value_length;
1444 } else {
1445 is_null = true;
1446 key_value = nullptr;
1447 key_value_length = 0;
1448 }
1449 }
1450
1451 protected:
1452 bool do_match(bool record_null, const char *record_value,
1453 size_t record_value_length) {
1454 return stateless_match(record_null, record_value, record_value_length,
1456 m_find_flag);
1457 }
1458 bool do_match_prefix(bool record_null, const char *record_string,
1459 size_t record_string_length);
1460
1461 private:
1464};
1465
1466class PFS_key_thread_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1467 public:
1468 explicit PFS_key_thread_name(const char *name) : PFS_key_string(name) {}
1469
1470 ~PFS_key_thread_name() override = default;
1471
1472 bool match(const PFS_thread *pfs);
1473 bool match(const PFS_thread_class *klass);
1474};
1475
1476class PFS_key_event_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1477 public:
1478 explicit PFS_key_event_name(const char *name) : PFS_key_string(name) {}
1479
1480 ~PFS_key_event_name() override = default;
1481
1482 bool match(const PFS_instr_class *pfs);
1483 bool match(const PFS_mutex *pfs);
1484 bool match(const PFS_rwlock *pfs);
1485 bool match(const PFS_cond *pfs);
1486 bool match(const PFS_file *pfs);
1487 bool match(const PFS_socket *pfs);
1488 bool match_view(uint view);
1489};
1490
1491class PFS_key_meter_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1492 public:
1493 explicit PFS_key_meter_name(const char *name) : PFS_key_string(name) {}
1494
1495 ~PFS_key_meter_name() override = default;
1496
1497 bool match(PFS_meter_class *pfs);
1498};
1499
1500class PFS_key_metric_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1501 public:
1502 explicit PFS_key_metric_name(const char *name) : PFS_key_string(name) {}
1503
1504 ~PFS_key_metric_name() override = default;
1505
1506 bool match(PFS_metric_class *pfs);
1507};
1508
1509class PFS_key_user : public PFS_key_string<USERNAME_LENGTH> {
1510 public:
1511 explicit PFS_key_user(const char *name) : PFS_key_string(name) {}
1512
1513 ~PFS_key_user() override = default;
1514
1515 bool match(const PFS_thread *pfs);
1516 bool match(const PFS_user *pfs);
1517 bool match(const PFS_account *pfs);
1518 bool match(const PFS_setup_actor *pfs);
1519 bool match(const PFS_user_name *pfs);
1520};
1521
1522class PFS_key_host : public PFS_key_string<HOSTNAME_LENGTH> {
1523 public:
1524 explicit PFS_key_host(const char *name) : PFS_key_string(name) {}
1525
1526 ~PFS_key_host() override = default;
1527
1528 bool match(const PFS_thread *pfs);
1529 bool match(const PFS_host *pfs);
1530 bool match(const PFS_account *pfs);
1531 bool match(const PFS_setup_actor *pfs);
1532 bool match(const PFS_host_name *pfs);
1533 bool match(const char *host, size_t hostname_length);
1534};
1535
1536class PFS_key_role : public PFS_key_string<ROLENAME_LENGTH> {
1537 public:
1538 explicit PFS_key_role(const char *name) : PFS_key_string(name) {}
1539
1540 ~PFS_key_role() override = default;
1541
1542 bool match(const PFS_setup_actor *pfs);
1543};
1544
1545class PFS_key_schema : public PFS_key_string<NAME_CHAR_LEN> {
1546 public:
1547 explicit PFS_key_schema(const char *schema) : PFS_key_string(schema) {}
1548
1549 ~PFS_key_schema() override = default;
1550
1552};
1553
1554class PFS_key_digest : public PFS_key_string<MAX_KEY_LENGTH> {
1555 public:
1556 explicit PFS_key_digest(const char *digest) : PFS_key_string(digest) {}
1557
1558 ~PFS_key_digest() override = default;
1559
1561};
1562
1564 public:
1565 explicit PFS_key_bucket_number(const char *name) : PFS_key_ulong(name) {}
1566
1567 ~PFS_key_bucket_number() override = default;
1568
1569 bool match(ulong value);
1570};
1571
1572/* Generic NAME key */
1573class PFS_key_name : public PFS_key_string<NAME_CHAR_LEN> {
1574 public:
1575 explicit PFS_key_name(const char *name) : PFS_key_string(name) {}
1576
1577 ~PFS_key_name() override = default;
1578
1579 bool match(const LEX_CSTRING *name);
1580 bool match(const char *name, size_t name_length);
1581 bool match_not_null(const LEX_STRING *name);
1582 bool match_not_null(const char *name, size_t name_length);
1583};
1584
1585class PFS_key_group_name : public PFS_key_string<NAME_CHAR_LEN> {
1586 public:
1587 explicit PFS_key_group_name(const char *name) : PFS_key_string(name) {}
1588
1589 ~PFS_key_group_name() override = default;
1590
1591 bool match(const LEX_STRING *name);
1592 bool match(const char *name, size_t name_length);
1593 bool match(PFS_thread *pfs);
1594};
1595
1596class PFS_key_variable_name : public PFS_key_string<NAME_CHAR_LEN> {
1597 public:
1598 explicit PFS_key_variable_name(const char *name) : PFS_key_string(name) {}
1599
1600 ~PFS_key_variable_name() override = default;
1601
1602 bool match(const System_variable *pfs);
1603 bool match(const Status_variable *pfs);
1604 bool match(const PFS_variable_name_row *pfs);
1605};
1606
1607// FIXME: 32
1609 public:
1610 explicit PFS_key_engine_name(const char *name) : PFS_key_string(name) {}
1611
1612 ~PFS_key_engine_name() override = default;
1613
1614 bool match(const char *engine_name, size_t length);
1615};
1616
1617// FIXME: 128
1619 public:
1621
1622 ~PFS_key_engine_lock_id() override = default;
1623
1624 bool match(const char *engine_lock_id, size_t length);
1625};
1626
1627class PFS_key_ip : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> // FIXME
1628// <INET6_ADDRSTRLEN+1>
1629// fails on freebsd
1630{
1631 public:
1632 explicit PFS_key_ip(const char *name) : PFS_key_string(name) {}
1633
1634 ~PFS_key_ip() override = default;
1635
1636 bool match(const PFS_socket *pfs);
1637 bool match(const char *ip, size_t ip_length);
1638};
1639
1640class PFS_key_statement_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1641 public:
1643
1644 ~PFS_key_statement_name() override = default;
1645
1646 bool match(const PFS_prepared_stmt *pfs);
1647};
1648
1650 : public PFS_key_string<1350> // FIXME FN_REFLEN or FN_REFLEN_SE
1651{
1652 public:
1653 explicit PFS_key_file_name(const char *name) : PFS_key_string(name) {}
1654
1655 ~PFS_key_file_name() override = default;
1656
1657 bool match(const PFS_file *pfs);
1658};
1659
1660class PFS_key_object_schema : public PFS_key_string<NAME_CHAR_LEN> {
1661 public:
1662 explicit PFS_key_object_schema(const char *name) : PFS_key_string(name) {}
1663
1664 ~PFS_key_object_schema() override = default;
1665
1666 bool match(const PFS_table_share *share);
1667 bool match(const PFS_program *pfs);
1668 bool match(const PFS_prepared_stmt *pfs);
1669 bool match(const PFS_object_row *pfs);
1670 bool match(const PFS_column_row *pfs);
1671 bool match(const PFS_setup_object *pfs);
1672 bool match(const char *schema_name, size_t schema_name_length);
1673};
1674
1675class PFS_key_object_name : public PFS_key_string<NAME_CHAR_LEN> {
1676 public:
1677 explicit PFS_key_object_name(const char *name) : PFS_key_string(name) {}
1678
1679 ~PFS_key_object_name() override = default;
1680
1681 bool match(const PFS_table_share *share);
1682 bool match(const PFS_program *pfs);
1683 bool match(const PFS_prepared_stmt *pfs);
1684 bool match(const PFS_object_row *pfs);
1685 bool match(const PFS_column_row *pfs);
1686 bool match(const PFS_index_row *pfs);
1687 bool match(const PFS_setup_object *pfs);
1688 bool match(const char *object_name, size_t object_name_length);
1689};
1690
1691class PFS_key_column_name : public PFS_key_string<NAME_CHAR_LEN> {
1692 public:
1693 explicit PFS_key_column_name(const char *name) : PFS_key_string(name) {}
1694
1695 ~PFS_key_column_name() override = default;
1696
1697 bool match(const PFS_column_row *pfs);
1698};
1699
1701 public:
1702 explicit PFS_key_object_type(const char *name)
1704
1705 ~PFS_key_object_type() 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_object_row *pfs);
1711 bool match(const PFS_column_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_type_enum(const char *name)
1723
1724 ~PFS_key_object_type_enum() override = default;
1725
1726 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override;
1727
1728 bool match(enum_object_type object_type);
1729 bool match(const PFS_prepared_stmt *pfs);
1730 bool match(const PFS_object_row *pfs);
1731 bool match(const PFS_program *pfs);
1732
1733 private:
1734 bool do_match(bool record_null, enum_object_type record_value);
1736};
1737
1739 public:
1740 explicit PFS_key_object_instance(const char *name)
1742
1743 ~PFS_key_object_instance() override = default;
1744
1745 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1746 ulonglong object_instance_begin{0};
1747 m_find_flag =
1748 reader.read_ulonglong(find_flag, m_is_null, &object_instance_begin);
1749 m_identity = (void *)object_instance_begin;
1750 }
1751
1752 bool match(const PFS_table *pfs);
1753 bool match(const PFS_mutex *pfs);
1754 bool match(const PFS_rwlock *pfs);
1755 bool match(const PFS_cond *pfs);
1756 bool match(const PFS_file *pfs);
1757 bool match(const PFS_socket *pfs);
1758 bool match(const PFS_prepared_stmt *pfs);
1759 bool match(const PFS_metadata_lock *pfs);
1760
1761 const void *m_identity;
1762};
1763
1764/** @} */
1765
1766#endif
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:247
Definition: field.h:570
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1225
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:1563
PFS_key_bucket_number(const char *name)
Definition: table_helper.h:1565
~PFS_key_bucket_number() override=default
bool match(ulong value)
Definition: table_helper.cc:2194
Definition: table_helper.h:1691
~PFS_key_column_name() override=default
PFS_key_column_name(const char *name)
Definition: table_helper.h:1693
bool match(const PFS_column_row *pfs)
Definition: table_helper.cc:2494
Definition: table_helper.h:1554
PFS_key_digest(const char *digest)
Definition: table_helper.h:1556
bool match(PFS_statements_digest_stat *pfs)
Definition: table_helper.cc:2185
~PFS_key_digest() override=default
Definition: table_helper.h:1618
~PFS_key_engine_lock_id() override=default
bool match(const char *engine_lock_id, size_t length)
Definition: table_helper.cc:2248
PFS_key_engine_lock_id(const char *name)
Definition: table_helper.h:1620
Definition: table_helper.h:1608
PFS_key_engine_name(const char *name)
Definition: table_helper.h:1610
~PFS_key_engine_name() override=default
bool match(const char *engine_name, size_t length)
Definition: table_helper.cc:2244
Definition: table_helper.h:1320
~PFS_key_engine_transaction_id() override=default
PFS_key_engine_transaction_id(const char *name)
Definition: table_helper.h:1322
bool match(ulonglong engine_transaction_id)
Definition: table_helper.cc:1909
Definition: table_helper.h:1382
bool match_error_index(uint error_index)
Definition: table_helper.cc:1949
~PFS_key_error_number() override=default
PFS_key_error_number(const char *name)
Definition: table_helper.h:1384
Definition: table_helper.h:1297
bool match(ulonglong event_id)
Definition: table_helper.cc:1874
PFS_key_event_id(const char *name)
Definition: table_helper.h:1299
~PFS_key_event_id() override=default
bool match_owner(const PFS_table *pfs)
Definition: table_helper.cc:1889
Definition: table_helper.h:1476
bool match(const PFS_instr_class *pfs)
Definition: table_helper.cc:1972
PFS_key_event_name(const char *name)
Definition: table_helper.h:1478
bool match_view(uint view)
Definition: table_helper.cc:2017
~PFS_key_event_name() override=default
Definition: table_helper.h:1651
bool match(const PFS_file *pfs)
Definition: table_helper.cc:2274
PFS_key_file_name(const char *name)
Definition: table_helper.h:1653
~PFS_key_file_name() override=default
Definition: table_helper.h:1585
bool match(const LEX_STRING *name)
Definition: table_helper.cc:2216
~PFS_key_group_name() override=default
PFS_key_group_name(const char *name)
Definition: table_helper.h:1587
Definition: table_helper.h:1522
~PFS_key_host() override=default
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:2139
PFS_key_host(const char *name)
Definition: table_helper.h:1524
Definition: table_helper.h:1630
~PFS_key_ip() override=default
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:2252
PFS_key_ip(const char *name)
Definition: table_helper.h:1632
Definition: table_helper.h:1175
PFS_key_long(const char *name)
Definition: table_helper.h:1177
long m_key_value
Definition: table_helper.h:1203
bool do_match(bool record_null, long record_value)
Definition: table_helper.h:1197
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:1182
~PFS_key_long() override=default
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1188
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:1656
Definition: table_helper.h:1234
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1241
~PFS_key_longlong() override=default
PFS_key_longlong(const char *name)
Definition: table_helper.h:1236
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:1668
bool do_match(bool record_null, longlong record_value)
Definition: table_helper.h:1250
longlong m_key_value
Definition: table_helper.h:1256
Definition: table_helper.h:1491
~PFS_key_meter_name() override=default
PFS_key_meter_name(const char *name)
Definition: table_helper.h:1493
bool match(PFS_meter_class *pfs)
Definition: table_helper.cc:2094
Definition: table_helper.h:1500
PFS_key_metric_name(const char *name)
Definition: table_helper.h:1502
bool match(PFS_metric_class *pfs)
Definition: table_helper.cc:2102
~PFS_key_metric_name() override=default
Definition: table_helper.h:1573
~PFS_key_name() override=default
bool match(const LEX_CSTRING *name)
Definition: table_helper.cc:2198
PFS_key_name(const char *name)
Definition: table_helper.h:1575
bool match_not_null(const LEX_STRING *name)
Definition: table_helper.cc:2208
Definition: table_helper.h:1738
PFS_key_object_instance(const char *name)
Definition: table_helper.h:1740
~PFS_key_object_instance() override=default
bool match(const PFS_table *pfs)
Definition: table_helper.cc:2499
const void * m_identity
Definition: table_helper.h:1761
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1745
Definition: table_helper.h:1675
~PFS_key_object_name() override=default
PFS_key_object_name(const char *name)
Definition: table_helper.h:1677
bool match(const PFS_table_share *share)
Definition: table_helper.cc:2451
Definition: table_helper.h:1660
PFS_key_object_schema(const char *name)
Definition: table_helper.h:1662
bool match(const PFS_table_share *share)
Definition: table_helper.cc:2413
~PFS_key_object_schema() override=default
Definition: table_helper.h:1719
enum_object_type m_object_type
Definition: table_helper.h:1735
~PFS_key_object_type_enum() override=default
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.cc:2347
PFS_key_object_type_enum(const char *name)
Definition: table_helper.h:1721
bool do_match(bool record_null, enum_object_type record_value)
Definition: table_helper.cc:2380
bool match(enum_object_type object_type)
Definition: table_helper.cc:2360
Definition: table_helper.h:1700
PFS_key_object_type(const char *name)
Definition: table_helper.h:1702
enum_object_type m_object_type
Definition: table_helper.h:1716
bool do_match(bool record_null, enum_object_type record_value)
Definition: table_helper.cc:2314
bool match(enum_object_type object_type)
Definition: table_helper.cc:2294
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.cc:2278
~PFS_key_object_type() override=default
Definition: table_helper.h:1366
~PFS_key_port() override=default
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:1932
PFS_key_port(const char *name)
Definition: table_helper.h:1368
Definition: table_helper.h:1311
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1904
PFS_key_processlist_id(const char *name)
Definition: table_helper.h:1313
~PFS_key_processlist_id() override=default
Definition: table_helper.h:1391
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:1393
~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:1745
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:1397
Definition: table_helper.h:1536
PFS_key_role(const char *name)
Definition: table_helper.h:1538
bool match(const PFS_setup_actor *pfs)
Definition: table_helper.cc:2173
~PFS_key_role() override=default
Definition: table_helper.h:1545
bool match(const PFS_statements_digest_stat *pfs)
Definition: table_helper.cc:2179
~PFS_key_schema() override=default
PFS_key_schema(const char *schema)
Definition: table_helper.h:1547
Definition: table_helper.h:1357
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:1927
~PFS_key_socket_id() override=default
PFS_key_socket_id(const char *name)
Definition: table_helper.h:1359
Definition: table_helper.h:1339
bool match(const PFS_prepared_stmt *pfs)
Definition: table_helper.cc:1918
PFS_key_statement_id(const char *name)
Definition: table_helper.h:1341
~PFS_key_statement_id() override=default
Definition: table_helper.h:1640
~PFS_key_statement_name() override=default
bool match(const PFS_prepared_stmt *pfs)
Definition: table_helper.cc:2270
PFS_key_statement_name(const char *name)
Definition: table_helper.h:1642
Definition: table_helper.h:1424
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1433
PFS_key_string(const char *name)
Definition: table_helper.h:1426
bool do_match_prefix(bool record_null, const char *record_string, size_t record_string_length)
Definition: table_helper.cc:1794
bool do_match(bool record_null, const char *record_value, size_t record_value_length)
Definition: table_helper.h:1452
void get_exact_key_value(bool &is_null, const char *&key_value, size_t &key_value_length)
Definition: table_helper.h:1438
~PFS_key_string() override=default
char m_key_value[SIZE *FILENAME_CHARSET_MBMAXLEN]
Definition: table_helper.h:1462
uint m_key_value_length
Definition: table_helper.h:1463
Definition: table_helper.h:1281
bool match_owner(const PFS_table *pfs)
Definition: table_helper.cc:1823
~PFS_key_thread_id() override=default
bool match_writer(const PFS_rwlock *pfs)
Definition: table_helper.cc:1864
bool match(ulonglong thread_id)
Definition: table_helper.cc:1813
PFS_key_thread_id(const char *name)
Definition: table_helper.h:1283
Definition: table_helper.h:1466
~PFS_key_thread_name() override=default
PFS_key_thread_name(const char *name)
Definition: table_helper.h:1468
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1959
Definition: table_helper.h:1330
~PFS_key_thread_os_id() override=default
PFS_key_thread_os_id(const char *name)
Definition: table_helper.h:1332
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1913
Definition: table_helper.h:1206
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1219
PFS_key_ulong(const char *name)
Definition: table_helper.h:1208
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:1662
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:1213
~PFS_key_ulong() override=default
ulong m_key_value
Definition: table_helper.h:1231
bool do_match(bool record_null, ulong record_value)
Definition: table_helper.cc:1681
Definition: table_helper.h:1259
~PFS_key_ulonglong() override=default
bool do_match(bool record_null, ulonglong record_value)
Definition: table_helper.cc:1713
ulonglong m_key_value
Definition: table_helper.h:1278
PFS_key_ulonglong(const char *name)
Definition: table_helper.h:1261
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:1674
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1266
Definition: table_helper.h:1509
PFS_key_user(const char *name)
Definition: table_helper.h:1511
~PFS_key_user() override=default
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:2110
Definition: table_helper.h:1596
bool match(const System_variable *pfs)
Definition: table_helper.cc:2231
PFS_key_variable_name(const char *name)
Definition: table_helper.h:1598
~PFS_key_variable_name() override=default
Definition: table_helper.h:1348
bool match_not_null(ulonglong worker_id)
Definition: table_helper.cc:1923
~PFS_key_worker_id() override=default
PFS_key_worker_id(const char *name)
Definition: table_helper.h:1350
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:169
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:1332
enum ha_rkey_function read_ulong(enum ha_rkey_function find_flag, bool &isnull, ulong *value)
Definition: pfs_engine_table.cc:1337
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:1434
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:1382
enum ha_rkey_function read_longlong(enum ha_rkey_function find_flag, bool &isnull, longlong *value)
Definition: pfs_engine_table.cc:1342
enum ha_rkey_function read_ulonglong(enum ha_rkey_function find_flag, bool &isnull, ulonglong *value)
Definition: pfs_engine_table.cc:1347
void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration)
Definition: table_helper.cc:1399
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:409
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:369
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:488
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:591
char * get_field_datetime(Field *f, char *val, uint *len)
Helper, read a value from an datetime field.
Definition: table_helper.cc:392
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:1533
void set_field_isolation_level(Field *f, enum_isolation_level iso_level)
Definition: table_helper.cc:1514
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:1314
void set_field_date_by_daynr(Field *f, ulong daynr)
Definition: table_helper.cc:342
char * get_field_time(Field *f, char *val, uint *len)
Helper, read a value from an time field.
Definition: table_helper.cc:375
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:1420
void set_field_year(Field *f, ulong value)
Helper, assign a value to a year field.
Definition: table_helper.cc:428
void set_nullable_field_object_name(Field *f, const PFS_object_name *object)
Definition: table_helper.cc:478
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:1354
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:447
void set_field_datetime(Field *f, const char *value, uint len)
Helper, assign a value to a datetime field.
Definition: table_helper.cc:386
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:457
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:554
void set_field_routine_name(Field *f, const PFS_routine_name *object)
Definition: table_helper.cc:519
void set_field_json(Field *f, const Json_wrapper *json)
Helper, assign a value to a JSON field.
Definition: table_helper.cc:441
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:434
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:509
char * get_field_date(Field *f, char *val, uint *len)
Helper, read a value from an date field.
Definition: table_helper.cc:358
void set_field_timestamp(Field *f, ulonglong value)
Helper, assign a value to a timestamp field.
Definition: table_helper.cc:419
void set_field_object_type(Field *f, enum_object_type object_type)
Definition: table_helper.cc:1307
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:446
ha_rkey_function
Definition: my_base.h:78
@ HA_READ_KEY_EXACT
Definition: my_base.h:79
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:60
#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:66
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1077
static PFS_engine_table_share_proxy share
Definition: connection_control_pfs_table.cc:92
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
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
bool is_null(poly_thread thread, poly_value value)
Definition: jit_executor_type_conversion.cc:46
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:330
enum_xa_transaction_state
Enum values for XA transaction state columns.
Definition: pfs_column_types.h:310
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:227
@ NO_OBJECT_TYPE
Definition: pfs_column_types.h:228
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:421
Metadata lock object key.
Definition: mdl.h:366
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:554
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:643
PFS_user_name m_user_name
Column USER.
Definition: table_helper.h:556
PFS_host_name m_host_name
Column HOST.
Definition: table_helper.h:558
int make_row(PFS_account *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:637
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:657
Per account statistics.
Definition: pfs_account.h:67
Row fragment for timer and byte count stats.
Definition: table_helper.h:753
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:758
ulonglong m_bytes
Definition: table_helper.h:755
PFS_stat_row m_waits
Definition: table_helper.h:754
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:637
char m_column_name[NAME_LEN]
Column OBJECT_NAME.
Definition: table_helper.h:649
char m_schema_name[NAME_LEN]
Column SCHEMA_NAME.
Definition: table_helper.h:641
size_t m_column_name_length
Length in bytes of m_column_name.
Definition: table_helper.h:651
void set_nullable_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:968
size_t m_schema_name_length
Length in bytes of m_schema_name.
Definition: table_helper.h:643
size_t m_object_name_length
Length in bytes of m_object_name.
Definition: table_helper.h:647
char m_object_name[NAME_LEN]
Column OBJECT_NAME.
Definition: table_helper.h:645
int make_row(const MDL_key *mdl)
Build a row from a memory buffer.
Definition: table_helper.cc:754
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:639
Instrumented condition implementation.
Definition: pfs_instr.h:162
Row fragment for connection statistics.
Definition: table_helper.h:1030
PFS_connection_stat m_stat
Definition: table_helper.h:1031
void set(const PFS_connection_stat *stat)
Definition: table_helper.h:1033
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1287
Connections statistics.
Definition: pfs_stat.h:1227
Row fragment for columns DIGEST, DIGEST_TEXT.
Definition: table_helper.h:568
char m_digest[DIGEST_HASH_TO_STRING_LENGTH+1]
Column DIGEST.
Definition: table_helper.h:572
uint m_digest_length
Length in bytes of m_digest.
Definition: table_helper.h:574
int make_row(PFS_statements_digest_stat *)
Build a row from a memory buffer.
Definition: table_helper.cc:671
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:570
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:708
String m_digest_text
Column DIGEST_TEXT.
Definition: table_helper.h:576
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:1009
uint m_error_index
Definition: table_helper.h:1012
ulonglong m_last_seen
Definition: table_helper.h:1014
ulonglong m_count
Definition: table_helper.h:1010
void set(const PFS_error_single_stat *stat, uint error_index)
Build a row from a memory buffer.
Definition: table_helper.h:1017
ulonglong m_first_seen
Definition: table_helper.h:1013
void set_field(uint index, Field *f, server_error *temp_error)
Set a table field from the row.
Definition: table_helper.cc:1231
ulonglong m_handled_count
Definition: table_helper.h:1011
Row fragment for column EVENT_NAME.
Definition: table_helper.h:585
int make_row(PFS_instr_class *pfs)
Build a row from a memory buffer.
Definition: table_helper.h:592
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.h:599
uint m_name_length
Length in bytes of m_name.
Definition: table_helper.h:589
const char * m_name
Column EVENT_NAME.
Definition: table_helper.h:587
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:1071
PFS_byte_stat_row m_write
Definition: table_helper.h:1073
void set(time_normalizer *normalizer, const PFS_file_io_stat *stat)
Definition: table_helper.h:1077
PFS_byte_stat_row m_all
Definition: table_helper.h:1075
PFS_byte_stat_row m_misc
Definition: table_helper.h:1074
PFS_byte_stat_row m_read
Definition: table_helper.h:1072
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:522
Row fragment for column HOST.
Definition: table_helper.h:530
void set_nullable_field(Field *f)
Definition: table_helper.cc:622
int make_row(PFS_host *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:615
PFS_host_name m_host_name
Column HOST.
Definition: table_helper.h:532
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:620
Per host statistics.
Definition: pfs_host.h:64
Definition: pfs_name.h:457
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:662
PFS_object_row m_object_row
Definition: table_helper.h:663
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1042
size_t m_index_name_length
Length in bytes of m_index_name.
Definition: table_helper.h:667
int make_row(PFS_table_share *pfs, PFS_table_share_index *pfs_index, uint table_index)
Definition: table_helper.cc:1028
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:1061
int make_index_name(PFS_table_share_index *pfs_index, uint table_index)
Build a row from a memory buffer.
Definition: table_helper.cc:1003
char m_index_name[NAME_LEN]
Column INDEX_NAME.
Definition: table_helper.h:665
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:681
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:1099
PFS_object_view_row m_object_row
Definition: table_helper.h:682
PFS_index_name_view m_index_name
Definition: table_helper.h:683
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1080
Information for all instrumentation.
Definition: pfs_instr_class.h:248
Name space, internal views used within table setup_instruments.
Definition: table_helper.h:492
static const uint VIEW_IDLE
Definition: table_helper.h:502
static const uint FIRST_INSTRUMENT
Definition: table_helper.h:493
static const uint VIEW_TRANSACTION
Definition: table_helper.h:513
static const uint LAST_VIEW
Definition: table_helper.h:504
static const uint VIEW_COND
Definition: table_helper.h:498
static const uint VIEW_MEMORY
Definition: table_helper.h:515
static const uint FIRST_VIEW
Definition: table_helper.h:495
static const uint VIEW_BUILTIN_MEMORY
Definition: table_helper.h:514
static const uint VIEW_ERROR
Definition: table_helper.h:516
static const uint VIEW_STAGE
Definition: table_helper.h:511
static const uint VIEW_METADATA
Definition: table_helper.h:503
static const uint VIEW_SOCKET
Definition: table_helper.h:501
static const uint VIEW_TABLE
Definition: table_helper.h:500
static const uint VIEW_RWLOCK
Definition: table_helper.h:497
static const uint VIEW_MUTEX
Definition: table_helper.h:496
static const uint LAST_INSTRUMENT
Definition: table_helper.h:518
static const uint VIEW_STATEMENT
Definition: table_helper.h:512
static const uint VIEW_FILE
Definition: table_helper.h:499
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:1094
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1440
PFS_memory_monitoring_stat m_stat
Definition: table_helper.h:1095
void set(const PFS_memory_monitoring_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:1098
Instrumented metadata lock implementation.
Definition: pfs_instr.h:318
Instrumentation metadata for a meter.
Definition: pfs_instr_class.h:429
Instrumentation metadata for a metric.
Definition: pfs_instr_class.h:406
Instrumented mutex implementation.
Definition: pfs_instr.h:103
Definition: pfs_name.h:386
Definition: pfs_name.h:344
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_helper.h:605
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:912
int make_row(PFS_table_share *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:738
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:896
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:609
PFS_object_name m_object_name
Column OBJECT_NAME.
Definition: table_helper.h:611
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:607
Name space, internal views used within object summaries.
Definition: table_helper.h:522
static const uint LAST_VIEW
Definition: table_helper.h:526
static const uint FIRST_VIEW
Definition: table_helper.h:523
static const uint VIEW_TABLE
Definition: table_helper.h:524
static const uint VIEW_PROGRAM
Definition: table_helper.h:525
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_helper.h:622
PFS_object_name_view m_object_name
Column OBJECT_NAME.
Definition: table_helper.h:628
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:932
PFS_schema_name_view m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:626
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:624
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:948
Definition: pfs_prepared_stmt.h:42
Definition: pfs_program.h:57
Definition: pfs_name.h:293
Instrumented rwlock implementation.
Definition: pfs_instr.h:129
Definition: pfs_name.h:221
Definition: pfs_name.h:194
Definition: table_helper.h:1104
size_t m_total_size
Definition: table_helper.h:1107
size_t m_max_total_size
Definition: table_helper.h:1108
void set(const PFS_session_all_memory_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.cc:1486
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1494
size_t m_controlled_size
Definition: table_helper.h:1105
size_t m_max_controlled_size
Definition: table_helper.h:1106
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:1048
PFS_byte_stat_row m_all
Definition: table_helper.h:1052
PFS_byte_stat_row m_misc
Definition: table_helper.h:1051
PFS_byte_stat_row m_read
Definition: table_helper.h:1049
void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat)
Definition: table_helper.h:1054
PFS_byte_stat_row m_write
Definition: table_helper.h:1050
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:968
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:977
void set(time_normalizer *normalizer, const PFS_sp_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:972
PFS_stat_row m_timer1_row
Definition: table_helper.h:969
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:863
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:872
PFS_stat_row m_timer1_row
Definition: table_helper.h:864
void set(time_normalizer *normalizer, const PFS_stage_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:867
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:691
ulonglong m_max
Column MAX_TIMER_WAIT.
Definition: table_helper.h:701
ulonglong m_count
Column COUNT_STAR.
Definition: table_helper.h:693
ulonglong m_avg
Column AVG_TIMER_WAIT.
Definition: table_helper.h:699
void set(time_normalizer *normalizer, const PFS_single_stat *stat)
Build a row with timer fields from a memory buffer.
Definition: table_helper.h:712
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:729
ulonglong m_sum
Column SUM_TIMER_WAIT.
Definition: table_helper.h:695
void reset()
Definition: table_helper.h:703
ulonglong m_min
Column MIN_TIMER_WAIT.
Definition: table_helper.h:697
Row fragment for statement statistics columns.
Definition: table_helper.h:876
ulonglong m_rows_affected
Definition: table_helper.h:880
ulonglong m_max_controlled_memory
Definition: table_helper.h:902
ulonglong m_max_total_memory
Definition: table_helper.h:903
ulonglong m_select_full_range_join
Definition: table_helper.h:887
ulonglong m_no_good_index_used
Definition: table_helper.h:896
ulonglong m_sort_scan
Definition: table_helper.h:894
void set(time_normalizer *normalizer, const PFS_statement_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:907
ulonglong m_count_secondary
Definition: table_helper.h:904
ulonglong m_rows_examined
Definition: table_helper.h:883
ulonglong m_cpu_time
CPU TIME.
Definition: table_helper.h:901
ulonglong m_select_scan
Definition: table_helper.h:890
ulonglong m_sort_rows
Definition: table_helper.h:893
ulonglong m_error_count
Definition: table_helper.h:878
ulonglong m_select_full_join
Definition: table_helper.h:886
ulonglong m_created_tmp_disk_tables
Definition: table_helper.h:884
ulonglong m_sort_range
Definition: table_helper.h:892
ulonglong m_lock_time
Definition: table_helper.h:881
ulonglong m_warning_count
Definition: table_helper.h:879
ulonglong m_no_index_used
Definition: table_helper.h:895
ulonglong m_sort_merge_passes
Definition: table_helper.h:891
ulonglong m_select_range_check
Definition: table_helper.h:889
ulonglong m_created_tmp_tables
Definition: table_helper.h:885
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1118
ulonglong m_rows_sent
Definition: table_helper.h:882
ulonglong m_select_range
Definition: table_helper.h:888
PFS_stat_row m_timer1_row
Definition: table_helper.h:877
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:765
PFS_stat_row m_all_write
Definition: table_helper.h:768
PFS_stat_row m_fetch
Definition: table_helper.h:769
PFS_stat_row m_all
Definition: table_helper.h:766
PFS_stat_row m_delete
Definition: table_helper.h:772
PFS_stat_row m_update
Definition: table_helper.h:771
PFS_stat_row m_all_read
Definition: table_helper.h:767
PFS_stat_row m_insert
Definition: table_helper.h:770
void set(time_normalizer *normalizer, const PFS_table_io_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:775
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:802
PFS_stat_row m_write_concurrent_insert
Definition: table_helper.h:812
PFS_stat_row m_read_with_shared_locks
Definition: table_helper.h:807
PFS_stat_row m_all_read
Definition: table_helper.h:804
PFS_stat_row m_all_write
Definition: table_helper.h:805
PFS_stat_row m_write_low_priority
Definition: table_helper.h:813
PFS_stat_row m_read_external
Definition: table_helper.h:810
PFS_stat_row m_read_high_priority
Definition: table_helper.h:808
PFS_stat_row m_read_no_insert
Definition: table_helper.h:809
PFS_stat_row m_write_normal
Definition: table_helper.h:814
PFS_stat_row m_read_normal
Definition: table_helper.h:806
void set(time_normalizer *normalizer, const PFS_table_lock_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:818
PFS_stat_row m_write_allow_write
Definition: table_helper.h:811
PFS_stat_row m_all
Definition: table_helper.h:803
PFS_stat_row m_write_external
Definition: table_helper.h:815
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:489
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:513
Instrumented table implementation.
Definition: pfs_instr.h:195
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:394
Instrumented thread implementation.
Definition: pfs_instr.h:375
Row fragment for transaction statistics columns.
Definition: table_helper.h:983
PFS_stat_row m_read_write_row
Definition: table_helper.h:985
ulonglong m_savepoint_count
Definition: table_helper.h:987
PFS_stat_row m_timer1_row
Definition: table_helper.h:984
PFS_stat_row m_read_only_row
Definition: table_helper.h:986
ulonglong m_release_savepoint_count
Definition: table_helper.h:989
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1202
ulonglong m_rollback_to_savepoint_count
Definition: table_helper.h:988
void set(time_normalizer *normalizer, const PFS_transaction_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:992
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:478
Row fragment for column USER.
Definition: table_helper.h:542
PFS_user_name m_user_name
Column USER.
Definition: table_helper.h:544
void set_nullable_field(Field *f)
Definition: table_helper.cc:633
int make_row(PFS_user *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:626
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:631
Definition: table_helper.h:1152
int make_row(const char *val, size_t length)
Definition: table_helper.cc:1603
PFS_user_variable_value_row()
Definition: table_helper.h:1154
void clear()
Definition: table_helper.cc:1597
size_t m_value_length
Definition: table_helper.h:1172
PFS_user_variable_value_row(const PFS_user_variable_value_row &rhs)
Definition: table_helper.h:1156
char * m_value
Definition: table_helper.h:1171
const char * get_value() const
Definition: table_helper.h:1164
size_t get_value_length() const
Definition: table_helper.h:1166
~PFS_user_variable_value_row()
Definition: table_helper.h:1160
Per user statistics.
Definition: pfs_user.h:63
Definition: table_helper.h:1117
PFS_variable_name_row()
Definition: table_helper.h:1119
char m_str[NAME_CHAR_LEN+1]
Definition: table_helper.h:1126
int make_row(const char *str, size_t length)
Definition: table_helper.cc:1558
uint m_length
Definition: table_helper.h:1127
Definition: table_helper.h:1130
const CHARSET_INFO * m_charset
Definition: table_helper.h:1149
uint get_length() const
Definition: table_helper.h:1142
int make_row(const Status_variable *var)
Set the row from a status variable.
Definition: table_helper.cc:1572
char m_str[1024]
Definition: table_helper.h:1147
const char * get_str() const
Definition: table_helper.h:1141
uint m_length
Definition: table_helper.h:1148
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:1593
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