MySQL 8.0.39
Source Code Documentation
collation.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__COLLATION_INCLUDED
25#define DD__COLLATION_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;
35class Collation_impl;
36class Primary_id_key;
37class Global_name_key;
38class Void_key;
39
40namespace tables {
41class Collations;
42}
43
44///////////////////////////////////////////////////////////////////////////
45
46class Collation : virtual public Entity_object {
47 public:
54
55 // Persisted pad attribute, mapped from Pad_attribute enum defined
56 // in include/m_ctype.h. The setter is not part of the public API,
57 // and there is no getter, since this attribute is only exposed
58 // through the I_S.
60
61 // We need a set of functions to update a preallocated key.
62 virtual bool update_id_key(Id_key *key) const {
63 return update_id_key(key, id());
64 }
65
66 static bool update_id_key(Id_key *key, Object_id id);
67
68 virtual bool update_name_key(Name_key *key) const {
69 return update_name_key(key, name());
70 }
71
72 static bool update_name_key(Name_key *key, const String_type &name);
73
74 virtual bool update_aux_key(Aux_key *) const { return true; }
75
76 public:
77 /////////////////////////////////////////////////////////////////////////
78 // Character set.
79 /////////////////////////////////////////////////////////////////////////
80
81 virtual Object_id charset_id() const = 0;
83
84 /////////////////////////////////////////////////////////////////////////
85 // compiled
86 /////////////////////////////////////////////////////////////////////////
87
88 virtual bool is_compiled() const = 0;
89
90 /////////////////////////////////////////////////////////////////////////
91 // sort_length
92 /////////////////////////////////////////////////////////////////////////
93
94 virtual uint sort_length() const = 0;
95
96 /**
97 Allocate a new object and invoke the copy constructor.
98
99 @return pointer to dynamically allocated copy
100 */
101 virtual Collation *clone() const = 0;
102
103 /**
104 Allocate a new object which can serve as a placeholder for the original
105 object in the Dictionary_client's dropped registry (i.e. it has the same
106 keys as original).
107 */
109};
110
111///////////////////////////////////////////////////////////////////////////
112
113} // namespace dd
114
115#endif // DD__COLLATION_INCLUDED
Definition: collation_impl.h:47
Definition: collation.h:46
Void_key Aux_key
Definition: collation.h:53
tables::Collations DD_table
Definition: collation.h:50
virtual Object_id charset_id() const =0
Primary_id_key Id_key
Definition: collation.h:51
virtual void set_charset_id(Object_id charset_id)=0
Collation_impl Impl
Definition: collation.h:48
virtual bool update_id_key(Id_key *key) const
Definition: collation.h:62
virtual bool update_name_key(Name_key *key) const
Definition: collation.h:68
virtual bool is_compiled() const =0
Global_name_key Name_key
Definition: collation.h:52
virtual Collation * clone() const =0
Allocate a new object and invoke the copy constructor.
virtual Collation * clone_dropped_object_placeholder() const =0
Allocate a new object which can serve as a placeholder for the original object in the Dictionary_clie...
virtual uint sort_length() const =0
Collation Cache_partition
Definition: collation.h:49
enum_pad_attribute
Definition: collation.h:59
@ PA_NO_PAD
Definition: collation.h:59
@ PA_UNDEFINED
Definition: collation.h:59
@ PA_PAD_SPACE
Definition: collation.h:59
virtual bool update_aux_key(Aux_key *) const
Definition: collation.h:74
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: collations.h:43
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
unsigned int uint
Definition: uca9-dump.cc:75