MySQL 8.0.30
Source Code Documentation
table_helper.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
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 utf8 @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_utf8(Field *f, const char *str, uint len);
242
243/**
244 Helper, read a value from a @code char utf8 @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_utf8(Field *f, char *val, uint *len);
251
252/**
253 Helper, read a value from a @code char utf8 @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 utf8 @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, assign a value to a @code varchar utf8 @endcode field.
272 @param f the field to set
273 @param str the string to assign
274*/
275void set_field_varchar_utf8(Field *f, const char *str);
276
277/**
278 Helper, assign a value to a @code varchar utf8 @endcode field.
279 @param f the field to set
280 @param str the string to assign
281 @param len the length of the string to assign
282*/
283void set_field_varchar_utf8(Field *f, const char *str, size_t len);
284
285/**
286 Helper, read a value from a @code varchar utf8 @endcode field.
287 @param f the field to read
288 @param[out] val the field value
289 @return the field value
290*/
292
293/**
294 Helper, read a value from a @code varchar utf8 @endcode field.
295 @param f the field to read
296 @param[out] val the field value
297 @param[out] len field value length
298 @return the field value
299*/
300char *get_field_varchar_utf8(Field *f, char *val, uint *len);
301
302/**
303 Helper, assign a value to a @code varchar utf8mb4 @endcode field.
304 @param f the field to set
305 @param str the string to assign
306*/
307void set_field_varchar_utf8mb4(Field *f, const char *str);
308
309/**
310 Helper, assign a value to a @code varchar utf8mb4 @endcode field.
311 @param f the field to set
312 @param str the string to assign
313 @param len the length of the string to assign
314*/
315void set_field_varchar_utf8mb4(Field *f, const char *str, uint len);
316
317/**
318 Helper, assign a value to a text/blob field.
319 @param f the field to set
320 @param val the value to assign
321 @param len the length of the string to assign
322*/
323void set_field_blob(Field *f, const char *val, size_t len);
324
325/**
326 Helper, assign a value to a text field.
327 @param f the field to set
328 @param val the value to assign
329 @param len the length of the string to assign
330 @param cs the charset of the string
331*/
332void set_field_text(Field *f, const char *val, size_t len,
333 const CHARSET_INFO *cs);
334/**
335 Helper, read a value from a @c blob field.
336 @param f the field to read
337 @param[out] val the field value
338 @param[out] len field value length
339 @return the field value
340*/
341char *get_field_blob(Field *f, char *val, uint *len);
342
343/**
344 Helper, assign a value to an @c enum field.
345 @param f the field to set
346 @param value the value to assign
347*/
348void set_field_enum(Field *f, ulonglong value);
349
350/**
351 Helper, read a value from an @c enum field.
352 @param f the field to read
353 @return the field value
354*/
356
357/**
358 Helper, assign a value to a @c set field.
359 @param f the field to set
360 @param value the value to assign
361*/
362void set_field_set(Field *f, ulonglong value);
363
364/**
365 Helper, read a value from a @c set field.
366 @param f the field to read
367 @return the field value
368*/
370
371/**
372 Helper, assign a value to a @c date field.
373 @param f the field to set
374 @param value the value to assign
375 @param len length of the value
376*/
377void set_field_date(Field *f, const char *value, uint len);
378
379/**
380 Helper, read a value from an @c date field.
381 @param f the field to read
382 @param[out] val the field value
383 @param[out] len field value length
384 @return the field value
385*/
386char *get_field_date(Field *f, char *val, uint *len);
387
388/**
389 Helper, assign a value to a @c time field.
390 @param f the field to set
391 @param value the value to assign
392 @param len length of the value
393*/
394void set_field_time(Field *f, const char *value, uint len);
395
396/**
397 Helper, read a value from an @c time field.
398 @param f the field to read
399 @param[out] val the field value
400 @param[out] len field value length
401 @return the field value
402*/
403char *get_field_time(Field *f, char *val, uint *len);
404
405/**
406 Helper, assign a value to a @c datetime field.
407 @param f the field to set
408 @param value the value to assign
409 @param len length of the value
410*/
411void set_field_datetime(Field *f, const char *value, uint len);
412
413/**
414 Helper, read a value from an @c datetime field.
415 @param f the field to read
416 @param[out] val the field value
417 @param[out] len field value length
418 @return the field value
419*/
420char *get_field_datetime(Field *f, char *val, uint *len);
421
422/**
423 Helper, assign a value to a @c timestamp field.
424 @param f the field to set
425 @param value the value to assign
426*/
427void set_field_timestamp(Field *f, ulonglong value);
428
429/**
430 Helper, assign a value to a @c timestamp field.
431 @param f the field to set
432 @param value the value to assign
433 @param len length of the value
434*/
435void set_field_timestamp(Field *f, const char *value, uint len);
436
437/**
438 Helper, read a value from an @c timestamp field.
439 @param f the field to read
440 @param[out] val the field value
441 @param[out] len field value length
442 @return the field value
443*/
444char *get_field_timestamp(Field *f, char *val, uint *len);
445
446/**
447 Helper, assign a value to a @c year field.
448 @param f the field to set
449 @param value the value to assign
450*/
451void set_field_year(Field *f, ulong value);
452
453/**
454 Helper, read a value from an @c year field.
455 @param f the field to read
456 @return the field value
457*/
458ulong get_field_year(Field *f);
459
460/**
461 Helper, assign a value to a JSON field.
462 @param f the field to set
463 @param json the value to assign
464*/
465void set_field_json(Field *f, const Json_wrapper *json);
466
468void set_field_schema_name(Field *f, const PFS_schema_name *schema);
469
471void set_field_object_name(Field *f, const PFS_object_name *object);
472
474void set_field_routine_name(Field *f, const PFS_routine_name *object);
475
476/**
477 Helper, format sql text for output.
478
479 @param source_sqltext raw sqltext, possibly truncated
480 @param source_length length of source_sqltext
481 @param source_cs character set of source_sqltext
482 @param truncated true if source_sqltext was truncated
483 @param sqltext sqltext formatted for output
484 */
485void format_sqltext(const char *source_sqltext, size_t source_length,
486 const CHARSET_INFO *source_cs, bool truncated,
487 String &sqltext);
488
489/**
490 Create a SOURCE column from source file and line.
491
492 @param source_file source file name pointer from __FILE__
493 @param source_line line number
494 @param row_buffer target string buffer
495 @param row_buffer_size size of target buffer
496 @param row_length string length of combined source file and line
497*/
498void make_source_column(const char *source_file, size_t source_line,
499 char row_buffer[], size_t row_buffer_size,
500 uint &row_length);
501
502/** Name space, internal views used within table setup_instruments. */
504 static const uint FIRST_INSTRUMENT = 1;
505
506 static const uint FIRST_VIEW = 1;
507 static const uint VIEW_MUTEX = 1;
508 static const uint VIEW_RWLOCK = 2;
509 static const uint VIEW_COND = 3;
510 static const uint VIEW_FILE = 4;
511 static const uint VIEW_TABLE = 5;
512 static const uint VIEW_SOCKET = 6;
513 static const uint VIEW_IDLE = 7;
514 static const uint VIEW_METADATA = 8;
515 static const uint LAST_VIEW = 8;
516
517 /*
518 THREAD are displayed in table setup_threads
519 instead of setup_instruments.
520 */
521
522 static const uint VIEW_STAGE = 9;
523 static const uint VIEW_STATEMENT = 10;
524 static const uint VIEW_TRANSACTION = 11;
525 static const uint VIEW_BUILTIN_MEMORY = 12;
526 static const uint VIEW_MEMORY = 13;
527 static const uint VIEW_ERROR = 14;
528
529 static const uint LAST_INSTRUMENT = 14;
530};
531
532/** Name space, internal views used within object summaries. */
534 static const uint FIRST_VIEW = 1;
535 static const uint VIEW_TABLE = 1;
536 static const uint VIEW_PROGRAM = 2;
537 static const uint LAST_VIEW = 2;
538};
539
540/** Row fragment for column HOST. */
542 /** Column HOST. */
544
545 /** Build a row from a memory buffer. */
546 int make_row(PFS_host *pfs);
547 /** Set a table field from the row. */
548 void set_field(Field *f);
549 void set_nullable_field(Field *f);
550};
551
552/** Row fragment for column USER. */
554 /** Column USER. */
556
557 /** Build a row from a memory buffer. */
558 int make_row(PFS_user *pfs);
559 /** Set a table field from the row. */
560 void set_field(Field *f);
561 void set_nullable_field(Field *f);
562};
563
564/** Row fragment for columns USER, HOST. */
566 /** Column USER. */
568 /** Column HOST. */
570
571 /** Build a row from a memory buffer. */
573 /** Set a table field from the row. */
574 void set_field(uint index, Field *f);
575 void set_nullable_field(uint index, Field *f);
576};
577
578/** Row fragment for columns DIGEST, DIGEST_TEXT. */
580 /** Column SCHEMA_NAME. */
582 /** Column DIGEST. */
584 /** Length in bytes of @c m_digest. */
586 /** Column DIGEST_TEXT. */
588
589 /** Build a row from a memory buffer. */
591 /** Set a table field from the row. */
592 void set_field(uint index, Field *f);
593};
594
595/** Row fragment for column EVENT_NAME. */
597 /** Column EVENT_NAME. */
598 const char *m_name;
599 /** Length in bytes of @c m_name. */
601
602 /** Build a row from a memory buffer. */
604 m_name = pfs->m_name.str();
605 m_name_length = pfs->m_name.length();
606 return 0;
607 }
608
609 /** Set a table field from the row. */
610 inline void set_field(Field *f) {
612 }
613};
614
615/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
617 /** Column OBJECT_TYPE. */
619 /** Column SCHEMA_NAME. */
621 /** Column OBJECT_NAME. */
623
624 /** Build a row from a memory buffer. */
627 /** Set a table field from the row. */
628 void set_field(uint index, Field *f);
629 void set_nullable_field(uint index, Field *f);
630};
631
632/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, COLUMN_NAME.
633 */
635 /** Column OBJECT_TYPE. */
637 /** Column SCHEMA_NAME. */
639 /** Length in bytes of @c m_schema_name. */
641 /** Column OBJECT_NAME. */
643 /** Length in bytes of @c m_object_name. */
645 /** Column OBJECT_NAME. */
647 /** Length in bytes of @c m_column_name. */
649
650 /** Build a row from a memory buffer. */
651 int make_row(const MDL_key *pfs);
652 /** Set a table field from the row. */
653 void set_nullable_field(uint index, Field *f);
654};
655
656/** Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
657 */
660 /** Column INDEX_NAME. */
662 /** Length in bytes of @c m_index_name. */
664
665 /** Build a row from a memory buffer. */
666 int make_index_name(PFS_table_share_index *pfs_index, uint table_index);
668 uint table_index);
669 /** Set a table field from the row. */
670 void set_field(uint index, Field *f);
671 void set_nullable_field(uint index, Field *f);
672};
673
674/** Row fragment for single statistics columns (COUNT, SUM, MIN, AVG, MAX) */
676 /** Column COUNT_STAR. */
678 /** Column SUM_TIMER_WAIT. */
680 /** Column MIN_TIMER_WAIT. */
682 /** Column AVG_TIMER_WAIT. */
684 /** Column MAX_TIMER_WAIT. */
686
687 inline void reset() {
688 m_count = 0;
689 m_sum = 0;
690 m_min = 0;
691 m_avg = 0;
692 m_max = 0;
693 }
694
695 /** Build a row with timer fields from a memory buffer. */
696 inline void set(time_normalizer *normalizer, const PFS_single_stat *stat) {
697 m_count = stat->m_count;
698
699 if ((m_count != 0) && stat->has_timed_stats()) {
700 m_sum = normalizer->wait_to_pico(stat->m_sum);
701 m_min = normalizer->wait_to_pico(stat->m_min);
702 m_max = normalizer->wait_to_pico(stat->m_max);
703 m_avg = normalizer->wait_to_pico(stat->m_sum / m_count);
704 } else {
705 m_sum = 0;
706 m_min = 0;
707 m_avg = 0;
708 m_max = 0;
709 }
710 }
711
712 /** Set a table field from the row. */
713 void set_field(uint index, Field *f) {
714 switch (index) {
715 case 0: /* COUNT */
717 break;
718 case 1: /* SUM */
720 break;
721 case 2: /* MIN */
723 break;
724 case 3: /* AVG */
726 break;
727 case 4: /* MAX */
729 break;
730 default:
731 assert(false);
732 }
733 }
734};
735
736/** Row fragment for timer and byte count stats. Corresponds to PFS_byte_stat */
740
741 /** Build a row with timer and byte count fields from a memory buffer. */
742 inline void set(time_normalizer *normalizer, const PFS_byte_stat *stat) {
743 m_waits.set(normalizer, stat);
744 m_bytes = stat->m_bytes;
745 }
746};
747
748/** Row fragment for table I/O statistics columns. */
757
758 /** Build a row from a memory buffer. */
759 inline void set(time_normalizer *normalizer, const PFS_table_io_stat *stat) {
760 PFS_single_stat all_read;
761 PFS_single_stat all_write;
763
764 m_fetch.set(normalizer, &stat->m_fetch);
765
766 all_read.aggregate(&stat->m_fetch);
767
768 m_insert.set(normalizer, &stat->m_insert);
769 m_update.set(normalizer, &stat->m_update);
770 m_delete.set(normalizer, &stat->m_delete);
771
772 all_write.aggregate(&stat->m_insert);
773 all_write.aggregate(&stat->m_update);
774 all_write.aggregate(&stat->m_delete);
775
776 all.aggregate(&all_read);
777 all.aggregate(&all_write);
778
779 m_all_read.set(normalizer, &all_read);
780 m_all_write.set(normalizer, &all_write);
781 m_all.set(normalizer, &all);
782 }
783};
784
785/** Row fragment for table lock statistics columns. */
800
801 /** Build a row from a memory buffer. */
802 inline void set(time_normalizer *normalizer,
803 const PFS_table_lock_stat *stat) {
804 PFS_single_stat all_read;
805 PFS_single_stat all_write;
807
808 m_read_normal.set(normalizer, &stat->m_stat[PFS_TL_READ]);
809 m_read_with_shared_locks.set(normalizer,
811 m_read_high_priority.set(normalizer,
814 m_read_external.set(normalizer, &stat->m_stat[PFS_TL_READ_EXTERNAL]);
815
816 all_read.aggregate(&stat->m_stat[PFS_TL_READ]);
819 all_read.aggregate(&stat->m_stat[PFS_TL_READ_NO_INSERT]);
820 all_read.aggregate(&stat->m_stat[PFS_TL_READ_EXTERNAL]);
821
822 m_write_allow_write.set(normalizer,
825 normalizer, &stat->m_stat[PFS_TL_WRITE_CONCURRENT_INSERT]);
826 m_write_low_priority.set(normalizer,
828 m_write_normal.set(normalizer, &stat->m_stat[PFS_TL_WRITE]);
830
831 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_ALLOW_WRITE]);
833 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_LOW_PRIORITY]);
834 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE]);
835 all_write.aggregate(&stat->m_stat[PFS_TL_WRITE_EXTERNAL]);
836
837 all.aggregate(&all_read);
838 all.aggregate(&all_write);
839
840 m_all_read.set(normalizer, &all_read);
841 m_all_write.set(normalizer, &all_write);
842 m_all.set(normalizer, &all);
843 }
844};
845
846/** Row fragment for stage statistics columns. */
849
850 /** Build a row from a memory buffer. */
851 inline void set(time_normalizer *normalizer, const PFS_stage_stat *stat) {
852 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
853 }
854
855 /** Set a table field from the row. */
856 void set_field(uint index, Field *f) { m_timer1_row.set_field(index, f); }
857};
858
859/** Row fragment for statement statistics columns. */
881 /**
882 CPU TIME.
883 Expressed in DISPLAY units (picoseconds).
884 */
887
888 /** Build a row from a memory buffer. */
889 inline void set(time_normalizer *normalizer, const PFS_statement_stat *stat) {
890 if (stat->m_timer1_stat.m_count != 0) {
891 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
892
897 m_rows_sent = stat->m_rows_sent;
908 m_sort_rows = stat->m_sort_rows;
909 m_sort_scan = stat->m_sort_scan;
914 } else {
916
917 m_error_count = 0;
918 m_warning_count = 0;
919 m_lock_time = 0;
920 m_rows_affected = 0;
921 m_rows_sent = 0;
922 m_rows_examined = 0;
927 m_select_range = 0;
929 m_select_scan = 0;
931 m_sort_range = 0;
932 m_sort_rows = 0;
933 m_sort_scan = 0;
934 m_no_index_used = 0;
936 m_cpu_time = 0;
938 }
939 }
940
941 /** Set a table field from the row. */
942 void set_field(uint index, Field *f);
943};
944
945/** Row fragment for stored program statistics. */
948
949 /** Build a row from a memory buffer. */
950 inline void set(time_normalizer *normalizer, const PFS_sp_stat *stat) {
951 m_timer1_row.set(normalizer, &stat->m_timer1_stat);
952 }
953
954 /** Set a table field from the row. */
955 inline void set_field(uint index, Field *f) {
956 m_timer1_row.set_field(index, f);
957 }
958};
959
960/** Row fragment for transaction statistics columns. */
968
969 /** Build a row from a memory buffer. */
970 inline void set(time_normalizer *normalizer,
971 const PFS_transaction_stat *stat) {
972 /* Combine read write/read only stats */
974 all.aggregate(&stat->m_read_only_stat);
975 all.aggregate(&stat->m_read_write_stat);
976
977 m_timer1_row.set(normalizer, &all);
978 m_read_write_row.set(normalizer, &stat->m_read_write_stat);
979 m_read_only_row.set(normalizer, &stat->m_read_only_stat);
980 }
981
982 /** Set a table field from the row. */
983 void set_field(uint index, Field *f);
984};
985
986/** Row fragment for error statistics columns. */
993
994 /** Build a row from a memory buffer. */
995 inline void set(const PFS_error_single_stat *stat, uint error_index) {
996 m_count = stat->m_count;
998 m_error_index = error_index;
1000 m_last_seen = stat->m_last_seen;
1001 }
1002
1003 /** Set a table field from the row. */
1004 void set_field(uint index, Field *f, server_error *temp_error);
1005};
1006
1007/** Row fragment for connection statistics. */
1011
1012 inline void set(const PFS_connection_stat *stat) {
1015 }
1016
1017 /** Set a table field from the row. */
1018 void set_field(uint index, Field *f);
1019};
1020
1021void set_field_object_type(Field *f, enum_object_type object_type);
1022void set_field_lock_type(Field *f, PFS_TL_LOCK_TYPE lock_type);
1023void set_field_mdl_type(Field *f, opaque_mdl_type mdl_type);
1024void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration);
1025void set_field_mdl_status(Field *f, opaque_mdl_status mdl_status);
1028
1029/** Row fragment for socket I/O statistics columns. */
1035
1036 inline void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat) {
1038
1039 m_read.set(normalizer, &stat->m_read);
1040 m_write.set(normalizer, &stat->m_write);
1041 m_misc.set(normalizer, &stat->m_misc);
1042
1043 /* Combine stats for all operations */
1044 all.aggregate(&stat->m_read);
1045 all.aggregate(&stat->m_write);
1046 all.aggregate(&stat->m_misc);
1047
1048 m_all.set(normalizer, &all);
1049 }
1050};
1051
1052/** Row fragment for file I/O statistics columns. */
1058
1059 inline void set(time_normalizer *normalizer, const PFS_file_io_stat *stat) {
1061
1062 m_read.set(normalizer, &stat->m_read);
1063 m_write.set(normalizer, &stat->m_write);
1064 m_misc.set(normalizer, &stat->m_misc);
1065
1066 /* Combine stats for all operations */
1067 all.aggregate(&stat->m_read);
1068 all.aggregate(&stat->m_write);
1069 all.aggregate(&stat->m_misc);
1070
1071 m_all.set(normalizer, &all);
1072 }
1073};
1074
1075/** Row fragment for memory statistics columns. */
1078
1079 /** Build a row from a memory buffer. */
1080 inline void set(const PFS_memory_monitoring_stat *stat) { m_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 } else {
1375 return (reader.read_varchar_utf8(find_flag, is_null, key_value,
1376 key_value_length, key_value_max_length));
1377 }
1378 }
1379
1380 static bool stateless_match(bool record_null, const char *record_string,
1381 size_t record_string_length,
1382 const char *m_key_value,
1383 size_t m_key_value_length, bool m_is_null,
1385
1386 protected:
1387 bool do_match(bool record_null, const char *record_value,
1388 size_t record_value_length);
1389 bool do_match_prefix(bool record_null, const char *record_value,
1390 size_t record_value_length);
1391};
1392
1393template <int SIZE>
1395 public:
1396 explicit PFS_key_string(const char *name)
1398
1399 ~PFS_key_string() override = default;
1400
1401 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1402 m_find_flag = stateless_read(reader, find_flag, m_is_null, m_key_value,
1404 }
1405
1406 protected:
1407 bool do_match(bool record_null, const char *record_value,
1408 size_t record_value_length) {
1409 return stateless_match(record_null, record_value, record_value_length,
1411 m_find_flag);
1412 }
1413 bool do_match_prefix(bool record_null, const char *record_value,
1414 size_t record_value_length);
1415
1416 private:
1419};
1420
1421class PFS_key_thread_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1422 public:
1423 explicit PFS_key_thread_name(const char *name) : PFS_key_string(name) {}
1424
1425 ~PFS_key_thread_name() override = default;
1426
1427 bool match(const PFS_thread *pfs);
1428 bool match(const PFS_thread_class *klass);
1429};
1430
1431class PFS_key_event_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1432 public:
1433 explicit PFS_key_event_name(const char *name) : PFS_key_string(name) {}
1434
1435 ~PFS_key_event_name() override = default;
1436
1437 bool match(const PFS_instr_class *klass);
1438 bool match(const PFS_mutex *pfs);
1439 bool match(const PFS_rwlock *pfs);
1440 bool match(const PFS_cond *pfs);
1441 bool match(const PFS_file *pfs);
1442 bool match(const PFS_socket *pfs);
1443 bool match_view(uint view);
1444};
1445
1446class PFS_key_user : public PFS_key_string<USERNAME_LENGTH> {
1447 public:
1448 explicit PFS_key_user(const char *name) : PFS_key_string(name) {}
1449
1450 ~PFS_key_user() override = default;
1451
1452 bool match(const PFS_thread *pfs);
1453 bool match(const PFS_user *pfs);
1454 bool match(const PFS_account *pfs);
1455 bool match(const PFS_setup_actor *pfs);
1456};
1457
1458class PFS_key_host : public PFS_key_string<HOSTNAME_LENGTH> {
1459 public:
1460 explicit PFS_key_host(const char *name) : PFS_key_string(name) {}
1461
1462 ~PFS_key_host() override = default;
1463
1464 bool match(const PFS_thread *pfs);
1465 bool match(const PFS_host *pfs);
1466 bool match(const PFS_account *pfs);
1467 bool match(const PFS_setup_actor *pfs);
1468 bool match(const char *host, size_t host_length);
1469};
1470
1471class PFS_key_role : public PFS_key_string<ROLENAME_LENGTH> {
1472 public:
1473 explicit PFS_key_role(const char *name) : PFS_key_string(name) {}
1474
1475 ~PFS_key_role() override = default;
1476
1477 bool match(const PFS_setup_actor *pfs);
1478};
1479
1480class PFS_key_schema : public PFS_key_string<NAME_CHAR_LEN> {
1481 public:
1482 explicit PFS_key_schema(const char *schema) : PFS_key_string(schema) {}
1483
1484 ~PFS_key_schema() override = default;
1485
1487};
1488
1489class PFS_key_digest : public PFS_key_string<MAX_KEY_LENGTH> {
1490 public:
1491 explicit PFS_key_digest(const char *digest) : PFS_key_string(digest) {}
1492
1493 ~PFS_key_digest() override = default;
1494
1496};
1497
1499 public:
1500 explicit PFS_key_bucket_number(const char *name) : PFS_key_ulong(name) {}
1501
1502 ~PFS_key_bucket_number() override = default;
1503
1504 bool match(ulong value);
1505};
1506
1507/* Generic NAME key */
1508class PFS_key_name : public PFS_key_string<NAME_CHAR_LEN> {
1509 public:
1510 explicit PFS_key_name(const char *name) : PFS_key_string(name) {}
1511
1512 ~PFS_key_name() override = default;
1513
1514 bool match(const LEX_CSTRING *name);
1515 bool match(const char *name, size_t name_length);
1516 bool match_not_null(const LEX_STRING *name);
1517 bool match_not_null(const char *name, size_t name_length);
1518};
1519
1520class PFS_key_group_name : public PFS_key_string<NAME_CHAR_LEN> {
1521 public:
1522 explicit PFS_key_group_name(const char *name) : PFS_key_string(name) {}
1523
1524 ~PFS_key_group_name() override = default;
1525
1526 bool match(const LEX_STRING *name);
1527 bool match(const char *name, size_t name_length);
1528 bool match(PFS_thread *pfs);
1529};
1530
1531class PFS_key_variable_name : public PFS_key_string<NAME_CHAR_LEN> {
1532 public:
1533 explicit PFS_key_variable_name(const char *name) : PFS_key_string(name) {}
1534
1535 ~PFS_key_variable_name() override = default;
1536
1537 bool match(const System_variable *pfs);
1538 bool match(const Status_variable *pfs);
1539 bool match(const PFS_variable_name_row *pfs);
1540};
1541
1542// FIXME: 32
1544 public:
1545 explicit PFS_key_engine_name(const char *name) : PFS_key_string(name) {}
1546
1547 ~PFS_key_engine_name() override = default;
1548
1549 bool match(const char *engine_name, size_t length);
1550};
1551
1552// FIXME: 128
1554 public:
1556
1557 ~PFS_key_engine_lock_id() override = default;
1558
1559 bool match(const char *engine_lock_id, size_t length);
1560};
1561
1562class PFS_key_ip : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> // FIXME
1563// <INET6_ADDRSTRLEN+1>
1564// fails on freebsd
1565{
1566 public:
1567 explicit PFS_key_ip(const char *name) : PFS_key_string(name) {}
1568
1569 ~PFS_key_ip() override = default;
1570
1571 bool match(const PFS_socket *pfs);
1572 bool match(const char *ip, size_t ip_length);
1573};
1574
1575class PFS_key_statement_name : public PFS_key_string<PFS_MAX_INFO_NAME_LENGTH> {
1576 public:
1578
1579 ~PFS_key_statement_name() override = default;
1580
1581 bool match(const PFS_prepared_stmt *pfs);
1582};
1583
1585 : public PFS_key_string<1350> // FIXME FN_REFLEN or FN_REFLEN_SE
1586{
1587 public:
1588 explicit PFS_key_file_name(const char *name) : PFS_key_string(name) {}
1589
1590 ~PFS_key_file_name() override = default;
1591
1592 bool match(const PFS_file *pfs);
1593};
1594
1595class PFS_key_object_schema : public PFS_key_string<NAME_CHAR_LEN> {
1596 public:
1597 explicit PFS_key_object_schema(const char *name) : PFS_key_string(name) {}
1598
1599 ~PFS_key_object_schema() override = default;
1600
1601 bool match(const PFS_table_share *pfs);
1602 bool match(const PFS_program *pfs);
1603 bool match(const PFS_prepared_stmt *pfs);
1604 bool match(const PFS_object_row *pfs);
1605 bool match(const PFS_column_row *pfs);
1606 bool match(const PFS_setup_object *pfs);
1607 bool match(const char *schema_name, size_t schema_name_length);
1608};
1609
1610class PFS_key_object_name : public PFS_key_string<NAME_CHAR_LEN> {
1611 public:
1612 explicit PFS_key_object_name(const char *name) : PFS_key_string(name) {}
1613
1614 ~PFS_key_object_name() override = default;
1615
1616 bool match(const PFS_table_share *pfs);
1617 bool match(const PFS_program *pfs);
1618 bool match(const PFS_prepared_stmt *pfs);
1619 bool match(const PFS_object_row *pfs);
1620 bool match(const PFS_column_row *pfs);
1621 bool match(const PFS_index_row *pfs);
1622 bool match(const PFS_setup_object *pfs);
1623 bool match(const char *schema_name, size_t schema_name_length);
1624};
1625
1626class PFS_key_column_name : public PFS_key_string<NAME_CHAR_LEN> {
1627 public:
1628 explicit PFS_key_column_name(const char *name) : PFS_key_string(name) {}
1629
1630 ~PFS_key_column_name() override = default;
1631
1632 bool match(const PFS_column_row *pfs);
1633};
1634
1636 public:
1637 explicit PFS_key_object_type(const char *name)
1639
1640 ~PFS_key_object_type() override = default;
1641
1642 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override;
1643
1644 bool match(enum_object_type object_type);
1645 bool match(const PFS_object_row *pfs);
1646 bool match(const PFS_column_row *pfs);
1647 bool match(const PFS_program *pfs);
1648
1649 private:
1650 bool do_match(bool record_null, enum_object_type object_type);
1652};
1653
1655 public:
1656 explicit PFS_key_object_type_enum(const char *name)
1658
1659 ~PFS_key_object_type_enum() override = default;
1660
1661 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override;
1662
1663 bool match(enum_object_type object_type);
1664 bool match(const PFS_prepared_stmt *pfs);
1665 bool match(const PFS_object_row *pfs);
1666 bool match(const PFS_program *pfs);
1667
1668 private:
1669 bool do_match(bool record_null, enum_object_type object_type);
1671};
1672
1674 public:
1675 explicit PFS_key_object_instance(const char *name)
1677
1678 ~PFS_key_object_instance() override = default;
1679
1680 void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override {
1681 ulonglong object_instance_begin{0};
1682 m_find_flag =
1683 reader.read_ulonglong(find_flag, m_is_null, &object_instance_begin);
1684 m_identity = (void *)object_instance_begin;
1685 }
1686
1687 bool match(const PFS_table *pfs);
1688 bool match(const PFS_mutex *pfs);
1689 bool match(const PFS_rwlock *pfs);
1690 bool match(const PFS_cond *pfs);
1691 bool match(const PFS_file *pfs);
1692 bool match(const PFS_socket *pfs);
1693 bool match(const PFS_prepared_stmt *pfs);
1694 bool match(const PFS_metadata_lock *pfs);
1695
1696 const void *m_identity;
1697};
1698
1699/** @} */
1700
1701#endif
Definition: field.h:573
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:1498
PFS_key_bucket_number(const char *name)
Definition: table_helper.h:1500
~PFS_key_bucket_number() override=default
bool match(ulong value)
Definition: table_helper.cc:2017
Definition: table_helper.h:1626
~PFS_key_column_name() override=default
PFS_key_column_name(const char *name)
Definition: table_helper.h:1628
bool match(const PFS_column_row *pfs)
Definition: table_helper.cc:2321
Definition: table_helper.h:1489
PFS_key_digest(const char *digest)
Definition: table_helper.h:1491
bool match(PFS_statements_digest_stat *pfs)
Definition: table_helper.cc:2008
~PFS_key_digest() override=default
Definition: table_helper.h:1553
~PFS_key_engine_lock_id() override=default
bool match(const char *engine_lock_id, size_t length)
Definition: table_helper.cc:2071
PFS_key_engine_lock_id(const char *name)
Definition: table_helper.h:1555
Definition: table_helper.h:1543
PFS_key_engine_name(const char *name)
Definition: table_helper.h:1545
~PFS_key_engine_name() override=default
bool match(const char *engine_name, size_t length)
Definition: table_helper.cc:2067
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:1757
Definition: table_helper.h:1351
bool match_error_index(uint error_index)
Definition: table_helper.cc:1798
~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:1722
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:1737
Definition: table_helper.h:1431
PFS_key_event_name(const char *name)
Definition: table_helper.h:1433
bool match(const PFS_instr_class *klass)
Definition: table_helper.cc:1821
bool match_view(uint view)
Definition: table_helper.cc:1866
~PFS_key_event_name() override=default
Definition: table_helper.h:1586
bool match(const PFS_file *pfs)
Definition: table_helper.cc:2097
PFS_key_file_name(const char *name)
Definition: table_helper.h:1588
~PFS_key_file_name() override=default
Definition: table_helper.h:1520
bool match(const LEX_STRING *name)
Definition: table_helper.cc:2039
~PFS_key_group_name() override=default
PFS_key_group_name(const char *name)
Definition: table_helper.h:1522
Definition: table_helper.h:1458
~PFS_key_host() override=default
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1967
PFS_key_host(const char *name)
Definition: table_helper.h:1460
Definition: table_helper.h:1565
~PFS_key_ip() override=default
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:2075
PFS_key_ip(const char *name)
Definition: table_helper.h:1567
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:1498
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:1510
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:1508
~PFS_key_name() override=default
bool match(const LEX_CSTRING *name)
Definition: table_helper.cc:2021
PFS_key_name(const char *name)
Definition: table_helper.h:1510
bool match_not_null(const LEX_STRING *name)
Definition: table_helper.cc:2031
Definition: table_helper.h:1673
PFS_key_object_instance(const char *name)
Definition: table_helper.h:1675
~PFS_key_object_instance() override=default
bool match(const PFS_table *pfs)
Definition: table_helper.cc:2326
const void * m_identity
Definition: table_helper.h:1696
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1680
Definition: table_helper.h:1610
~PFS_key_object_name() override=default
bool match(const PFS_table_share *pfs)
Definition: table_helper.cc:2278
PFS_key_object_name(const char *name)
Definition: table_helper.h:1612
Definition: table_helper.h:1595
PFS_key_object_schema(const char *name)
Definition: table_helper.h:1597
~PFS_key_object_schema() override=default
bool match(const PFS_table_share *pfs)
Definition: table_helper.cc:2240
Definition: table_helper.h:1654
enum_object_type m_object_type
Definition: table_helper.h:1670
~PFS_key_object_type_enum() override=default
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.cc:2172
PFS_key_object_type_enum(const char *name)
Definition: table_helper.h:1656
bool match(enum_object_type object_type)
Definition: table_helper.cc:2185
bool do_match(bool record_null, enum_object_type object_type)
Definition: table_helper.cc:2205
Definition: table_helper.h:1635
PFS_key_object_type(const char *name)
Definition: table_helper.h:1637
enum_object_type m_object_type
Definition: table_helper.h:1651
bool do_match(bool record_null, enum_object_type object_type)
Definition: table_helper.cc:2137
bool match(enum_object_type object_type)
Definition: table_helper.cc:2117
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.cc:2101
~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:1780
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:1752
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:1591
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:1471
PFS_key_role(const char *name)
Definition: table_helper.h:1473
bool match(const PFS_setup_actor *pfs)
Definition: table_helper.cc:1996
~PFS_key_role() override=default
Definition: table_helper.h:1480
bool match(const PFS_statements_digest_stat *pfs)
Definition: table_helper.cc:2002
~PFS_key_schema() override=default
PFS_key_schema(const char *schema)
Definition: table_helper.h:1482
Definition: table_helper.h:1326
bool match(const PFS_socket *pfs)
Definition: table_helper.cc:1775
~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:1766
PFS_key_statement_id(const char *name)
Definition: table_helper.h:1310
~PFS_key_statement_id() override=default
Definition: table_helper.h:1575
~PFS_key_statement_name() override=default
bool match(const PFS_prepared_stmt *pfs)
Definition: table_helper.cc:2093
PFS_key_statement_name(const char *name)
Definition: table_helper.h:1577
Definition: table_helper.h:1394
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1401
PFS_key_string(const char *name)
Definition: table_helper.h:1396
bool do_match(bool record_null, const char *record_value, size_t record_value_length)
Definition: table_helper.h:1407
bool do_match_prefix(bool record_null, const char *record_value, size_t record_value_length)
Definition: table_helper.cc:1642
~PFS_key_string() override=default
char m_key_value[SIZE *FILENAME_CHARSET_MBMAXLEN]
Definition: table_helper.h:1417
uint m_key_value_length
Definition: table_helper.h:1418
Definition: table_helper.h:1250
bool match_owner(const PFS_table *pfs)
Definition: table_helper.cc:1671
~PFS_key_thread_id() override=default
bool match_writer(const PFS_rwlock *pfs)
Definition: table_helper.cc:1712
bool match(ulonglong thread_id)
Definition: table_helper.cc:1661
PFS_key_thread_id(const char *name)
Definition: table_helper.h:1252
Definition: table_helper.h:1421
~PFS_key_thread_name() override=default
PFS_key_thread_name(const char *name)
Definition: table_helper.h:1423
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1808
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:1761
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:1504
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:1523
Definition: table_helper.h:1228
~PFS_key_ulonglong() override=default
bool do_match(bool record_null, ulonglong record_value)
Definition: table_helper.cc:1557
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:1516
void read(PFS_key_reader &reader, enum ha_rkey_function find_flag) override
Definition: table_helper.h:1235
Definition: table_helper.h:1446
PFS_key_user(const char *name)
Definition: table_helper.h:1448
~PFS_key_user() override=default
bool match(const PFS_thread *pfs)
Definition: table_helper.cc:1943
Definition: table_helper.h:1531
bool match(const System_variable *pfs)
Definition: table_helper.cc:2054
PFS_key_variable_name(const char *name)
Definition: table_helper.h:1533
~PFS_key_variable_name() override=default
Definition: table_helper.h:1317
bool match_not_null(ulonglong worker_id)
Definition: table_helper.cc:1771
~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:209
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:170
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:669
@ PFS_TL_READ_EXTERNAL
Definition: pfs_stat.h:681
@ PFS_TL_READ_NO_INSERT
Definition: pfs_stat.h:674
@ PFS_TL_WRITE_LOW_PRIORITY
Definition: pfs_stat.h:677
@ PFS_TL_READ
Definition: pfs_stat.h:671
@ PFS_TL_WRITE_EXTERNAL
Definition: pfs_stat.h:682
@ PFS_TL_READ_HIGH_PRIORITY
Definition: pfs_stat.h:673
@ PFS_TL_WRITE_ALLOW_WRITE
Definition: pfs_stat.h:675
@ PFS_TL_WRITE
Definition: pfs_stat.h:678
@ PFS_TL_READ_WITH_SHARED_LOCKS
Definition: pfs_stat.h:672
@ PFS_TL_WRITE_CONCURRENT_INSERT
Definition: pfs_stat.h:676
enum ha_rkey_function read_long(enum ha_rkey_function find_flag, bool &isnull, long *value)
Definition: pfs_engine_table.cc:1322
enum ha_rkey_function read_ulong(enum ha_rkey_function find_flag, bool &isnull, ulong *value)
Definition: pfs_engine_table.cc:1327
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:1424
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:1372
enum ha_rkey_function read_longlong(enum ha_rkey_function find_flag, bool &isnull, longlong *value)
Definition: pfs_engine_table.cc:1332
enum ha_rkey_function read_ulonglong(enum ha_rkey_function find_flag, bool &isnull, ulonglong *value)
Definition: pfs_engine_table.cc:1337
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:280
ulonglong get_field_enum(Field *f)
Helper, read a value from an enum field.
Definition: table_helper.cc:324
char * get_field_char_utf8(Field *f, char *val, uint *len)
Helper, read a value from a.
Definition: table_helper.cc:234
void set_field_date(Field *f, const char *value, uint len)
Helper, assign a value to a date field.
Definition: table_helper.cc:344
char * get_field_timestamp(Field *f, char *val, uint *len)
Helper, read a value from an timestamp field.
Definition: table_helper.cc:401
void set_field_utiny(Field *f, ulong value)
Helper, assign a value to a unsigned tinyint field.
Definition: table_helper.cc:63
void set_field_time(Field *f, const char *value, uint len)
Helper, assign a value to a time field.
Definition: table_helper.cc:361
char * get_field_blob(Field *f, char *val, uint *len)
Helper, read a value from a blob field.
Definition: table_helper.cc:307
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:464
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:318
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:552
char * get_field_datetime(Field *f, char *val, uint *len)
Helper, read a value from an datetime field.
Definition: table_helper.cc:384
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:331
void set_field_xa_state(Field *f, enum_xa_transaction_state xa_state)
Definition: table_helper.cc:1375
void set_field_isolation_level(Field *f, enum_isolation_level iso_level)
Definition: table_helper.cc:1356
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:293
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:367
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:420
void set_nullable_field_object_name(Field *f, const PFS_object_name *object)
Definition: table_helper.cc:454
void set_field_double(Field *f, double value)
Helper, assign a value to a double field.
Definition: table_helper.cc:208
void set_field_char_utf8(Field *f, const char *str, uint len)
Helper, assign a value to a.
Definition: table_helper.cc:221
String * get_field_varchar_utf8(Field *f, String *val)
Helper, read a value from a.
Definition: table_helper.cc:264
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:439
void set_field_datetime(Field *f, const char *value, uint len)
Helper, assign a value to a datetime field.
Definition: table_helper.cc:378
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:449
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:514
void set_field_routine_name(Field *f, const PFS_routine_name *object)
Definition: table_helper.cc:479
void set_field_json(Field *f, const Json_wrapper *json)
Helper, assign a value to a JSON field.
Definition: table_helper.cc:433
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:426
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:469
char * get_field_date(Field *f, char *val, uint *len)
Helper, read a value from an date field.
Definition: table_helper.cc:350
void set_field_timestamp(Field *f, ulonglong value)
Helper, assign a value to a timestamp field.
Definition: table_helper.cc:411
void set_field_object_type(Field *f, enum_object_type object_type)
Definition: table_helper.cc:1176
void set_field_varchar_utf8(Field *f, const char *str)
Helper, assign a value to 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:300
ulonglong get_field_set(Field *f)
Helper, read a value from a set field.
Definition: table_helper.cc:337
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:1055
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:354
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:565
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:604
PFS_user_name m_user_name
Column USER.
Definition: table_helper.h:567
PFS_host_name m_host_name
Column HOST.
Definition: table_helper.h:569
int make_row(PFS_account *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:598
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:618
Per account statistics.
Definition: pfs_account.h:66
Row fragment for timer and byte count stats.
Definition: table_helper.h:737
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:742
ulonglong m_bytes
Definition: table_helper.h:739
PFS_stat_row m_waits
Definition: table_helper.h:738
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:634
char m_column_name[NAME_LEN]
Column OBJECT_NAME.
Definition: table_helper.h:646
char m_schema_name[NAME_LEN]
Column SCHEMA_NAME.
Definition: table_helper.h:638
size_t m_column_name_length
Length in bytes of m_column_name.
Definition: table_helper.h:648
void set_nullable_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:887
size_t m_schema_name_length
Length in bytes of m_schema_name.
Definition: table_helper.h:640
int make_row(const MDL_key *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:714
size_t m_object_name_length
Length in bytes of m_object_name.
Definition: table_helper.h:644
char m_object_name[NAME_LEN]
Column OBJECT_NAME.
Definition: table_helper.h:642
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:636
Instrumented condition implementation.
Definition: pfs_instr.h:159
Row fragment for connection statistics.
Definition: table_helper.h:1008
ulonglong m_current_connections
Definition: table_helper.h:1009
ulonglong m_total_connections
Definition: table_helper.h:1010
void set(const PFS_connection_stat *stat)
Definition: table_helper.h:1012
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1162
Connections statistics.
Definition: pfs_stat.h:1044
ulonglong m_current_connections
Definition: pfs_stat.h:1047
ulonglong m_total_connections
Definition: pfs_stat.h:1048
Row fragment for columns DIGEST, DIGEST_TEXT.
Definition: table_helper.h:579
char m_digest[DIGEST_HASH_TO_STRING_LENGTH+1]
Column DIGEST.
Definition: table_helper.h:583
uint m_digest_length
Length in bytes of m_digest.
Definition: table_helper.h:585
int make_row(PFS_statements_digest_stat *)
Build a row from a memory buffer.
Definition: table_helper.cc:632
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:581
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:669
String m_digest_text
Column DIGEST_TEXT.
Definition: table_helper.h:587
Statistics for a server error.
Definition: pfs_stat.h:477
ulonglong m_last_seen
Definition: pfs_stat.h:482
ulonglong m_count
Definition: pfs_stat.h:478
ulonglong m_handled_count
Definition: pfs_stat.h:479
ulonglong m_first_seen
First and last seen timestamps.
Definition: pfs_stat.h:481
Row fragment for error statistics columns.
Definition: table_helper.h:987
uint m_error_index
Definition: table_helper.h:990
ulonglong m_last_seen
Definition: table_helper.h:992
ulonglong m_count
Definition: table_helper.h:988
void set(const PFS_error_single_stat *stat, uint error_index)
Build a row from a memory buffer.
Definition: table_helper.h:995
ulonglong m_first_seen
Definition: table_helper.h:991
void set_field(uint index, Field *f, server_error *temp_error)
Set a table field from the row.
Definition: table_helper.cc:1106
ulonglong m_handled_count
Definition: table_helper.h:989
Row fragment for column EVENT_NAME.
Definition: table_helper.h:596
int make_row(PFS_instr_class *pfs)
Build a row from a memory buffer.
Definition: table_helper.h:603
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.h:610
uint m_name_length
Length in bytes of m_name.
Definition: table_helper.h:600
const char * m_name
Column EVENT_NAME.
Definition: table_helper.h:598
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:1053
PFS_byte_stat_row m_write
Definition: table_helper.h:1055
void set(time_normalizer *normalizer, const PFS_file_io_stat *stat)
Definition: table_helper.h:1059
PFS_byte_stat_row m_all
Definition: table_helper.h:1057
PFS_byte_stat_row m_misc
Definition: table_helper.h:1056
PFS_byte_stat_row m_read
Definition: table_helper.h:1054
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:541
void set_nullable_field(Field *f)
Definition: table_helper.cc:583
int make_row(PFS_host *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:576
PFS_host_name m_host_name
Column HOST.
Definition: table_helper.h:543
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:581
Per host statistics.
Definition: pfs_host.h:62
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:658
PFS_object_row m_object_row
Definition: table_helper.h:659
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:961
size_t m_index_name_length
Length in bytes of m_index_name.
Definition: table_helper.h:663
int make_row(PFS_table_share *pfs, PFS_table_share_index *pfs_index, uint table_index)
Definition: table_helper.cc:947
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:980
int make_index_name(PFS_table_share_index *pfs_index, uint table_index)
Build a row from a memory buffer.
Definition: table_helper.cc:922
char m_index_name[NAME_LEN]
Column INDEX_NAME.
Definition: table_helper.h:661
Information for all instrumentation.
Definition: pfs_instr_class.h:204
Name space, internal views used within table setup_instruments.
Definition: table_helper.h:503
static const uint VIEW_IDLE
Definition: table_helper.h:513
static const uint FIRST_INSTRUMENT
Definition: table_helper.h:504
static const uint VIEW_TRANSACTION
Definition: table_helper.h:524
static const uint LAST_VIEW
Definition: table_helper.h:515
static const uint VIEW_COND
Definition: table_helper.h:509
static const uint VIEW_MEMORY
Definition: table_helper.h:526
static const uint FIRST_VIEW
Definition: table_helper.h:506
static const uint VIEW_BUILTIN_MEMORY
Definition: table_helper.h:525
static const uint VIEW_ERROR
Definition: table_helper.h:527
static const uint VIEW_STAGE
Definition: table_helper.h:522
static const uint VIEW_METADATA
Definition: table_helper.h:514
static const uint VIEW_SOCKET
Definition: table_helper.h:512
static const uint VIEW_TABLE
Definition: table_helper.h:511
static const uint VIEW_RWLOCK
Definition: table_helper.h:508
static const uint VIEW_MUTEX
Definition: table_helper.h:507
static const uint LAST_INSTRUMENT
Definition: table_helper.h:529
static const uint VIEW_STATEMENT
Definition: table_helper.h:523
static const uint VIEW_FILE
Definition: table_helper.h:510
PFS_key_reader: Convert key into internal format.
Definition: pfs_engine_table.h:195
ha_base_keytype get_key_type(void)
Definition: pfs_engine_table.h:250
Definition: pfs_stat.h:973
Row fragment for memory statistics columns.
Definition: table_helper.h:1076
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1310
PFS_memory_monitoring_stat m_stat
Definition: table_helper.h:1077
void set(const PFS_memory_monitoring_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:1080
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:616
void set_nullable_field(uint index, Field *f)
Definition: table_helper.cc:867
int make_row(PFS_table_share *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:698
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:851
PFS_schema_name m_schema_name
Column SCHEMA_NAME.
Definition: table_helper.h:620
PFS_object_name m_object_name
Column OBJECT_NAME.
Definition: table_helper.h:622
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_helper.h:618
Name space, internal views used within object summaries.
Definition: table_helper.h:533
static const uint LAST_VIEW
Definition: table_helper.h:537
static const uint FIRST_VIEW
Definition: table_helper.h:534
static const uint VIEW_TABLE
Definition: table_helper.h:535
static const uint VIEW_PROGRAM
Definition: table_helper.h:536
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
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:1030
PFS_byte_stat_row m_all
Definition: table_helper.h:1034
PFS_byte_stat_row m_misc
Definition: table_helper.h:1033
PFS_byte_stat_row m_read
Definition: table_helper.h:1031
void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat)
Definition: table_helper.h:1036
PFS_byte_stat_row m_write
Definition: table_helper.h:1032
Statistics for SOCKET I/O.
Definition: pfs_stat.h:821
PFS_byte_stat m_read
READ statistics.
Definition: pfs_stat.h:823
PFS_byte_stat m_misc
Miscellaneous statistics.
Definition: pfs_stat.h:827
PFS_byte_stat m_write
WRITE statistics.
Definition: pfs_stat.h:825
Instrumented socket implementation.
Definition: pfs_instr.h:286
Row fragment for stored program statistics.
Definition: table_helper.h:946
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:955
void set(time_normalizer *normalizer, const PFS_sp_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:950
PFS_stat_row m_timer1_row
Definition: table_helper.h:947
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:847
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:856
PFS_stat_row m_timer1_row
Definition: table_helper.h:848
void set(time_normalizer *normalizer, const PFS_stage_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:851
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:675
ulonglong m_max
Column MAX_TIMER_WAIT.
Definition: table_helper.h:685
ulonglong m_count
Column COUNT_STAR.
Definition: table_helper.h:677
ulonglong m_avg
Column AVG_TIMER_WAIT.
Definition: table_helper.h:683
void set(time_normalizer *normalizer, const PFS_single_stat *stat)
Build a row with timer fields from a memory buffer.
Definition: table_helper.h:696
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.h:713
ulonglong m_sum
Column SUM_TIMER_WAIT.
Definition: table_helper.h:679
void reset()
Definition: table_helper.h:687
ulonglong m_min
Column MIN_TIMER_WAIT.
Definition: table_helper.h:681
Row fragment for statement statistics columns.
Definition: table_helper.h:860
ulonglong m_rows_affected
Definition: table_helper.h:864
ulonglong m_select_full_range_join
Definition: table_helper.h:871
ulonglong m_no_good_index_used
Definition: table_helper.h:880
ulonglong m_sort_scan
Definition: table_helper.h:878
void set(time_normalizer *normalizer, const PFS_statement_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:889
ulonglong m_count_secondary
Definition: table_helper.h:886
ulonglong m_rows_examined
Definition: table_helper.h:867
ulonglong m_cpu_time
CPU TIME.
Definition: table_helper.h:885
ulonglong m_select_scan
Definition: table_helper.h:874
ulonglong m_sort_rows
Definition: table_helper.h:877
ulonglong m_error_count
Definition: table_helper.h:862
ulonglong m_select_full_join
Definition: table_helper.h:870
ulonglong m_created_tmp_disk_tables
Definition: table_helper.h:868
ulonglong m_sort_range
Definition: table_helper.h:876
ulonglong m_lock_time
Definition: table_helper.h:865
ulonglong m_warning_count
Definition: table_helper.h:863
ulonglong m_no_index_used
Definition: table_helper.h:879
ulonglong m_sort_merge_passes
Definition: table_helper.h:875
ulonglong m_select_range_check
Definition: table_helper.h:873
ulonglong m_created_tmp_tables
Definition: table_helper.h:869
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:999
ulonglong m_rows_sent
Definition: table_helper.h:866
ulonglong m_select_range
Definition: table_helper.h:872
PFS_stat_row m_timer1_row
Definition: table_helper.h:861
Statistics for statement usage.
Definition: pfs_stat.h:375
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_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:401
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:749
PFS_stat_row m_all_write
Definition: table_helper.h:752
PFS_stat_row m_fetch
Definition: table_helper.h:753
PFS_stat_row m_all
Definition: table_helper.h:750
PFS_stat_row m_delete
Definition: table_helper.h:756
PFS_stat_row m_update
Definition: table_helper.h:755
PFS_stat_row m_all_read
Definition: table_helper.h:751
PFS_stat_row m_insert
Definition: table_helper.h:754
void set(time_normalizer *normalizer, const PFS_table_io_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:759
Single table I/O statistic.
Definition: pfs_stat.h:628
PFS_single_stat m_insert
INSERT statistics.
Definition: pfs_stat.h:633
PFS_single_stat m_fetch
FETCH statistics.
Definition: pfs_stat.h:631
PFS_single_stat m_delete
DELETE statistics.
Definition: pfs_stat.h:637
PFS_single_stat m_update
UPDATE statistics.
Definition: pfs_stat.h:635
Row fragment for table lock statistics columns.
Definition: table_helper.h:786
PFS_stat_row m_write_concurrent_insert
Definition: table_helper.h:796
PFS_stat_row m_read_with_shared_locks
Definition: table_helper.h:791
PFS_stat_row m_all_read
Definition: table_helper.h:788
PFS_stat_row m_all_write
Definition: table_helper.h:789
PFS_stat_row m_write_low_priority
Definition: table_helper.h:797
PFS_stat_row m_read_external
Definition: table_helper.h:794
PFS_stat_row m_read_high_priority
Definition: table_helper.h:792
PFS_stat_row m_read_no_insert
Definition: table_helper.h:793
PFS_stat_row m_write_normal
Definition: table_helper.h:798
PFS_stat_row m_read_normal
Definition: table_helper.h:790
void set(time_normalizer *normalizer, const PFS_table_lock_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:802
PFS_stat_row m_write_allow_write
Definition: table_helper.h:795
PFS_stat_row m_all
Definition: table_helper.h:787
PFS_stat_row m_write_external
Definition: table_helper.h:799
Statistics for table locks.
Definition: pfs_stat.h:690
PFS_single_stat m_stat[COUNT_PFS_TL_LOCK_TYPE]
Definition: pfs_stat.h:691
Index statistics of a table.
Definition: pfs_instr_class.h:363
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:387
Instrumented table implementation.
Definition: pfs_instr.h:192
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:331
Instrumented thread implementation.
Definition: pfs_instr.h:372
Row fragment for transaction statistics columns.
Definition: table_helper.h:961
PFS_stat_row m_read_write_row
Definition: table_helper.h:963
ulonglong m_savepoint_count
Definition: table_helper.h:965
PFS_stat_row m_timer1_row
Definition: table_helper.h:962
PFS_stat_row m_read_only_row
Definition: table_helper.h:964
ulonglong m_release_savepoint_count
Definition: table_helper.h:967
void set_field(uint index, Field *f)
Set a table field from the row.
Definition: table_helper.cc:1077
ulonglong m_rollback_to_savepoint_count
Definition: table_helper.h:966
void set(time_normalizer *normalizer, const PFS_transaction_stat *stat)
Build a row from a memory buffer.
Definition: table_helper.h:970
Statistics for transaction usage.
Definition: pfs_stat.h:441
PFS_single_stat m_read_write_stat
Definition: pfs_stat.h:442
PFS_single_stat m_read_only_stat
Definition: pfs_stat.h:443
Definition: pfs_name.h:222
Row fragment for column USER.
Definition: table_helper.h:553
PFS_user_name m_user_name
Column USER.
Definition: table_helper.h:555
void set_nullable_field(Field *f)
Definition: table_helper.cc:594
int make_row(PFS_user *pfs)
Build a row from a memory buffer.
Definition: table_helper.cc:587
void set_field(Field *f)
Set a table field from the row.
Definition: table_helper.cc:592
Definition: table_helper.h:1121
int make_row(const char *val, size_t length)
Definition: table_helper.cc:1445
PFS_user_variable_value_row()
Definition: table_helper.h:1123
void clear()
Definition: table_helper.cc:1439
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:61
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:1400
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:1414
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:1435
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)
Convert a wait from timer units to pico seconds.
Definition: pfs_timer.h:141
unsigned int uint
Definition: uca-dump.cc:29
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:868