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