MySQL 8.4.0
Source Code Documentation
sql_locale.h
Go to the documentation of this file.
1/* Copyright (c) 2006, 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 SQL_LOCALE_INCLUDED
25#define SQL_LOCALE_INCLUDED
26
27#include <sys/types.h>
28
29#include "my_inttypes.h" // IWYU pragma: keep
30#include "my_sharedlib.h"
31
33class THD;
34
35struct TYPELIB;
36
37class MY_LOCALE {
38 public:
39 uint number;
40 const char *name;
41 const char *description;
42 const bool is_ascii;
51 const char *grouping;
53 MY_LOCALE(uint number_par, const char *name_par, const char *descr_par,
54 bool is_ascii_par, TYPELIB *month_names_par,
55 TYPELIB *ab_month_names_par, TYPELIB *day_names_par,
56 TYPELIB *ab_day_names_par, uint max_month_name_length_par,
57 uint max_day_name_length_par, uint decimal_point_par,
58 uint thousand_sep_par, const char *grouping_par,
59 MY_LOCALE_ERRMSGS *errmsgs_par)
60 : number(number_par),
61 name(name_par),
62 description(descr_par),
63 is_ascii(is_ascii_par),
64 month_names(month_names_par),
65 ab_month_names(ab_month_names_par),
66 day_names(day_names_par),
67 ab_day_names(ab_day_names_par),
68 max_month_name_length(max_month_name_length_par),
69 max_day_name_length(max_day_name_length_par),
70 decimal_point(decimal_point_par),
71 thousand_sep(thousand_sep_par),
72 grouping(grouping_par),
73 errmsgs(errmsgs_par) {}
74};
75/* Exported variables */
76
78extern MY_LOCALE *my_locales[];
81
82/* Exported functions */
83
84MY_LOCALE *my_locale_by_name(THD *thd, const char *name, size_t length);
85MY_LOCALE *my_locale_by_number(uint number);
86void cleanup_errmsgs(void);
87
88#endif /* SQL_LOCALE_INCLUDED */
Definition: derror.h:56
Definition: sql_locale.h:37
TYPELIB * month_names
Definition: sql_locale.h:43
TYPELIB * ab_day_names
Definition: sql_locale.h:46
uint decimal_point
Definition: sql_locale.h:49
const char * description
Definition: sql_locale.h:41
uint thousand_sep
Definition: sql_locale.h:50
const char * grouping
Definition: sql_locale.h:51
TYPELIB * day_names
Definition: sql_locale.h:45
const bool is_ascii
Definition: sql_locale.h:42
uint max_day_name_length
Definition: sql_locale.h:48
MY_LOCALE(uint number_par, const char *name_par, const char *descr_par, bool is_ascii_par, TYPELIB *month_names_par, TYPELIB *ab_month_names_par, TYPELIB *day_names_par, TYPELIB *ab_day_names_par, uint max_month_name_length_par, uint max_day_name_length_par, uint decimal_point_par, uint thousand_sep_par, const char *grouping_par, MY_LOCALE_ERRMSGS *errmsgs_par)
Definition: sql_locale.h:53
const char * name
Definition: sql_locale.h:40
MY_LOCALE_ERRMSGS * errmsgs
Definition: sql_locale.h:52
TYPELIB * ab_month_names
Definition: sql_locale.h:44
uint max_month_name_length
Definition: sql_locale.h:47
uint number
Definition: sql_locale.h:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Some integer typedefs for easier portability.
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:71
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
void cleanup_errmsgs(void)
Definition: sql_locale.cc:2914
MY_LOCALE * my_locale_by_number(uint number)
Definition: sql_locale.cc:2866
MY_LOCALE * my_locales[]
Definition: sql_locale.cc:2834
MY_LOCALE * my_default_lc_time_names
Definition: mysqld.cc:1547
MYSQL_PLUGIN_IMPORT MY_LOCALE * my_default_lc_messages
Definition: mysqld.cc:1546
MY_LOCALE my_locale_en_US
MY_LOCALE * my_locale_by_name(THD *thd, const char *name, size_t length)
Definition: sql_locale.cc:2886
case opt name
Definition: sslopt-case.h:29
Definition: typelib.h:35