MySQL 9.1.0
Source Code Documentation
dd_utility.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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__UTILITY_INCLUDED
25#define DD__UTILITY_INCLUDED
26
27#include "sql/dd/string_type.h" // dd::String_type
28
29struct CHARSET_INFO;
30class THD;
31
32namespace dd {
33
34///////////////////////////////////////////////////////////////////////////
35
36/**
37 Normalize (or transform) the multibyte character set string.
38
39 The normalized string contains the weight of the each character of the source
40 string. The normalized strings are suitable for the comparisons (strings
41 yields the correct collation order).
42
43 @param cs Character set.
44 @param src Source string.
45 @param[out] normalized_str_buf Buffer to store the normalized string.
46 @param normalized_str_buf_length Size of the normalized_str_buf.
47
48 @returns length of the normalized string. 0 is returned if buffer length is
49 insufficient to store the normalized string.
50*/
51size_t normalize_string(const CHARSET_INFO *cs, const String_type &src,
52 char *normalized_str_buf,
53 size_t normalized_str_buf_length);
54
55/**
56 Check if DDSE (Data Dictionary Storage Engine) is in
57 readonly mode.
58
59 @param thd Thread
60 @param schema_name Abbreviation or name of schema (I_S, P_S, ndbinfo)
61 for use in warning message output; nullptr if no
62 warning should be emitted
63
64 @returns false on success, otherwise true.
65*/
66bool check_if_server_ddse_readonly(THD *thd, const char *schema_name = nullptr);
67
68///////////////////////////////////////////////////////////////////////////
69
70} // namespace dd
71
72#endif
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: commit_order_queue.h:34
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
bool check_if_server_ddse_readonly(THD *thd, const char *schema_name_abbrev)
Check if DDSE (Data Dictionary Storage Engine) is in readonly mode.
Definition: dd_utility.cc:59
size_t normalize_string(const CHARSET_INFO *cs, const String_type &src, char *normalized_str_buf, size_t normalized_str_buf_length)
Normalize (or transform) the multibyte character set string.
Definition: dd_utility.cc:35
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
Definition: m_ctype.h:421