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