MySQL 8.4.2
Source Code Documentation
charset.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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__CHARSET_INCLUDED
25#define DD__CHARSET_INCLUDED
26
27#include "my_inttypes.h"
28#include "sql/dd/types/entity_object.h" // dd::Entity_object
29
30namespace dd {
31
32///////////////////////////////////////////////////////////////////////////
33
34class Charset_impl;
35class Collation;
36class Primary_id_key;
37class Global_name_key;
38class Void_key;
39
40namespace tables {
41class Character_sets;
42}
43
44///////////////////////////////////////////////////////////////////////////
45
46class Charset : virtual public Entity_object {
47 public:
54
55 // We need a set of functions to update a preallocated key.
56 virtual bool update_id_key(Id_key *key) const {
57 return update_id_key(key, id());
58 }
59
60 static bool update_id_key(Id_key *key, Object_id id);
61
62 virtual bool update_name_key(Name_key *key) const {
63 return update_name_key(key, name());
64 }
65
66 static bool update_name_key(Name_key *key, const String_type &name);
67
68 virtual bool update_aux_key(Aux_key *) const { return true; }
69
70 public:
71 /////////////////////////////////////////////////////////////////////////
72 // Default collation.
73 /////////////////////////////////////////////////////////////////////////
74
75 virtual Object_id default_collation_id() const = 0;
77
78 /////////////////////////////////////////////////////////////////////////
79 // mb_max_length
80 /////////////////////////////////////////////////////////////////////////
81
82 virtual uint mb_max_length() const = 0;
83
84 /////////////////////////////////////////////////////////////////////////
85 // comment
86 /////////////////////////////////////////////////////////////////////////
87
88 virtual const String_type &comment() const = 0;
89
90 /**
91 Allocate a new object and invoke the copy constructor.
92
93 @return pointer to dynamically allocated copy
94 */
95 virtual Charset *clone() const = 0;
96
97 /**
98 Allocate a new object which can serve as a placeholder for the original
99 object in the Dictionary_client's dropped registry (i.e. it has the same
100 keys as original).
101 */
103};
104
105///////////////////////////////////////////////////////////////////////////
106
107} // namespace dd
108
109#endif // DD__CHARSET_INCLUDED
Definition: charset_impl.h:49
Definition: charset.h:46
virtual Charset * clone_dropped_object_placeholder() const =0
Allocate a new object which can serve as a placeholder for the original object in the Dictionary_clie...
Global_name_key Name_key
Definition: charset.h:52
virtual void set_default_collation_id(Object_id default_collation_id)=0
virtual bool update_id_key(Id_key *key) const
Definition: charset.h:56
virtual Object_id default_collation_id() const =0
Primary_id_key Id_key
Definition: charset.h:51
virtual Charset * clone() const =0
Allocate a new object and invoke the copy constructor.
virtual uint mb_max_length() const =0
tables::Character_sets DD_table
Definition: charset.h:50
Charset Cache_partition
Definition: charset.h:49
Charset_impl Impl
Definition: charset.h:48
virtual bool update_name_key(Name_key *key) const
Definition: charset.h:62
virtual bool update_aux_key(Aux_key *) const
Definition: charset.h:68
Void_key Aux_key
Definition: charset.h:53
virtual const String_type & comment() const =0
Base class for dictionary objects which has single column integer primary key.
Definition: entity_object.h:48
virtual const String_type & name() const =0
Definition: object_keys.h:123
Definition: object_keys.h:77
Definition: object_keys.h:54
Definition: character_sets.h:45
Some integer typedefs for easier portability.
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
required string key
Definition: replication_asynchronous_connection_failover.proto:60