MySQL 8.0.31
Source Code Documentation
charset.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef DD__CHARSET_INCLUDED
24#define DD__CHARSET_INCLUDED
25
26#include "my_inttypes.h"
27#include "sql/dd/types/entity_object.h" // dd::Entity_object
28
29namespace dd {
30
31///////////////////////////////////////////////////////////////////////////
32
33class Charset_impl;
34class Collation;
35class Primary_id_key;
36class Global_name_key;
37class Void_key;
38
39namespace tables {
40class Character_sets;
41}
42
43///////////////////////////////////////////////////////////////////////////
44
45class Charset : virtual public Entity_object {
46 public:
53
54 // We need a set of functions to update a preallocated key.
55 virtual bool update_id_key(Id_key *key) const {
56 return update_id_key(key, id());
57 }
58
59 static bool update_id_key(Id_key *key, Object_id id);
60
61 virtual bool update_name_key(Name_key *key) const {
62 return update_name_key(key, name());
63 }
64
65 static bool update_name_key(Name_key *key, const String_type &name);
66
67 virtual bool update_aux_key(Aux_key *) const { return true; }
68
69 public:
70 /////////////////////////////////////////////////////////////////////////
71 // Default collation.
72 /////////////////////////////////////////////////////////////////////////
73
74 virtual Object_id default_collation_id() const = 0;
76
77 /////////////////////////////////////////////////////////////////////////
78 // mb_max_length
79 /////////////////////////////////////////////////////////////////////////
80
81 virtual uint mb_max_length() const = 0;
82
83 /////////////////////////////////////////////////////////////////////////
84 // comment
85 /////////////////////////////////////////////////////////////////////////
86
87 virtual const String_type &comment() const = 0;
88
89 /**
90 Allocate a new object and invoke the copy constructor.
91
92 @return pointer to dynamically allocated copy
93 */
94 virtual Charset *clone() const = 0;
95
96 /**
97 Allocate a new object which can serve as a placeholder for the original
98 object in the Dictionary_client's dropped registry (i.e. it has the same
99 keys as original).
100 */
102};
103
104///////////////////////////////////////////////////////////////////////////
105
106} // namespace dd
107
108#endif // DD__CHARSET_INCLUDED
Definition: charset_impl.h:48
Definition: charset.h:45
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:51
virtual void set_default_collation_id(Object_id default_collation_id)=0
virtual bool update_id_key(Id_key *key) const
Definition: charset.h:55
virtual Object_id default_collation_id() const =0
Primary_id_key Id_key
Definition: charset.h:50
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:49
Charset Cache_partition
Definition: charset.h:48
Charset_impl Impl
Definition: charset.h:47
virtual bool update_name_key(Name_key *key) const
Definition: charset.h:61
virtual bool update_aux_key(Aux_key *) const
Definition: charset.h:67
Void_key Aux_key
Definition: charset.h:52
virtual const String_type & comment() const =0
Base class for dictionary objects which has single column integer primary key.
Definition: entity_object.h:47
virtual const String_type & name() const =0
Definition: object_keys.h:122
Definition: object_keys.h:76
Definition: object_keys.h:53
Definition: character_sets.h:42
Some integer typedefs for easier portability.
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
required string key
Definition: replication_asynchronous_connection_failover.proto:59
unsigned int uint
Definition: uca-dump.cc:29