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