MySQL 8.0.29
Source Code Documentation
pfs_data_lock.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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#ifndef PFS_DATA_LOCK_H
24#define PFS_DATA_LOCK_H
25
26/**
27 @file storage/perfschema/pfs_data_lock.h
28 Performance schema instrumentation (declarations).
29*/
30
32#include <unordered_set>
33#include <vector>
34
35#include "my_compiler.h"
36#include "my_inttypes.h"
38
41
42 void reset() {
43 memset(m_engine_lock_id, 0, sizeof(m_engine_lock_id));
45 }
46
47 void set(const pk_pos_data_lock *other) {
48 memcpy(m_engine_lock_id, other->m_engine_lock_id, sizeof(m_engine_lock_id));
50 }
51
52 /** Column ENGINE_LOCK_ID */
55};
56
57// This structure is memcmp-ed, so we need to have no padding.
58static_assert(sizeof(pk_pos_data_lock) == 128 + sizeof(size_t), "");
59
60/** A row of table PERFORMANCE_SCHEMA.DATA_LOCKS. */
62 /** Column ENGINE */
63 const char *m_engine;
64 /** Column ENGINE_LOCK_ID */
66 /** Column ENGINE_TRANSACTION_ID */
68 /** Column THREAD_ID */
70 /** Column EVENT_ID */
72 /** Columns OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME */
74 /** Column PARTITION_NAME */
75 const char *m_partition_name;
77 /** Column SUB_PARTITION_NAME */
80 /** Column OBJECT_INSTANCE_BEGIN */
81 const void *m_identity;
82 /** Column LOCK_MODE */
83 const char *m_lock_mode;
84 /** Column LOCK_TYPE */
85 const char *m_lock_type;
86 /** Column LOCK_STATUS */
87 const char *m_lock_status;
88 /** Column LOCK_DATA */
89 const char *m_lock_data;
90};
91
94
95 void reset() {
96 // POT type, must initialize every byte for memcmp()
101 }
102
103 void set(const pk_pos_data_lock_wait *other) {
111 }
112
113 /** Column REQUESTING_ENGINE_LOCK_ID */
116 /** Column BLOCKING_ENGINE_LOCK_ID */
119};
120
121// This structure is memcmp-ed, so we need to have no padding.
122static_assert(sizeof(pk_pos_data_lock_wait) == 2 * (128 + sizeof(size_t)), "");
123
124/** A row of table PERFORMANCE_SCHEMA.DATA_LOCK_WAITS. */
126 /** Column ENGINE */
127 const char *m_engine;
128 /** Engine (REQUESTING_LOCK_ID, BLOCKING_LOCK_ID) key */
130 /** Column REQUESTING_ENGINE_TRANSACTION_ID */
132 /** Column REQUESTING_THREAD_ID */
134 /** Column REQUESTING_EVENT_ID */
136 /** Column REQUESTING_OBJECT_INSTANCE_BEGIN */
138 /** Column BLOCKING_ENGINE_TRANSACTION_ID */
140 /** Column BLOCKING_THREAD_ID */
142 /** Column BLOCKING_EVENT_ID */
144 /** Column BLOCKING_OBJECT_INSTANCE_BEGIN */
146};
147
149 public:
151 : PFS_engine_index(key_1, key_2) {}
152
154 PFS_engine_key *key_3, PFS_engine_key *key_4)
155 : PFS_engine_index(key_1, key_2, key_3, key_4) {}
156
157 ~PFS_index_data_locks() override = default;
158
159 virtual bool match_engine(const char *engine [[maybe_unused]],
160 size_t engine_length [[maybe_unused]]) {
161 return true;
162 }
163
164 virtual bool match_lock_id(const char *engine_lock_id [[maybe_unused]],
165 size_t engine_lock_id_length [[maybe_unused]]) {
166 return true;
167 }
168
169 virtual bool match_transaction_id(ulonglong engine_transaction_id
170 [[maybe_unused]]) {
171 return true;
172 }
173
174 virtual bool match_thread_id_event_id(ulonglong thread_id [[maybe_unused]],
175 ulonglong event_id [[maybe_unused]]) {
176 return true;
177 }
178
179 virtual bool match_object(const char *table_schema [[maybe_unused]],
180 size_t table_schema_length [[maybe_unused]],
181 const char *table_name [[maybe_unused]],
182 size_t table_name_length [[maybe_unused]],
183 const char *partition_name [[maybe_unused]],
184 size_t partition_name_length [[maybe_unused]],
185 const char *sub_partition_name [[maybe_unused]],
186 size_t sub_partition_name_length [[maybe_unused]]) {
187 return true;
188 }
189};
190
192 public:
195 m_key_1("ENGINE_LOCK_ID"),
196 m_key_2("ENGINE") {}
197
199
200 bool match_lock_id(const char *engine_lock_id,
201 size_t engine_lock_id_length) override {
202 if (m_fields >= 1) {
203 if (!m_key_1.match(engine_lock_id, engine_lock_id_length)) {
204 return false;
205 }
206 }
207
208 return true;
209 }
210
211 bool match_engine(const char *engine, size_t engine_length) override {
212 if (m_fields >= 2) {
213 if (!m_key_2.match(engine, engine_length)) {
214 return false;
215 }
216 }
217
218 return true;
219 }
220
221 private:
224};
225
227 public:
230 m_key_1("ENGINE_TRANSACTION_ID"),
231 m_key_2("ENGINE") {}
232
234
235 bool match_transaction_id(ulonglong engine_transaction_id) override {
236 if (m_fields >= 1) {
237 if (!m_key_1.match(engine_transaction_id)) {
238 return false;
239 }
240 }
241
242 return true;
243 }
244
245 bool match_engine(const char *engine, size_t engine_length) override {
246 if (m_fields >= 2) {
247 if (!m_key_2.match(engine, engine_length)) {
248 return false;
249 }
250 }
251
252 return true;
253 }
254
255 private:
258};
259
261 public:
264 m_key_1("THREAD_ID"),
265 m_key_2("EVENT_ID") {}
266
268
270 ulonglong event_id) override {
271 if (m_fields >= 1) {
272 if (!m_key_1.match(thread_id)) {
273 return false;
274 }
275 }
276
277 if (m_fields >= 2) {
278 if (!m_key_2.match(event_id)) {
279 return false;
280 }
281 }
282
283 return true;
284 }
285
286 private:
289};
290
292 public:
295 m_key_1("OBJECT_SCHEMA"),
296 m_key_2("OBJECT_NAME"),
297 m_key_3("PARTITION_NAME"),
298 m_key_4("SUBPARTITION_NAME") {}
299
301
302 bool match_object(const char *table_schema, size_t table_schema_length,
303 const char *table_name, size_t table_name_length,
304 const char *partition_name, size_t partition_name_length,
305 const char *sub_partition_name,
306 size_t sub_partition_name_length) override {
307 if (m_fields >= 1) {
308 if (!m_key_1.match(table_schema, table_schema_length)) {
309 return false;
310 }
311 }
312
313 if (m_fields >= 2) {
314 if (!m_key_2.match(table_name, table_name_length)) {
315 return false;
316 }
317 }
318
319 if (m_fields >= 3) {
320 if (!m_key_3.match(partition_name, partition_name_length)) {
321 return false;
322 }
323 }
324
325 if (m_fields >= 4) {
326 if (!m_key_4.match(sub_partition_name, sub_partition_name_length)) {
327 return false;
328 }
329 }
330
331 return true;
332 }
333
334 private:
339};
340
342 public:
344 : PFS_engine_index(key_1, key_2) {}
345
346 ~PFS_index_data_lock_waits() override = default;
347
348 virtual bool match_engine(const char *engine [[maybe_unused]],
349 size_t engine_length [[maybe_unused]]) {
350 return true;
351 }
352
353 virtual bool match_requesting_lock_id(const char *engine_lock_id
354 [[maybe_unused]],
355 size_t engine_lock_id_length
356 [[maybe_unused]]) {
357 return true;
358 }
359
360 virtual bool match_blocking_lock_id(const char *engine_lock_id
361 [[maybe_unused]],
362 size_t engine_lock_id_length
363 [[maybe_unused]]) {
364 return true;
365 }
366
367 virtual bool match_requesting_transaction_id(ulonglong engine_transaction_id
368 [[maybe_unused]]) {
369 return true;
370 }
371
372 virtual bool match_blocking_transaction_id(ulonglong engine_transaction_id
373 [[maybe_unused]]) {
374 return true;
375 }
376
378 [[maybe_unused]],
379 ulonglong event_id
380 [[maybe_unused]]) {
381 return true;
382 }
383
385 [[maybe_unused]],
386 ulonglong event_id
387 [[maybe_unused]]) {
388 return true;
389 }
390};
391
394 public:
397 m_key_1("REQUESTING_ENGINE_LOCK_ID"),
398 m_key_2("ENGINE") {}
399
401
402 bool match_requesting_lock_id(const char *engine_lock_id,
403 size_t engine_lock_id_length) override {
404 if (m_fields >= 1) {
405 if (!m_key_1.match(engine_lock_id, engine_lock_id_length)) {
406 return false;
407 }
408 }
409
410 return true;
411 }
412
413 bool match_engine(const char *engine, size_t engine_length) override {
414 if (m_fields >= 2) {
415 if (!m_key_2.match(engine, engine_length)) {
416 return false;
417 }
418 }
419
420 return true;
421 }
422
423 private:
426};
427
430 public:
433 m_key_1("BLOCKING_ENGINE_LOCK_ID"),
434 m_key_2("ENGINE") {}
435
437
438 bool match_blocking_lock_id(const char *engine_lock_id,
439 size_t engine_lock_id_length) override {
440 if (m_fields >= 1) {
441 if (!m_key_1.match(engine_lock_id, engine_lock_id_length)) {
442 return false;
443 }
444 }
445
446 return true;
447 }
448
449 bool match_engine(const char *engine, size_t engine_length) override {
450 if (m_fields >= 2) {
451 if (!m_key_2.match(engine, engine_length)) {
452 return false;
453 }
454 }
455
456 return true;
457 }
458
459 private:
462};
463
466 public:
469 m_key_1("REQUESTING_ENGINE_TRANSACTION_ID"),
470 m_key_2("ENGINE") {}
471
473
475 ulonglong engine_transaction_id) override {
476 if (m_fields >= 1) {
477 if (!m_key_1.match(engine_transaction_id)) {
478 return false;
479 }
480 }
481
482 return true;
483 }
484
485 bool match_engine(const char *engine, size_t engine_length) override {
486 if (m_fields >= 2) {
487 if (!m_key_2.match(engine, engine_length)) {
488 return false;
489 }
490 }
491
492 return true;
493 }
494
495 private:
498};
499
502 public:
505 m_key_1("BLOCKING_ENGINE_TRANSACTION_ID"),
506 m_key_2("ENGINE") {}
507
509
510 bool match_blocking_transaction_id(ulonglong engine_transaction_id) override {
511 if (m_fields >= 1) {
512 if (!m_key_1.match(engine_transaction_id)) {
513 return false;
514 }
515 }
516
517 return true;
518 }
519
520 bool match_engine(const char *engine, size_t engine_length) override {
521 if (m_fields >= 2) {
522 if (!m_key_2.match(engine, engine_length)) {
523 return false;
524 }
525 }
526
527 return true;
528 }
529
530 private:
533};
534
537 public:
540 m_key_1("REQUESTING_THREAD_ID"),
541 m_key_2("REQUESTING_EVENT_ID") {}
542
544
546 ulonglong event_id) override {
547 if (m_fields >= 1) {
548 if (!m_key_1.match(thread_id)) {
549 return false;
550 }
551 }
552
553 if (m_fields >= 2) {
554 if (!m_key_2.match(event_id)) {
555 return false;
556 }
557 }
558
559 return true;
560 }
561
562 private:
565};
566
569 public:
572 m_key_1("BLOCKING_THREAD_ID"),
573 m_key_2("BLOCKING_EVENT_ID") {}
574
576
578 ulonglong event_id) override {
579 if (m_fields >= 1) {
580 if (!m_key_1.match(thread_id)) {
581 return false;
582 }
583 }
584
585 if (m_fields >= 2) {
586 if (!m_key_2.match(event_id)) {
587 return false;
588 }
589 }
590
591 return true;
592 }
593
594 private:
597};
598
600 public:
603
604 const char *cache_data(const char *ptr, size_t length);
605 void clear();
606
607 private:
608 typedef std::unordered_set<std::string> set_type;
610};
611
613 public:
616
617 const char *cache_string(const char *string) override;
618 const char *cache_data(const char *ptr, size_t length) override;
619
620 bool accept_engine(const char *engine, size_t engine_length) override;
621 bool accept_lock_id(const char *engine_lock_id,
622 size_t engine_lock_id_length) override;
623 bool accept_transaction_id(ulonglong transaction_id) override;
625 ulonglong event_id) override;
626 bool accept_object(const char *table_schema, size_t table_schema_length,
627 const char *table_name, size_t table_name_length,
628 const char *partition_name, size_t partition_name_length,
629 const char *sub_partition_name,
630 size_t sub_partition_name_length) override;
631
632 void add_lock_row(const char *engine, size_t engine_length,
633 const char *engine_lock_id, size_t engine_lock_id_length,
634 ulonglong transaction_id, ulonglong thread_id,
635 ulonglong event_id, const char *table_schema,
636 size_t table_schema_length, const char *table_name,
637 size_t table_name_length, const char *partition_name,
638 size_t partition_name_length,
639 const char *sub_partition_name,
640 size_t sub_partition_name_length, const char *index_name,
641 size_t index_name_length, const void *identity,
642 const char *lock_mode, const char *lock_type,
643 const char *lock_status, const char *lock_data) override;
644
645 /**
646 Clear the container.
647 New rows added will start at index 0.
648 */
649 void clear();
650 /**
651 Shrink the container.
652 New rows added will continue to use the current index.
653 */
654 void shrink();
655 row_data_lock *get_row(size_t index);
656
657 void set_filter(PFS_index_data_locks *filter) { m_filter = filter; }
658
659 private:
661 std::vector<row_data_lock> m_rows;
664};
665
668 public:
671
672 const char *cache_string(const char *string) override;
673 const char *cache_data(const char *ptr, size_t length) override;
674
675 bool accept_engine(const char *engine, size_t engine_length) override;
676 bool accept_requesting_lock_id(const char *engine_lock_id,
677 size_t engine_lock_id_length) override;
678 bool accept_blocking_lock_id(const char *engine_lock_id,
679 size_t engine_lock_id_length) override;
680 bool accept_requesting_transaction_id(ulonglong transaction_id) override;
681 bool accept_blocking_transaction_id(ulonglong transaction_id) override;
683 ulonglong event_id) override;
685 ulonglong event_id) override;
686
688 const char *engine, size_t engine_length,
689 const char *requesting_engine_lock_id,
690 size_t requesting_engine_lock_id_length,
691 ulonglong requesting_transaction_id, ulonglong requesting_thread_id,
692 ulonglong requesting_event_id, const void *requesting_identity,
693 const char *blocking_engine_lock_id,
694 size_t blocking_engine_lock_id_length, ulonglong blocking_transaction_id,
695 ulonglong blocking_thread_id, ulonglong blocking_event_id,
696 const void *blocking_identity) override;
697
698 /**
699 Clear the container.
700 New rows added will start at index 0.
701 */
702 void clear();
703 /**
704 Shrink the container.
705 New rows added will continue to use the current index.
706 */
707 void shrink();
708 row_data_lock_wait *get_row(size_t index);
709
711
712 private:
714 std::vector<row_data_lock_wait> m_rows;
717};
718
719#endif
Definition: pfs_data_lock.h:599
void clear()
Definition: pfs_data_lock.cc:200
std::unordered_set< std::string > set_type
Definition: pfs_data_lock.h:608
const char * cache_data(const char *ptr, size_t length)
Definition: pfs_data_lock.cc:187
set_type m_set
Definition: pfs_data_lock.h:609
Definition: pfs_data_lock.h:612
PFS_data_lock_container()
Definition: pfs_data_lock.cc:202
bool accept_lock_id(const char *engine_lock_id, size_t engine_lock_id_length) override
Check if the container accepts data for a particular lock.
Definition: pfs_data_lock.cc:224
std::vector< row_data_lock > m_rows
Definition: pfs_data_lock.h:661
~PFS_data_lock_container() override
bool accept_thread_id_event_id(ulonglong thread_id, ulonglong event_id) override
Check if the container accepts data for a particular event.
Definition: pfs_data_lock.cc:239
bool accept_engine(const char *engine, size_t engine_length) override
Check if the container accepts data for a particular engine.
Definition: pfs_data_lock.cc:216
void add_lock_row(const char *engine, size_t engine_length, const char *engine_lock_id, size_t engine_lock_id_length, ulonglong transaction_id, ulonglong thread_id, ulonglong event_id, const char *table_schema, size_t table_schema_length, const char *table_name, size_t table_name_length, const char *partition_name, size_t partition_name_length, const char *sub_partition_name, size_t sub_partition_name_length, const char *index_name, size_t index_name_length, const void *identity, const char *lock_mode, const char *lock_type, const char *lock_status, const char *lock_data) override
Add a row to table performance_schema.data_locks.
Definition: pfs_data_lock.cc:261
size_t m_logical_row_index
Definition: pfs_data_lock.h:660
bool accept_transaction_id(ulonglong transaction_id) override
Check if the container accepts data for a particular transaction.
Definition: pfs_data_lock.cc:232
void set_filter(PFS_index_data_locks *filter)
Definition: pfs_data_lock.h:657
const char * cache_string(const char *string) override
Add a string to the container cache.
Definition: pfs_data_lock.cc:207
void clear()
Clear the container.
Definition: pfs_data_lock.cc:322
PFS_index_data_locks * m_filter
Definition: pfs_data_lock.h:663
const char * cache_data(const char *ptr, size_t length) override
Add binary data to the container cache.
Definition: pfs_data_lock.cc:211
bool accept_object(const char *table_schema, size_t table_schema_length, const char *table_name, size_t table_name_length, const char *partition_name, size_t partition_name_length, const char *sub_partition_name, size_t sub_partition_name_length) override
Check if the container accepts data for a particular object.
Definition: pfs_data_lock.cc:247
row_data_lock * get_row(size_t index)
Definition: pfs_data_lock.cc:336
PFS_data_cache m_cache
Definition: pfs_data_lock.h:662
void shrink()
Shrink the container.
Definition: pfs_data_lock.cc:328
Definition: pfs_data_lock.h:667
void clear()
Clear the container.
Definition: pfs_data_lock.cc:483
row_data_lock_wait * get_row(size_t index)
Definition: pfs_data_lock.cc:497
PFS_data_cache m_cache
Definition: pfs_data_lock.h:715
void set_filter(PFS_index_data_lock_waits *filter)
Definition: pfs_data_lock.h:710
~PFS_data_lock_wait_container() override
bool accept_requesting_thread_id_event_id(ulonglong thread_id, ulonglong event_id) override
Check if the container accepts data for a particular requesting event.
Definition: pfs_data_lock.cc:411
bool accept_blocking_lock_id(const char *engine_lock_id, size_t engine_lock_id_length) override
Check if the container accepts data for a particular blocking lock id.
Definition: pfs_data_lock.cc:386
std::vector< row_data_lock_wait > m_rows
Definition: pfs_data_lock.h:714
PFS_data_lock_wait_container()
Definition: pfs_data_lock.cc:355
bool accept_requesting_transaction_id(ulonglong transaction_id) override
Check if the container accepts data for a particular requesting transaction id.
Definition: pfs_data_lock.cc:395
bool accept_requesting_lock_id(const char *engine_lock_id, size_t engine_lock_id_length) override
Check if the container accepts data for a particular requesting lock id.
Definition: pfs_data_lock.cc:377
const char * cache_string(const char *string) override
Definition: pfs_data_lock.cc:360
bool accept_blocking_thread_id_event_id(ulonglong thread_id, ulonglong event_id) override
Check if the container accepts data for a particular blocking event.
Definition: pfs_data_lock.cc:419
bool accept_engine(const char *engine, size_t engine_length) override
Check if the container accepts data for a particular engine.
Definition: pfs_data_lock.cc:369
PFS_index_data_lock_waits * m_filter
Definition: pfs_data_lock.h:716
bool accept_blocking_transaction_id(ulonglong transaction_id) override
Check if the container accepts data for a particular blocking transaction id.
Definition: pfs_data_lock.cc:403
size_t m_logical_row_index
Definition: pfs_data_lock.h:713
void shrink()
Shrink the container.
Definition: pfs_data_lock.cc:489
void add_lock_wait_row(const char *engine, size_t engine_length, const char *requesting_engine_lock_id, size_t requesting_engine_lock_id_length, ulonglong requesting_transaction_id, ulonglong requesting_thread_id, ulonglong requesting_event_id, const void *requesting_identity, const char *blocking_engine_lock_id, size_t blocking_engine_lock_id_length, ulonglong blocking_transaction_id, ulonglong blocking_thread_id, ulonglong blocking_event_id, const void *blocking_identity) override
Add a row to table performance_schema.data_lock_waits.
Definition: pfs_data_lock.cc:427
const char * cache_data(const char *ptr, size_t length) override
Definition: pfs_data_lock.cc:364
uint m_fields
Definition: pfs_engine_table.h:295
Definition: pfs_engine_table.h:299
Definition: pfs_engine_table.h:267
Definition: pfs_data_lock.h:429
bool match_engine(const char *engine, size_t engine_length) override
Definition: pfs_data_lock.h:449
bool match_blocking_lock_id(const char *engine_lock_id, size_t engine_lock_id_length) override
Definition: pfs_data_lock.h:438
PFS_key_engine_name m_key_2
Definition: pfs_data_lock.h:461
PFS_key_engine_lock_id m_key_1
Definition: pfs_data_lock.h:460
~PFS_index_data_lock_waits_by_blocking_lock_id() override=default
PFS_index_data_lock_waits_by_blocking_lock_id()
Definition: pfs_data_lock.h:431
PFS_key_event_id m_key_2
Definition: pfs_data_lock.h:596
PFS_key_thread_id m_key_1
Definition: pfs_data_lock.h:595
PFS_index_data_lock_waits_by_blocking_thread_id()
Definition: pfs_data_lock.h:570
~PFS_index_data_lock_waits_by_blocking_thread_id() override=default
bool match_blocking_thread_id_event_id(ulonglong thread_id, ulonglong event_id) override
Definition: pfs_data_lock.h:577
PFS_key_engine_name m_key_2
Definition: pfs_data_lock.h:532
PFS_index_data_lock_waits_by_blocking_transaction_id()
Definition: pfs_data_lock.h:503
bool match_blocking_transaction_id(ulonglong engine_transaction_id) override
Definition: pfs_data_lock.h:510
bool match_engine(const char *engine, size_t engine_length) override
Definition: pfs_data_lock.h:520
~PFS_index_data_lock_waits_by_blocking_transaction_id() override=default
PFS_key_engine_transaction_id m_key_1
Definition: pfs_data_lock.h:531
PFS_key_engine_name m_key_2
Definition: pfs_data_lock.h:425
PFS_index_data_lock_waits_by_requesting_lock_id()
Definition: pfs_data_lock.h:395
PFS_key_engine_lock_id m_key_1
Definition: pfs_data_lock.h:424
~PFS_index_data_lock_waits_by_requesting_lock_id() override=default
bool match_requesting_lock_id(const char *engine_lock_id, size_t engine_lock_id_length) override
Definition: pfs_data_lock.h:402
bool match_engine(const char *engine, size_t engine_length) override
Definition: pfs_data_lock.h:413
PFS_key_thread_id m_key_1
Definition: pfs_data_lock.h:563
~PFS_index_data_lock_waits_by_requesting_thread_id() override=default
bool match_requesting_thread_id_event_id(ulonglong thread_id, ulonglong event_id) override
Definition: pfs_data_lock.h:545
PFS_key_event_id m_key_2
Definition: pfs_data_lock.h:564
PFS_index_data_lock_waits_by_requesting_thread_id()
Definition: pfs_data_lock.h:538
PFS_key_engine_transaction_id m_key_1
Definition: pfs_data_lock.h:496
~PFS_index_data_lock_waits_by_requesting_transaction_id() override=default
bool match_requesting_transaction_id(ulonglong engine_transaction_id) override
Definition: pfs_data_lock.h:474
PFS_index_data_lock_waits_by_requesting_transaction_id()
Definition: pfs_data_lock.h:467
PFS_key_engine_name m_key_2
Definition: pfs_data_lock.h:497
bool match_engine(const char *engine, size_t engine_length) override
Definition: pfs_data_lock.h:485
Definition: pfs_data_lock.h:341
virtual bool match_blocking_lock_id(const char *engine_lock_id, size_t engine_lock_id_length)
Definition: pfs_data_lock.h:360
virtual bool match_requesting_thread_id_event_id(ulonglong thread_id, ulonglong event_id)
Definition: pfs_data_lock.h:377
~PFS_index_data_lock_waits() override=default
virtual bool match_blocking_transaction_id(ulonglong engine_transaction_id)
Definition: pfs_data_lock.h:372
PFS_index_data_lock_waits(PFS_engine_key *key_1, PFS_engine_key *key_2)
Definition: pfs_data_lock.h:343
virtual bool match_engine(const char *engine, size_t engine_length)
Definition: pfs_data_lock.h:348
virtual bool match_requesting_transaction_id(ulonglong engine_transaction_id)
Definition: pfs_data_lock.h:367
virtual bool match_blocking_thread_id_event_id(ulonglong thread_id, ulonglong event_id)
Definition: pfs_data_lock.h:384
virtual bool match_requesting_lock_id(const char *engine_lock_id, size_t engine_lock_id_length)
Definition: pfs_data_lock.h:353
Definition: pfs_data_lock.h:191
~PFS_index_data_locks_by_lock_id() override=default
PFS_key_engine_name m_key_2
Definition: pfs_data_lock.h:223
PFS_key_engine_lock_id m_key_1
Definition: pfs_data_lock.h:222
bool match_lock_id(const char *engine_lock_id, size_t engine_lock_id_length) override
Definition: pfs_data_lock.h:200
bool match_engine(const char *engine, size_t engine_length) override
Definition: pfs_data_lock.h:211
PFS_index_data_locks_by_lock_id()
Definition: pfs_data_lock.h:193
Definition: pfs_data_lock.h:291
bool match_object(const char *table_schema, size_t table_schema_length, const char *table_name, size_t table_name_length, const char *partition_name, size_t partition_name_length, const char *sub_partition_name, size_t sub_partition_name_length) override
Definition: pfs_data_lock.h:302
~PFS_index_data_locks_by_object() override=default
PFS_index_data_locks_by_object()
Definition: pfs_data_lock.h:293
PFS_key_object_name m_key_2
Definition: pfs_data_lock.h:336
PFS_key_object_schema m_key_1
Definition: pfs_data_lock.h:335
PFS_key_name m_key_4
Definition: pfs_data_lock.h:338
PFS_key_name m_key_3
Definition: pfs_data_lock.h:337
Definition: pfs_data_lock.h:260
PFS_index_data_locks_by_thread_id()
Definition: pfs_data_lock.h:262
PFS_key_thread_id m_key_1
Definition: pfs_data_lock.h:287
PFS_key_event_id m_key_2
Definition: pfs_data_lock.h:288
~PFS_index_data_locks_by_thread_id() override=default
bool match_thread_id_event_id(ulonglong thread_id, ulonglong event_id) override
Definition: pfs_data_lock.h:269
Definition: pfs_data_lock.h:226
bool match_engine(const char *engine, size_t engine_length) override
Definition: pfs_data_lock.h:245
PFS_index_data_locks_by_transaction_id()
Definition: pfs_data_lock.h:228
bool match_transaction_id(ulonglong engine_transaction_id) override
Definition: pfs_data_lock.h:235
PFS_key_engine_name m_key_2
Definition: pfs_data_lock.h:257
~PFS_index_data_locks_by_transaction_id() override=default
PFS_key_engine_transaction_id m_key_1
Definition: pfs_data_lock.h:256
Definition: pfs_data_lock.h:148
PFS_index_data_locks(PFS_engine_key *key_1, PFS_engine_key *key_2)
Definition: pfs_data_lock.h:150
virtual bool match_transaction_id(ulonglong engine_transaction_id)
Definition: pfs_data_lock.h:169
PFS_index_data_locks(PFS_engine_key *key_1, PFS_engine_key *key_2, PFS_engine_key *key_3, PFS_engine_key *key_4)
Definition: pfs_data_lock.h:153
~PFS_index_data_locks() override=default
virtual bool match_thread_id_event_id(ulonglong thread_id, ulonglong event_id)
Definition: pfs_data_lock.h:174
virtual bool match_object(const char *table_schema, size_t table_schema_length, const char *table_name, size_t table_name_length, const char *partition_name, size_t partition_name_length, const char *sub_partition_name, size_t sub_partition_name_length)
Definition: pfs_data_lock.h:179
virtual bool match_engine(const char *engine, size_t engine_length)
Definition: pfs_data_lock.h:159
virtual bool match_lock_id(const char *engine_lock_id, size_t engine_lock_id_length)
Definition: pfs_data_lock.h:164
Definition: table_helper.h:1553
bool match(const char *engine_lock_id, size_t length)
Definition: table_helper.cc:2071
Definition: table_helper.h:1543
bool match(const char *engine_name, size_t length)
Definition: table_helper.cc:2067
Definition: table_helper.h:1289
bool match(ulonglong engine_transaction_id)
Definition: table_helper.cc:1757
Definition: table_helper.h:1266
bool match(ulonglong event_id)
Definition: table_helper.cc:1722
Definition: table_helper.h:1508
bool match(const LEX_CSTRING *name)
Definition: table_helper.cc:2021
Definition: table_helper.h:1610
bool match(const PFS_table_share *pfs)
Definition: table_helper.cc:2278
Definition: table_helper.h:1595
bool match(const PFS_table_share *pfs)
Definition: table_helper.cc:2240
Definition: table_helper.h:1250
bool match(ulonglong thread_id)
Definition: table_helper.cc:1661
Server interface, row lock container.
Definition: psi_data_lock.h:107
Definition: psi_data_lock.h:193
lock_mode
Definition: lock0types.h:51
Header for compiler-dependent features.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
static my_thread_id thread_id
Definition: my_thr_init.cc:62
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
const char * table_name
Definition: rules_table_service.cc:55
Performance schema instrumentation interface.
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:658
Definition: pfs_data_lock.h:92
pk_pos_data_lock_wait()
Definition: pfs_data_lock.h:93
char m_requesting_engine_lock_id[128]
Column REQUESTING_ENGINE_LOCK_ID.
Definition: pfs_data_lock.h:114
void reset()
Definition: pfs_data_lock.h:95
size_t m_blocking_engine_lock_id_length
Definition: pfs_data_lock.h:118
void set(const pk_pos_data_lock_wait *other)
Definition: pfs_data_lock.h:103
char m_blocking_engine_lock_id[128]
Column BLOCKING_ENGINE_LOCK_ID.
Definition: pfs_data_lock.h:117
size_t m_requesting_engine_lock_id_length
Definition: pfs_data_lock.h:115
Definition: pfs_data_lock.h:39
void reset()
Definition: pfs_data_lock.h:42
size_t m_engine_lock_id_length
Definition: pfs_data_lock.h:54
char m_engine_lock_id[128]
Column ENGINE_LOCK_ID.
Definition: pfs_data_lock.h:53
void set(const pk_pos_data_lock *other)
Definition: pfs_data_lock.h:47
pk_pos_data_lock()
Definition: pfs_data_lock.h:40
A row of table PERFORMANCE_SCHEMA.DATA_LOCK_WAITS.
Definition: pfs_data_lock.h:125
pk_pos_data_lock_wait m_hidden_pk
Engine (REQUESTING_LOCK_ID, BLOCKING_LOCK_ID) key.
Definition: pfs_data_lock.h:129
const void * m_requesting_identity
Column REQUESTING_OBJECT_INSTANCE_BEGIN.
Definition: pfs_data_lock.h:137
ulonglong m_blocking_thread_id
Column BLOCKING_THREAD_ID.
Definition: pfs_data_lock.h:141
ulonglong m_requesting_event_id
Column REQUESTING_EVENT_ID.
Definition: pfs_data_lock.h:135
ulonglong m_blocking_event_id
Column BLOCKING_EVENT_ID.
Definition: pfs_data_lock.h:143
ulonglong m_requesting_thread_id
Column REQUESTING_THREAD_ID.
Definition: pfs_data_lock.h:133
const void * m_blocking_identity
Column BLOCKING_OBJECT_INSTANCE_BEGIN.
Definition: pfs_data_lock.h:145
ulonglong m_requesting_transaction_id
Column REQUESTING_ENGINE_TRANSACTION_ID.
Definition: pfs_data_lock.h:131
const char * m_engine
Column ENGINE.
Definition: pfs_data_lock.h:127
ulonglong m_blocking_transaction_id
Column BLOCKING_ENGINE_TRANSACTION_ID.
Definition: pfs_data_lock.h:139
A row of table PERFORMANCE_SCHEMA.DATA_LOCKS.
Definition: pfs_data_lock.h:61
const char * m_lock_status
Column LOCK_STATUS.
Definition: pfs_data_lock.h:87
const void * m_identity
Column OBJECT_INSTANCE_BEGIN.
Definition: pfs_data_lock.h:81
ulonglong m_transaction_id
Column ENGINE_TRANSACTION_ID.
Definition: pfs_data_lock.h:67
size_t m_sub_partition_name_length
Definition: pfs_data_lock.h:79
ulonglong m_thread_id
Column THREAD_ID.
Definition: pfs_data_lock.h:69
const char * m_lock_data
Column LOCK_DATA.
Definition: pfs_data_lock.h:89
const char * m_lock_mode
Column LOCK_MODE.
Definition: pfs_data_lock.h:83
const char * m_engine
Column ENGINE.
Definition: pfs_data_lock.h:63
const char * m_lock_type
Column LOCK_TYPE.
Definition: pfs_data_lock.h:85
PFS_index_row m_index_row
Columns OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME.
Definition: pfs_data_lock.h:73
ulonglong m_event_id
Column EVENT_ID.
Definition: pfs_data_lock.h:71
pk_pos_data_lock m_hidden_pk
Column ENGINE_LOCK_ID.
Definition: pfs_data_lock.h:65
size_t m_partition_name_length
Definition: pfs_data_lock.h:76
const char * m_partition_name
Column PARTITION_NAME.
Definition: pfs_data_lock.h:75
const char * m_sub_partition_name
Column SUB_PARTITION_NAME.
Definition: pfs_data_lock.h:78
Helpers to implement a performance schema table.