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