MySQL 8.4.0
Source Code Documentation
dictionary_client.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef DD_CACHE__DICTIONARY_CLIENT_INCLUDED
25#define DD_CACHE__DICTIONARY_CLIENT_INCLUDED
26
27#include <assert.h>
28#include <stddef.h>
29#include <functional>
30#include <memory>
31#include <string>
32#include <vector>
33
34#include "my_compiler.h"
35
36#include "object_registry.h" // Object_registry
37#include "sql/dd/object_id.h"
38#include "sql/dd/string_type.h"
39
40class THD;
41struct LEX_USER;
42
43namespace dd {
44class Schema;
45class Table;
46class Entity_object;
47} // namespace dd
48
49namespace dd {
50namespace cache {
51
52class SPI_lru_cache;
53
54/**
55 A smart-pointer for managing an SPI_lru_cache even when it is only
56 forward declared. Automatically allocated cache with new, and assigns
57 m_spi_lru_cache to it, when dereferenced using non-const
58 operator->(). Destructor deletes the object pointed to by
59 m_spi_lru_cache.
60*/
63
64 public:
65 /** Calls delete on m_spi_lru_cache unless nullptr. */
67
68 /**
69 Creates cache on demand if m_spi_lru_cache is nullptr.
70 @return pointer to cache.
71 */
73
74 /**
75 Const overload which does not create cache on demand, but merely
76 returns the pointer.
77 @return pointer to cache (may be nullptr)
78 */
79 const SPI_lru_cache *operator->() const { return m_spi_lru_cache; }
80
81 /*
82 Predicate for nullptr.
83 @return true if points to valid cache, false otherwise.
84 */
85 bool is_nullptr() const { return (m_spi_lru_cache == nullptr); }
86};
87
88/**
89 Implementation of a dictionary client.
90
91 The dictionary client provides a unified interface to accessing dictionary
92 objects. The client is a member of the THD, and is typically used in
93 server code to access the dictionary. When we refer to "the user" below,
94 we mean the server code using the dictionary client.
95
96 The main task of the client is to access a shared cache to retrieve
97 dictionary objects. The shared cache, in its turn, will access the
98 dictionary tables if there is a cache miss.
99
100 To support cache eviction, the shared cache must keep track of which
101 clients that have acquired an object. When a client acquires an object
102 from the shared cache for the first time, it is added to a client local
103 object registry. Further acquisition of the same object from the client
104 will get the object from the client's registry. Thus, the usage tracking
105 in the shared cache only keep track of the number of clients currently
106 using the object, and hence, there must be an operation that complements
107 acquisition, to inform the shared cache that the object is not used
108 anymore. This complementing operation is called releasing the object.
109
110 To manage releasing objects, the Auto_releaser class provides some
111 support. When an auto releaser is instantiated, it will keep track of
112 the objects that are acquired from the shared cache in its lifetime.
113 Auto releasers may be nested or stacked, and the current releaser is
114 the one at the top of the stack. The auto releaser stack is associated
115 with a dictionary client instance. When the auto releaser goes out
116 of scope, it will release all objects that have been acquired from the
117 shared cache in its lifetime. Objects retrieved earlier than that will
118 be automatically released by a releaser further down the auto releaser
119 stack. For more coarse grained control, there is a release method that
120 will release all objects acquired by the client.
121
122 In addition to the auto releasers, the client has an object registry.
123 The registry holds pointers to all currently acquired objects. Thus,
124 the object registry is the union of the registers in the stack of
125 auto releasers. The client's object registry is used for looking up
126 objects, while the registers in the auto releasers are used for
127 releasing objects.
128
129 The client also has a second registry of objects with uncommitted changes.
130 These are objects acquired by acquire_for_modification() or registered
131 with register_uncommitted_object(). These objects are only present in
132 the local registry and not in the shared cache. Once registered, the
133 objects can also be retrieved with normal acquire(). This means that
134 a given client has a view which includes uncommitted changes made
135 using the same client, while other clients do not see these changes.
136
137 @note We must handle situations where an object is actually acquired from
138 the shared cache, while the dynamic cast to a subtype fails. We use
139 the auto release mechanism to achieve that.
140
141 @note When a dictionary client method returns true, indicating that an
142 error has occurred, the error has been reported, either by the
143 client itself, or by the dictionary subsystem.
144*/
145
146template <typename T>
147class Cache_element;
148
150 public:
151 /**
152 Class to help releasing and deleting objects.
153
154 This class keeps a register of shared objects that are automatically
155 released when the instance goes out of scope. When a new instance
156 is created, the encompassing dictionary client's current auto releaser
157 is replaced by this one, keeping a link to the old one. When the
158 auto releaser is deleted, it links the old releaser back in as the
159 client's current releaser.
160
161 Shared objects that are added to the auto releaser will be released when
162 the releaser is deleted. Only the dictionary client is allowed to add
163 objects to the auto releaser.
164
165 The usage pattern is that objects that are retrieved from the shared
166 dictionary cache are added to the current auto releaser. Objects that
167 are retrieved from the client's local object register are not added to
168 the auto releaser. Thus, when the releaser is deleted, it releases all
169 objects that have been retrieved from the shared cache during the
170 lifetime of the releaser.
171
172 Similarly the auto releaser maintains a list of objects created
173 by acquire_uncached(). These objects are owned by the Auto_releaser
174 and are deleted when the auto releaser goes out of scope.
175 */
176
178 friend class Dictionary_client;
179
180 private:
184
185 /**
186 Register an object to be auto released.
187
188 @tparam T Dictionary object type.
189 @param element Cache element to auto release.
190 */
191
192 template <typename T>
194 // Catch situations where we do not use a non-default releaser.
195 assert(m_prev != nullptr);
196 m_release_registry.put(element);
197 }
198
199 /**
200 Transfer an object from the current to the previous auto releaser.
201
202 @tparam T Dictionary object type.
203 @param object Dictionary object to transfer.
204 */
205
206 template <typename T>
207 void transfer_release(const T *object);
208
209 /**
210 Remove an element from some auto releaser down the chain.
211
212 Return a pointer to the releaser where the element was found.
213 Thus, the element may be re-inserted into the appropriate
214 auto releaser after e.g. changing the keys.
215
216 @tparam T Dictionary object type.
217 @param element Cache element to auto remove.
218
219 @return Pointer to the auto releaser where the object was signed up.
220 */
221
222 template <typename T>
224
225 // Create a new empty auto releaser. Used only by the Dictionary_client.
227
228 public:
229 /**
230 Create a new auto releaser and link it into the dictionary client
231 as the current releaser.
232
233 @param client Dictionary client for which to install this auto
234 releaser.
235 */
236
237 explicit Auto_releaser(Dictionary_client *client);
238
239 // Release all objects registered and restore previous releaser.
241
242 // Debug dump to stderr.
243 template <typename T>
244 void dump() const;
245 };
246
247 private:
248 std::vector<Entity_object *> m_uncached_objects; // Objects to be deleted.
249 Object_registry m_registry_committed; // Registry of committed objects.
250 Object_registry m_registry_uncommitted; // Registry of uncommitted objects.
251 Object_registry m_registry_dropped; // Registry of dropped objects.
252 THD *m_thd; // Thread context, needed for cache misses.
253 Auto_releaser m_default_releaser; // Default auto releaser.
254 Auto_releaser *m_current_releaser; // Current auto releaser.
255
256 /**
257 Se-private ids known not to exist in either TABLES or PARTITIONS
258 or both.
259 */
261
262 /**
263 Get a dictionary object.
264
265 The operation retrieves a dictionary object by one of its keys from the
266 cache and returns it through the object parameter. If the object is
267 already present in the client's local object registry, it is fetched
268 from there. Otherwise, it is fetched from the shared cache (possibly
269 involving a cache miss), and eventually added to the local object
270 registry.
271
272 If no object is found for the given key, NULL is returned. The shared
273 cache owns the returned object, i.e., the caller must not delete it.
274 After using the object(s), the user must release it using one of the
275 release mechanisms described earlier.
276
277 The reference counter for the object is incremented if the object is
278 retrieved from the shared cache. If the object was present in the local
279 registry, the reference counter stays the same. A cache miss is handled
280 transparently by the shared cache.
281
282 @note This function must be called with type T being the same as
283 T::Cache_partition. Dynamic casting to the actual subtype
284 must be done at an outer level.
285
286 @tparam K Key type.
287 @tparam T Dictionary object type.
288 @param key Key to use for looking up the object.
289 @param [out] object Object pointer, if an object exists, otherwise NULL.
290 @param [out] local_committed
291 Whether the object was read from the local
292 committed object registry.
293 @param [out] local_uncommitted
294 Whether the object was read from the local
295 uncommitted registry.
296
297 @retval false No error.
298 @retval true Error (from handling a cache miss).
299 */
300
301 template <typename K, typename T>
302 [[nodiscard]] bool acquire(const K &key, const T **object,
303 bool *local_committed, bool *local_uncommitted);
304
305 /**
306 Get an uncommitted dictionary object that can be modified safely.
307
308 The difference between this method and acquire(), is that this method
309 only looks in the local registry of uncommitted objects. That is, object
310 created by acquire_for_modification() or registered with
311 register_uncommitted_object(). It will not access the shared cache.
312 Objects that have been dropped are returned as nullptr, but
313 with the value of the parameter 'dropped' set to 'true'.
314
315 @tparam K Key type.
316 @tparam T Dictionary object type.
317 @param key Key to use for looking up the object.
318 @param [out] object Object pointer, if an object exists, otherwise NULL.
319 @param [out] dropped Object exists, but has been dropped and has not yet
320 committed. In this case, 'object' is set to nullptr.
321 */
322
323 template <typename K, typename T>
324 void acquire_uncommitted(const K &key, T **object, bool *dropped);
325
326 /**
327 Mark all objects of a certain type as not being used by this client.
328
329 This function is called with the client's own object registry, or with
330 the registry of an auto releaser (which will contain a subset of the
331 objects in the client's object registry).
332
333 The function will release all objects of a given type in the registry
334 submitted.The objects must be present and in use. If the objects become
335 unused, they are added to the free list in the shared cache, which is
336 then rectified to enforce its capacity constraints. The objects are also
337 removed from the client's object registry.
338
339 @tparam T Dictionary object type.
340 @param registry Object registry tp release from.
341
342 @return Number of objects released.
343 */
344
345 template <typename T>
346 size_t release(Object_registry *registry);
347
348 /**
349 Release all objects in the submitted object registry.
350
351 This function will release all objects from the client's registry, or
352 from the registry of an auto releaser.
353
354 @param registry Object registry tp release from.
355
356 @return Number of objects released.
357 */
358
359 size_t release(Object_registry *registry);
360
361 /**
362 Register an uncached object to be auto deleted.
363
364 @tparam T Dictionary object type.
365 @param object Dictionary object to auto delete.
366 */
367
368 template <typename T>
369 void auto_delete(T *object) {
370#ifndef NDEBUG
371 // Make sure we do not sign up a shared object for auto delete.
374 static_cast<const typename T::Cache_partition *>(object), &element);
375 assert(element == nullptr);
376
377 // Make sure we do not sign up an uncommitted object for auto delete.
379 static_cast<const typename T::Cache_partition *>(object), &element);
380 assert(element == nullptr);
381
382 // We must require a top level non-default releaser to ensure a
383 // predictable life span of the objects.
385#endif
386
387 m_uncached_objects.push_back(object);
388 }
389
390 /**
391 Remove an object from the auto delete vector.
392
393 @tparam T Dictionary object type.
394 @param object Dictionary object to keep.
395 */
396
397 template <typename T>
398 void no_auto_delete(T *object) {
399#ifndef NDEBUG
400 // Make sure the object has been registered as uncommitted.
403 static_cast<const typename T::Cache_partition *>(object), &element);
404 assert(element != nullptr);
405#endif
407 m_uncached_objects.end(), object),
408 m_uncached_objects.end());
409 }
410
411 /**
412 Transfer object ownership from caller to Dictionary_client,
413 and register the object as uncommitted.
414
415 This is intended for objects created by the caller that should
416 be managed by Dictionary_client. Transferring an object in this
417 way will make it accessible by calling acquire().
418
419 This method takes a non-const argument as it only makes
420 sense to register objects not acquired from the shared cache.
421
422 @tparam T Dictionary object type.
423 @param object Object to transfer ownership.
424 */
425
426 template <typename T>
427 void register_uncommitted_object(T *object);
428
429 /**
430 Transfer object ownership from caller to Dictionary_client,
431 and register the object as dropped.
432
433 This method is used internally by the Dictionary_client for
434 keeping track of dropped objects. This is needed before
435 transaction commit if an attempt is made to acquire the
436 dropped object, to avoid consulting the shared cache, which
437 might contaminate the cache due to a cache miss (handled with
438 isolation level READ_COMMITTED). Instead of consulting the
439 shared cache, this Dictionary_client will recognize that the
440 object is dropped, and return a nullptr.
441
442 This method takes a non-const argument as it only makes
443 sense to register objects not acquired from the shared cache.
444
445 @tparam T Dictionary object type.
446 @param object Object to transfer ownership.
447 */
448
449 template <typename T>
450 void register_dropped_object(T *object);
451
452 /**
453 Remove the uncommitted objects from the client and (depending
454 on the parameter) put them into the shared cache,
455 thereby making them visible to other clients. Should be called
456 after commit to disk but before metadata locks are released.
457
458 Can also be called after rollback in order to explicitly throw
459 the modified objects away before making any actions to compensate
460 for a partially completed statement. Note that uncommitted objects
461 are automatically removed once the topmost stack-allocated auto
462 releaser goes out of scope, so calling this function in case of
463 abort is only needed to make acquire return the old object again
464 later in the same statement.
465
466 @param commit_to_shared_cache
467 If true, uncommitted objects will
468 be put into the shared cache.
469 @tparam T Dictionary object type.
470 */
471
472 template <typename T>
473 void remove_uncommitted_objects(bool commit_to_shared_cache);
474
475 template <typename T>
476 using Const_ptr_vec = std::vector<const T *>;
477
478 /**
479 Fetch objects from DD tables that match the supplied key.
480
481 @tparam Object_type Type of object to fetch.
482 @param coll Vector to fill with objects.
483 @param object_key The search key. If key is not supplied, then
484 we do full index scan.
485
486 @return false Success.
487 @return true Failure (error is reported).
488 */
489
490 template <typename Object_type>
491 [[nodiscard]] bool fetch(Const_ptr_vec<Object_type> *coll,
492 const Object_key *object_key);
493
494 /**
495 Auxiliary function to retrieve an object by its object id without caching
496 it.It is responsibility of the caller to delete the retrieved object.
497 */
498 template <typename T>
499 bool acquire_uncached_impl(Object_id id, T **object);
500
501 /**
502 Auxiliary function to retrieve a possibly uncommitted object by its object
503 id without caching it. It is responsibility of the caller to delete the
504 retrieved object.
505 */
506 template <typename T>
507 bool acquire_uncached_uncommitted_impl(Object_id id, T **object);
508
509 public:
510 // Initialize an instance with a default auto releaser.
511 explicit Dictionary_client(THD *thd);
512
513 // Make sure all objects are released.
515
518 /**
519 Retrieve an object by its object id.
520
521 @tparam T Dictionary object type.
522 @param id Object id to retrieve.
523 @param [out] object Dictionary object, if present; otherwise NULL.
524
525 @retval false No error.
526 @retval true Error (from handling a cache miss).
527 */
529
530 template <typename T>
531 [[nodiscard]] bool acquire(Object_id id, const T **object);
532
533 /**
534 Retrieve an object by its object id.
535
536 This function returns a cloned object that can be modified.
537
538 @tparam T Dictionary object type.
539 @param id Object id to retrieve.
540 @param [out] object Dictionary object, if present; otherwise NULL.
541
542 @retval false No error.
543 @retval true Error (from handling a cache miss).
544 */
545
546 template <typename T>
547 [[nodiscard]] bool acquire_for_modification(Object_id id, T **object);
548
549 /**
550 Retrieve an object by its object id without caching it.
551
552 The object is not cached but owned by the dictionary client, who
553 makes sure it is deleted. The object must not be released, and may not
554 be used as a parameter to the other dictionary client methods since it is
555 not known by the object registry.
556
557 @tparam T Dictionary object type.
558 @param id Object id to retrieve.
559 @param [out] object Dictionary object, if present; otherwise NULL.
560
561 @retval false No error.
562 @retval true Error (from reading the dictionary tables).
563 */
564
565 template <typename T>
566 [[nodiscard]] bool acquire_uncached(Object_id id, T **object);
567
568 /**
569 Retrieve an object by its object id without caching it.
570
571 The object is not cached and owned by the caller through unique_ptr
572 it provides. The object may not be used as a parameter to the other
573 dictionary client methods since it is not known by the object registry.
574
575 @tparam T Dictionary object type.
576 @param id Object id to retrieve.
577 @param [out] object_ptr Smart pointer with dictionary object,
578 if present or with nullptr otherwise.
579
580 @retval false No error.
581 @retval true Error (from reading the dictionary tables).
582 */
583 template <typename T>
584 [[nodiscard]] bool acquire_uncached(Object_id id,
585 std::unique_ptr<T> *object_ptr);
586
587 /**
588 Retrieve a possibly uncommitted object by its object id without caching it.
589
590 The object is not cached but owned by the dictionary client, who
591 makes sure it is deleted. The object must not be released, and may not
592 be used as a parameter to the other dictionary client methods since it is
593 not known by the object registry.
594
595 When the object is read from the persistent tables, the transaction
596 isolation level is READ UNCOMMITTED. This is necessary to be able to
597 read uncommitted data from an earlier stage of the same session.
598
599 @tparam T Dictionary object type.
600 @param id Object id to retrieve.
601 @param [out] object Dictionary object, if present; otherwise nullptr.
602
603 @retval false No error.
604 @retval true Error (from reading the dictionary tables).
605 */
606
607 template <typename T>
608 [[nodiscard]] bool acquire_uncached_uncommitted(Object_id id, T **object);
609
610 /**
611 Retrieve a possibly uncommitted object by its object id without caching it.
612
613 The object is not cached and owned by the caller through unique_ptr
614 it provides. The object may not be used as a parameter to the other
615 dictionary client methods since it is not known by the object registry.
616
617 When the object is read from the persistent tables, the transaction
618 isolation level is READ UNCOMMITTED. This is necessary to be able to
619 read uncommitted data from an earlier stage of the same session.
620
621 @tparam T Dictionary object type.
622 @param id Object id to retrieve.
623 @param [out] object_ptr Smart pointer with dictionary object,
624 if present or with nullptr otherwise.
625
626 @retval false No error.
627 @retval true Error (from reading the dictionary tables).
628 */
629 template <typename T>
630 [[nodiscard]] bool acquire_uncached_uncommitted(
631 Object_id id, std::unique_ptr<T> *object_ptr);
632
633 /**
634 Retrieve an object by its name.
635
636 @tparam T Dictionary object type.
637 @param object_name Name of the object.
638 @param [out] object Dictionary object, if present; otherwise NULL.
639
640 @retval false No error.
641 @retval true Error (from handling a cache miss).
642 */
643
644 template <typename T>
645 [[nodiscard]] bool acquire(const String_type &object_name, const T **object);
646
647 /**
648 Retrieve an object by its name.
649
650 This function returns a cloned object that can be modified.
651
652 @tparam T Dictionary object type.
653 @param object_name Name of the object.
654 @param [out] object Dictionary object, if present; otherwise NULL.
655
656 @retval false No error.
657 @retval true Error (from handling a cache miss).
658 */
659
660 template <typename T>
661 [[nodiscard]] bool acquire_for_modification(const String_type &object_name,
662 T **object);
663
664 /**
665 Retrieve an object by its schema- and object name.
666
667 @note We will acquire an IX-lock on the schema name unless we already
668 have one. This is needed for proper synchronization with schema
669 DDL in cases where the table does not exist, and where the
670 indirect synchronization based on table names therefore will not
671 apply.
672
673 @todo TODO: We should change the MDL acquisition (see above) for a more
674 long term solution.
675
676 @tparam T Dictionary object type.
677 @param schema_name Name of the schema containing the object.
678 @param object_name Name of the object.
679 @param [out] object Dictionary object, if present; otherwise NULL.
680
681 @retval false No error.
682 @retval true Error (from handling a cache miss, or from
683 failing to get an MDL lock).
684 */
685
686 template <typename T>
687 [[nodiscard]] bool acquire(const String_type &schema_name,
688 const String_type &object_name, const T **object);
689
690 /**
691 Retrieve an object by its schema- and object name.
692
693 This function returns a cloned object that can be modified.
694
695 @note We will acquire an IX-lock on the schema name unless we already
696 have one. This is needed for proper synchronization with schema
697 DDL in cases where the table does not exist, and where the
698 indirect synchronization based on table names therefore will not
699 apply.
700
701 @todo TODO: We should change the MDL acquisition (see above) for a more
702 long term solution.
703
704 @tparam T Dictionary object type.
705 @param schema_name Name of the schema containing the object.
706 @param object_name Name of the object.
707 @param [out] object Dictionary object, if present; otherwise NULL.
708
709 @retval false No error.
710 @retval true Error (from handling a cache miss, or from
711 failing to get an MDL lock).
712 */
713
714 template <typename T>
715 [[nodiscard]] bool acquire_for_modification(const String_type &schema_name,
716 const String_type &object_name,
717 T **object);
718
719 /**
720 Retrieve an object by its schema- and object name.
721
722 @note We will acquire an IX-lock on the schema name unless we already
723 have one. This is needed for proper synchronization with schema
724 DDL in cases where the table does not exist, and where the
725 indirect synchronization based on table names therefore will not
726 apply.
727
728 @note This is a variant of the method above asking for an object of type
729 T, and hence using T's functions for updating name keys etc.
730 This function, however, returns the instance pointed to as type
731 T::Cache_partition to ease handling of various subtypes
732 of the same base type.
733
734 @todo TODO: We should change the MDL acquisition (see above) for a more
735 long term solution.
736
737 @tparam T Dictionary object type.
738 @param schema_name Name of the schema containing the object.
739 @param object_name Name of the object.
740 @param [out] object Dictionary object, if present; otherwise NULL.
741
742 @retval false No error.
743 @retval true Error (from handling a cache miss, or from
744 failing to get an MDL lock).
745 */
746
747 template <typename T>
748 [[nodiscard]] bool acquire(const String_type &schema_name,
749 const String_type &object_name,
750 const typename T::Cache_partition **object);
751
752 /**
753 Retrieve an object by its schema- and object name.
754
755 This function returns a cloned object that can be modified.
756
757 @note We will acquire an IX-lock on the schema name unless we already
758 have one. This is needed for proper synchronization with schema
759 DDL in cases where the table does not exist, and where the
760 indirect synchronization based on table names therefore will not
761 apply.
762
763 @note This is a variant of the method above asking for an object of type
764 T, and hence using T's functions for updating name keys etc.
765 This function, however, returns the instance pointed to as type
766 T::Cache_partition to ease handling of various subtypes
767 of the same base type.
768
769 @todo TODO: We should change the MDL acquisition (see above) for a more
770 long term solution.
771
772 @tparam T Dictionary object type.
773 @param schema_name Name of the schema containing the object.
774 @param object_name Name of the object.
775 @param [out] object Dictionary object, if present; otherwise NULL.
776
777 @retval false No error.
778 @retval true Error (from handling a cache miss, or from
779 failing to get an MDL lock).
780 */
781
782 template <typename T>
783 [[nodiscard]] bool acquire_for_modification(
784 const String_type &schema_name, const String_type &object_name,
785 typename T::Cache_partition **object);
786
787 /**
788 Retrieve a table object by its se private id.
789
790 @param engine Name of the engine storing the table.
791 @param se_private_id SE private id of the table.
792 @param [out] table Table object, if present; otherwise NULL.
793 @param skip_spi_cache Optionally skip looking into the missing
794 SE private ID cache. Defaults to false.
795
796 @note The object must be acquired uncached since we cannot acquire a
797 metadata lock in advance since we do not know the table name.
798 Thus, the returned table object is owned by the caller, who must
799 make sure it is deleted.
800
801 @retval false No error or if object was not found.
802 @retval true Error (e.g. from reading DD tables, or if an
803 object of a wrong type was found).
804 */
805
807 const String_type &engine, Object_id se_private_id, Table **table,
808 bool skip_spi_cache = false);
809
810 /**
811 Retrieve a table object by its partition se private id.
812
813 @param engine Name of the engine storing the table.
814 @param se_partition_id SE private id of the partition.
815 @param [out] table Table object, if present; otherwise NULL.
816
817 @retval false No error or if object was not found.
818 @retval true Error (from handling a cache miss).
819 */
820
822 const String_type &engine, Object_id se_partition_id, Table **table);
823
824 /**
825 Retrieve schema and table name by the se private id of the table.
826
827 @param engine Name of the engine storing the table.
828 @param se_private_id SE private id of the table.
829 @param [out] schema_name Name of the schema containing the table.
830 @param [out] table_name Name of the table.
831
832 @retval false No error OR if object was not found.
833 The OUT params will be set to empty
834 string when object is not found.
835 @retval true Error.
836 */
837
838 [[nodiscard]] bool get_table_name_by_se_private_id(const String_type &engine,
839 Object_id se_private_id,
840 String_type *schema_name,
842
843 /**
844 Retrieve schema and table name by the se private id of the partition.
845
846 @param engine Name of the engine storing the table.
847 @param se_partition_id SE private id of the table partition.
848 @param [out] schema_name Name of the schema containing the table.
849 @param [out] table_name Name of the table.
850
851 @retval false No error or if object was not found.
852 The OUT params will be set to empty
853 string when object is not found.
854 @retval true Error.
855 */
856
858 const String_type &engine, Object_id se_partition_id,
859 String_type *schema_name, String_type *table_name);
860
861 /**
862 Retrieve a table name of a given trigger name and schema.
863
864 @param schema Schema containing the trigger.
865 @param trigger_name Name of the trigger.
866 @param [out] table_name Name of the table for which
867 trigger belongs to. Empty string if
868 there is no such trigger.
869
870 @retval false No error.
871 @retval true Error.
872 */
873
874 [[nodiscard]] bool get_table_name_by_trigger_name(
875 const Schema &schema, const String_type &trigger_name,
877
878 /**
879 Check if schema contains foreign key with specified name.
880
881 @param schema Schema containing the foreign key.
882 @param foreign_key_name Name of the foreign key.
883 @param [out] exists Set to true if foreign key with
884 the name provided exists in the
885 schema, false otherwise.
886
887 @retval false No error.
888 @retval true Error.
889 */
890
891 [[nodiscard]] bool check_foreign_key_exists(
892 const Schema &schema, const String_type &foreign_key_name, bool *exists);
893
894 /**
895 Check if schema contains check constraint with specified name.
896
897 @param schema Schema containing the check constraint.
898 @param check_cons_name Name of the check constraint.
899 @param [out] exists Set to true if check constraint with
900 the name provided exists in the
901 schema, false otherwise.
902
903 @retval false No error.
904 @retval true Error.
905 */
906
907 bool check_constraint_exists(const Schema &schema,
908 const String_type &check_cons_name,
909 bool *exists);
910
911 /**
912 Fetch the names of the components in the schema. Hidden components are
913 ignored. E.g., Object with dd::Table::hidden() == true will be ignored.
914
915 @tparam T Type of object to retrieve names for.
916 @param schema Schema for which to get component names.
917 @param [out] names An std::vector containing all object names.
918
919 @return true Failure (error is reported).
920 @return false Success.
921 */
922
923 template <typename T>
924 [[nodiscard]] bool fetch_schema_component_names(
925 const Schema *schema, std::vector<String_type> *names) const;
926
927 /**
928 Fetch the names of the tables in the schema belonging to specific
929 storage engine. E.g., Object with dd::Table::hidden() == true will be
930 ignored.
931
932 @param schema Schema for which to get component names.
933 @param engine Engine name of tables to match.
934 @param [out] names An std::vector containing all object names.
935
936 @return true Failure (error is reported).
937 @return false Success.
938 */
939
940 [[nodiscard]] bool fetch_schema_table_names_by_engine(
941 const Schema *schema, const String_type &engine,
942 std::vector<String_type> *names) const;
943
944 /**
945 Fetch the names of the server tables in the schema. Ignore tables
946 hidden by SE.
947
948 @param schema Schema for which to get component names.
949 @param [out] names An std::vector containing all object names.
950
951 @return true Failure (error is reported).
952 @return false Success.
953 */
954
956 const Schema *schema, std::vector<String_type> *names) const;
957
958 /**
959 Fetch all global component ids of the given type.
960
961 @tparam T Type of components to get.
962 @param [out] ids An std::vector containing all component ids.
963
964 @return true Failure (error is reported).
965 @return false Success.
966 */
967
968 template <typename T>
969 [[nodiscard]] bool fetch_global_component_ids(
970 std::vector<Object_id> *ids) const;
971
972 /**
973 Fetch all global component names of the given type.
974
975 @tparam T Type of components to get.
976 @param [out] names An std::vector containing all component names.
977
978 @return true Failure (error is reported).
979 @return false Success.
980 */
981
982 template <typename T>
983 [[nodiscard]] bool fetch_global_component_names(
984 std::vector<String_type> *names) const;
985
986 /**
987 Execute the submitted lambda function for each entity of the given type
988 selected by the submitted key. If the lambda returns true, iteration
989 stops and the function returns.
990
991 @tparam Object_type Entity type to examine.
992 @param object_key Key to use for selecting entities.
993 @param processor Lambda to execute for each entity.
994 @return true Failure (error is reported unless the lambda
995 returned true).
996 @return false Success.
997 */
998
999 template <typename Object_type>
1000 [[nodiscard]] bool foreach (
1001 const Object_key *object_key,
1002 std::function<bool(std::unique_ptr<Object_type> &)> const &processor)
1003 const;
1004
1005 /**
1006 Fetch all components in the schema.
1007
1008 @tparam T Type of components to get.
1009 @param schema Schema for which to get components.
1010 @param [out] coll An std::vector containing all components.
1011
1012 @return true Failure (error is reported).
1013 @return false Success.
1014 */
1015
1016 template <typename T>
1017 [[nodiscard]] bool fetch_schema_components(const Schema *schema,
1018 Const_ptr_vec<T> *coll);
1019
1020 /**
1021 Fetch all global components of the given type.
1022
1023 @tparam T Type of components to get.
1024 @param [out] coll An std::vector containing all components.
1025
1026 @return true Failure (error is reported).
1027 @return false Success.
1028 */
1029
1030 template <typename T>
1031 [[nodiscard]] bool fetch_global_components(Const_ptr_vec<T> *coll);
1032
1033 /**
1034 Check if a user is referenced as definer by some object of the given type.
1035
1036 @tparam T Type of dictionary objects to check.
1037 @param user User name, including @ and host.
1038 @param [out] is_definer True if the user is referenced as definer
1039 by some object.
1040
1041 @return true Failure (error is reported, is_definer is undefined).
1042 @return false Success.
1043 */
1044 template <typename T>
1045 [[nodiscard]] bool is_user_definer(const LEX_USER &user,
1046 bool *is_definer) const;
1047
1048 /**
1049 Fetch Object ids of all the views referencing base table/ view/ stored
1050 function name specified in "schema"."name". The views are retrieved
1051 using READ_UNCOMMITTED reads as the views could be changed by the same
1052 statement (e.g. multi-table/-view RENAME TABLE).
1053
1054 @tparam T Type of the object (View_table/View_routine)
1055 to retrieve view names for.
1056 @param schema Schema name.
1057 @param tbl_or_sf_name Base table/ View/ Stored function name.
1058 @param[out] view_ids Vector to store Object ids of all the views
1059 referencing schema.name.
1060
1061 @return true Failure (error is reported).
1062 @return false Success.
1063 */
1064 template <typename T>
1065 [[nodiscard]] bool fetch_referencing_views_object_id(
1066 const char *schema, const char *tbl_or_sf_name,
1067 std::vector<Object_id> *view_ids) const;
1068
1069 /**
1070 Fetch the names of tables (children) which have foreign keys
1071 defined to the given table (parent).
1072
1073 @param parent_schema Schema name of parent table.
1074 @param parent_name Table name of parent table.
1075 @param parent_engine Storage engine of parent table.
1076 @param uncommitted Use READ_UNCOMMITTED isolation.
1077 @param[out] children_schemas Schema names of child tables.
1078 @param[out] children_names Table names of child tables.
1079
1080 @return true Failure (error is reported).
1081 @return false Success.
1082
1083 @note Child tables are identified by matching pairs of names.
1084
1085 @note This is a temporary workaround until WL#6049. This function will
1086 *not* take any locks protecting against DDL changes. So the returned
1087 names could become invalid at any time - e.g. due to DROP DATABASE,
1088 DROP TABLE or DROP FOREIGN KEY.
1089 */
1090
1091 [[nodiscard]] bool fetch_fk_children_uncached(
1092 const String_type &parent_schema, const String_type &parent_name,
1093 const String_type &parent_engine, bool uncommitted,
1094 std::vector<String_type> *children_schemas,
1095 std::vector<String_type> *children_names);
1096
1097 /**
1098 Invalidate a cache entry.
1099
1100 This function will acquire a table object based on the schema qualified
1101 table name, and call 'invalidate(table_object)'.
1102
1103 @note This function only applies to tables yet.
1104
1105 @param schema_name Name of the schema containing the table.
1106 @param table_name Name of the table.
1107
1108 @retval false No error.
1109 @retval true Error (from handling a cache miss, or from
1110 failing to get an MDL lock).
1111 */
1112
1113 [[nodiscard]] bool invalidate(const String_type &schema_name,
1114 const String_type &table_name);
1115
1116 /**
1117 Invalidate a cache entry.
1118
1119 This function will remove and delete an object from the shared cache,
1120 based on the id of the object. If the object id is present in the local
1121 object registry and the auto releaser, it will be removed from there as
1122 well.
1123
1124 @note There is no particular consideration of already dropped or modified
1125 objects in this method.
1126
1127 @tparam T Dictionary object type.
1128 @param object Object to be invalidated.
1129 */
1130
1131 template <typename T>
1132 void invalidate(const T *object);
1133
1134 /**
1135 Remove and delete an object from the cache and the dd tables.
1136
1137 This function will remove the object from the local registry as well as
1138 the shared cache. This means that all keys associated with the object will
1139 be removed from the maps, and the cache element wrapper will be deleted.
1140 Afterwards, the object pointed to will also be deleted, and finally, the
1141 corresponding entry in the appropriate dd table is deleted. The object may
1142 not be accessed after calling this function.
1143
1144 @sa invalidate()
1145
1146 @note The object parameter is const since the contents of the object
1147 is not really changed, the object is just deleted. The method
1148 makes sure there is an exclusive meta data lock on the object
1149 name.
1150
1151 @note The argument to this function may come from acquire(), and may
1152 be an instance that is present in the uncommitted registry,
1153 or in the committed registry. These use cases are handled by
1154 the implementation of the function. The ownership of the
1155 'object' is not changed, instead, a clone is created and
1156 added to the dropped registry.
1157
1158 @tparam T Dictionary object type.
1159 @param object Object to be dropped.
1160
1161 @retval false The operation was successful.
1162 @retval true There was an error.
1163 */
1164
1165 template <typename T>
1166 [[nodiscard]] bool drop(const T *object);
1167
1168 /**
1169 Store a new dictionary object.
1170
1171 This function will write the object to the dd tables. The object is
1172 added neither to the dictionary client's object registry nor the shared
1173 cache.
1174
1175 @note A precondition is that the object has not been acquired from the
1176 shared cache. For storing an object which is already in the cache,
1177 please use update().
1178
1179 @note After calling store(), the submitted dictionary object can not be
1180 used for further calls to store(). It might be used as an argument
1181 to update(), but this is not recommended since calling update()
1182 will imply transferring object ownership to the dictionary client.
1183 Instead, please call 'acquire_for_modification()' to get a new
1184 object instance to use for modification and further updates.
1185
1186 @tparam T Dictionary object type.
1187 @param object Object to be stored.
1188
1189 @retval false The operation was successful.
1190 @retval true There was an error.
1191 */
1192
1193 template <typename T>
1194 [[nodiscard]] bool store(T *object);
1195
1196 /**
1197 Update a persisted dictionary object, but keep the shared cache unchanged.
1198
1199 This function will store a dictionary object to the DD tables after
1200 verifying that an object with the same id already exists. The old object,
1201 which may be present in the shared dictionary cache, is not modified. To
1202 make the changes visible in the shared cache, please call
1203 remove_uncommitted_objects().
1204
1205 @note A precondition is that the object has been acquired from the
1206 shared cache indirectly by acquire_for_modification(). For storing
1207 an object which is not already in the cache, please use store().
1208
1209 @note The new_object pointer submitted to this function, is owned by the
1210 auto delete vector. When registering the new object as an uncommitted
1211 object, the object must be removed from the auto delete vector.
1212
1213 @tparam T Dictionary object type.
1214 @param new_object New object, not present in the cache, to be
1215 stored persistently.
1216
1217 @retval false The operation was successful.
1218 @retval true There was an error.
1219 */
1220
1221 template <typename T>
1222 [[nodiscard]] bool update(T *new_object);
1223
1224 /**
1225 Remove the uncommitted objects from the client.
1226
1227 Can also be used to explicitly throw the modified objects
1228 away before making any actions to compensate
1229 for a partially completed statement. Note that uncommitted objects
1230 are automatically removed once the topmost stack-allocated auto
1231 releaser goes out of scope, so calling this function in case of
1232 abort is only needed to make acquire return the old object again
1233 later in the same statement.
1234 */
1235
1237
1238 /**
1239 Remove the uncommitted objects from the client and put them into
1240 the shared cache, thereby making them visible to other clients.
1241 Should be called after commit to disk but before metadata locks
1242 are released.
1243 */
1244
1246
1247 /**
1248 Remove table statistics entries from mysql.table_stats and
1249 mysql.index_stats.
1250
1251 @param schema_name Schema name of the table
1252 @param table_name Table name of which stats should be cleaned.
1253
1254 @return true - on failure
1255 @return false - on success
1256 */
1257 [[nodiscard]] bool remove_table_dynamic_statistics(
1258 const String_type &schema_name, const String_type &table_name);
1259
1260 /**
1261 Debug dump of a partition of the client and its registry to stderr.
1262
1263 @tparam T Dictionary object type.
1264 */
1265
1266 template <typename T>
1267 void dump() const;
1268};
1269
1270} // namespace cache
1271} // namespace dd
1272
1273// Functions declarations exported only to facilitate unit testing.
1277} // namespace dd_cache_unittest
1278
1279#endif // DD_CACHE__DICTIONARY_CLIENT_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Base class for dictionary objects which has single column integer primary key.
Definition: entity_object.h:48
Definition: object_key.h:38
Definition: schema.h:63
Definition: table.h:47
Implementation of a dictionary client.
Definition: cache_element.h:69
Class to help releasing and deleting objects.
Definition: dictionary_client.h:177
void dump() const
Definition: dictionary_client.cc:828
Auto_releaser * m_prev
Definition: dictionary_client.h:183
~Auto_releaser()
Definition: dictionary_client.cc:784
Auto_releaser * remove(Cache_element< T > *element)
Remove an element from some auto releaser down the chain.
Dictionary_client * m_client
Definition: dictionary_client.h:181
Object_registry m_release_registry
Definition: dictionary_client.h:182
Auto_releaser()
Definition: dictionary_client.cc:766
void transfer_release(const T *object)
Transfer an object from the current to the previous auto releaser.
Definition: dictionary_client.cc:735
void auto_release(Cache_element< T > *element)
Register an object to be auto released.
Definition: dictionary_client.h:193
Definition: dictionary_client.h:149
THD * m_thd
Definition: dictionary_client.h:252
bool acquire_uncached(Object_id id, T **object)
Retrieve an object by its object id without caching it.
Definition: dictionary_client.cc:1187
Auto_releaser * m_current_releaser
Definition: dictionary_client.h:254
void dump() const
Debug dump of a partition of the client and its registry to stderr.
Definition: dictionary_client.cc:2943
bool fetch_referencing_views_object_id(const char *schema, const char *tbl_or_sf_name, std::vector< Object_id > *view_ids) const
Fetch Object ids of all the views referencing base table/ view/ stored function name specified in "sc...
Definition: dictionary_client.cc:2300
Object_registry m_registry_committed
Definition: dictionary_client.h:249
bool drop(const T *object)
Remove and delete an object from the cache and the dd tables.
Definition: dictionary_client.cc:2533
bool acquire_for_modification(Object_id id, T **object)
Retrieve an object by its object id.
Definition: dictionary_client.cc:1124
bool fetch_global_components(Const_ptr_vec< T > *coll)
Fetch all global components of the given type.
Definition: dictionary_client.cc:2254
bool fetch_fk_children_uncached(const String_type &parent_schema, const String_type &parent_name, const String_type &parent_engine, bool uncommitted, std::vector< String_type > *children_schemas, std::vector< String_type > *children_names)
Fetch the names of tables (children) which have foreign keys defined to the given table (parent).
Definition: dictionary_client.cc:2346
Object_registry m_registry_dropped
Definition: dictionary_client.h:251
~Dictionary_client()
Definition: dictionary_client.cc:1065
bool get_table_name_by_trigger_name(const Schema &schema, const String_type &trigger_name, String_type *table_name)
Retrieve a table name of a given trigger name and schema.
Definition: dictionary_client.cc:1888
bool check_foreign_key_exists(const Schema &schema, const String_type &foreign_key_name, bool *exists)
Check if schema contains foreign key with specified name.
Definition: dictionary_client.cc:1933
bool acquire(const K &key, const T **object, bool *local_committed, bool *local_uncommitted)
Get a dictionary object.
Definition: dictionary_client.cc:866
SPI_lru_cache_owner_ptr m_no_table_spids
Se-private ids known not to exist in either TABLES or PARTITIONS or both.
Definition: dictionary_client.h:260
Auto_releaser m_default_releaser
Definition: dictionary_client.h:253
std::vector< const T * > Const_ptr_vec
Definition: dictionary_client.h:476
bool fetch(Const_ptr_vec< Object_type > *coll, const Object_key *object_key)
Fetch objects from DD tables that match the supplied key.
Definition: dictionary_client.cc:2215
bool acquire_uncached_table_by_se_private_id(const String_type &engine, Object_id se_private_id, Table **table, bool skip_spi_cache=false)
Retrieve a table object by its se private id.
Definition: dictionary_client.cc:1564
bool is_user_definer(const LEX_USER &user, bool *is_definer) const
Check if a user is referenced as definer by some object of the given type.
Definition: dictionary_client.cc:2266
bool acquire_uncached_table_by_partition_se_private_id(const String_type &engine, Object_id se_partition_id, Table **table)
Retrieve a table object by its partition se private id.
Definition: dictionary_client.cc:1623
std::vector< Entity_object * > m_uncached_objects
Definition: dictionary_client.h:248
bool store(T *object)
Store a new dictionary object.
Definition: dictionary_client.cc:2568
bool foreach(const Object_key *object_key, std::function< bool(std::unique_ptr< Object_type > &)> const &processor) const
Execute the submitted lambda function for each entity of the given type selected by the submitted key...
Definition: dictionary_client.cc:2138
void commit_modified_objects()
Remove the uncommitted objects from the client and put them into the shared cache,...
Definition: dictionary_client.cc:2927
bool fetch_schema_table_names_not_hidden_by_se(const Schema *schema, std::vector< String_type > *names) const
Fetch the names of the server tables in the schema.
Definition: dictionary_client.cc:2075
bool fetch_global_component_names(std::vector< String_type > *names) const
Fetch all global component names of the given type.
Definition: dictionary_client.cc:2037
bool update(T *new_object)
Update a persisted dictionary object, but keep the shared cache unchanged.
Definition: dictionary_client.cc:2618
bool remove_table_dynamic_statistics(const String_type &schema_name, const String_type &table_name)
Remove table statistics entries from mysql.table_stats and mysql.index_stats.
Definition: dictionary_client.cc:1714
void remove_uncommitted_objects(bool commit_to_shared_cache)
Remove the uncommitted objects from the client and (depending on the parameter) put them into the sha...
Definition: dictionary_client.cc:2805
bool fetch_schema_component_names(const Schema *schema, std::vector< String_type > *names) const
Fetch the names of the components in the schema.
Definition: dictionary_client.cc:2125
void rollback_modified_objects()
Remove the uncommitted objects from the client.
Definition: dictionary_client.cc:2914
bool fetch_schema_components(const Schema *schema, Const_ptr_vec< T > *coll)
Fetch all components in the schema.
Definition: dictionary_client.cc:2238
bool invalidate(const String_type &schema_name, const String_type &table_name)
Invalidate a cache entry.
Definition: dictionary_client.cc:2432
void register_dropped_object(T *object)
Transfer object ownership from caller to Dictionary_client, and register the object as dropped.
Definition: dictionary_client.cc:2742
bool check_constraint_exists(const Schema &schema, const String_type &check_cons_name, bool *exists)
Check if schema contains check constraint with specified name.
Definition: dictionary_client.cc:1958
Object_registry m_registry_uncommitted
Definition: dictionary_client.h:250
void auto_delete(T *object)
Register an uncached object to be auto deleted.
Definition: dictionary_client.h:369
bool acquire_uncached_uncommitted(Object_id id, T **object)
Retrieve a possibly uncommitted object by its object id without caching it.
Definition: dictionary_client.cc:1253
bool fetch_schema_table_names_by_engine(const Schema *schema, const String_type &engine, std::vector< String_type > *names) const
Fetch the names of the tables in the schema belonging to specific storage engine.
Definition: dictionary_client.cc:2056
void acquire_uncommitted(const K &key, T **object, bool *dropped)
Get an uncommitted dictionary object that can be modified safely.
Definition: dictionary_client.cc:951
size_t release(Object_registry *registry)
Mark all objects of a certain type as not being used by this client.
Definition: dictionary_client.cc:990
bool acquire_uncached_uncommitted_impl(Object_id id, T **object)
Auxiliary function to retrieve a possibly uncommitted object by its object id without caching it.
Definition: dictionary_client.cc:1204
void no_auto_delete(T *object)
Remove an object from the auto delete vector.
Definition: dictionary_client.h:398
bool get_table_name_by_se_private_id(const String_type &engine, Object_id se_private_id, String_type *schema_name, String_type *table_name)
Retrieve schema and table name by the se private id of the table.
Definition: dictionary_client.cc:1799
Dictionary_client(THD *thd)
Definition: dictionary_client.cc:1055
bool acquire_uncached_impl(Object_id id, T **object)
Auxiliary function to retrieve an object by its object id without caching it.It is responsibility of ...
Definition: dictionary_client.cc:1159
bool get_table_name_by_partition_se_private_id(const String_type &engine, Object_id se_partition_id, String_type *schema_name, String_type *table_name)
Retrieve schema and table name by the se private id of the partition.
Definition: dictionary_client.cc:1846
bool fetch_global_component_ids(std::vector< Object_id > *ids) const
Fetch all global component ids of the given type.
Definition: dictionary_client.cc:2017
void register_uncommitted_object(T *object)
Transfer object ownership from caller to Dictionary_client, and register the object as uncommitted.
Definition: dictionary_client.cc:2706
Object registry containing several maps.
Definition: object_registry.h:62
void put(Cache_element< T > *element)
Add a new element to the registry.
Definition: object_registry.h:279
void get(const K &key, Cache_element< T > **element) const
Get the element corresponding to the given key.
Definition: object_registry.h:263
A smart-pointer for managing an SPI_lru_cache even when it is only forward declared.
Definition: dictionary_client.h:61
SPI_lru_cache * m_spi_lru_cache
Definition: dictionary_client.h:62
~SPI_lru_cache_owner_ptr()
Calls delete on m_spi_lru_cache unless nullptr.
Definition: dictionary_client.cc:715
SPI_lru_cache * operator->()
Creates cache on demand if m_spi_lru_cache is nullptr.
Definition: dictionary_client.cc:721
bool is_nullptr() const
Definition: dictionary_client.h:85
const SPI_lru_cache * operator->() const
Const overload which does not create cache on demand, but merely returns the pointer.
Definition: dictionary_client.h:79
Inherit from an instantiation of the template to allow forward-declaring in Dictionary_client.
Definition: dictionary_client.cc:713
Header for compiler-dependent features.
#define MY_COMPILER_DIAGNOSTIC_PUSH()
save the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:285
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:286
#define MY_COMPILER_CLANG_WORKAROUND_TPARAM_DOCBUG()
ignore -Wdocumentation compiler warnings for @tparam.
Definition: my_compiler.h:308
char * user
Definition: mysqladmin.cc:66
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
bool is_cached(const SPI_lru_cache_owner_ptr &cache, Object_id id, SPI_missing_type t)
Definition: dictionary_client.cc:728
Definition: dictionary_client.h:1274
void insert(dd::cache::SPI_lru_cache_owner_ptr &c, dd::Object_id id)
Definition: dictionary_client.cc:3252
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
static mysql_service_status_t remove(reference_caching_channel channel, const char *implementation_name) noexcept
Definition: component.cc:137
const char * table_name
Definition: rules_table_service.cc:56
Definition: gcs_xcom_synode.h:64
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2874
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2438
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:106
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Definition: table.h:2730