MySQL 8.0.30
Source Code Documentation
sql_locale.h
Go to the documentation of this file.
1/* Copyright (c) 2006, 2022, 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 SQL_LOCALE_INCLUDED
24#define SQL_LOCALE_INCLUDED
25
26#include <sys/types.h>
27
28#include "my_inttypes.h" // IWYU pragma: keep
29#include "my_sharedlib.h"
30
32class THD;
33
34struct TYPELIB;
35
36class MY_LOCALE {
37 public:
39 const char *name;
40 const char *description;
41 const bool is_ascii;
50 const char *grouping;
52 MY_LOCALE(uint number_par, const char *name_par, const char *descr_par,
53 bool is_ascii_par, TYPELIB *month_names_par,
54 TYPELIB *ab_month_names_par, TYPELIB *day_names_par,
55 TYPELIB *ab_day_names_par, uint max_month_name_length_par,
56 uint max_day_name_length_par, uint decimal_point_par,
57 uint thousand_sep_par, const char *grouping_par,
58 MY_LOCALE_ERRMSGS *errmsgs_par)
59 : number(number_par),
60 name(name_par),
61 description(descr_par),
62 is_ascii(is_ascii_par),
63 month_names(month_names_par),
64 ab_month_names(ab_month_names_par),
65 day_names(day_names_par),
66 ab_day_names(ab_day_names_par),
67 max_month_name_length(max_month_name_length_par),
68 max_day_name_length(max_day_name_length_par),
69 decimal_point(decimal_point_par),
70 thousand_sep(thousand_sep_par),
71 grouping(grouping_par),
72 errmsgs(errmsgs_par) {}
73};
74/* Exported variables */
75
77extern MY_LOCALE *my_locales[];
80
81/* Exported functions */
82
83MY_LOCALE *my_locale_by_name(THD *thd, const char *name, size_t length);
85void cleanup_errmsgs(void);
86
87#endif /* SQL_LOCALE_INCLUDED */
Definition: derror.h:55
Definition: sql_locale.h:36
TYPELIB * month_names
Definition: sql_locale.h:42
TYPELIB * ab_day_names
Definition: sql_locale.h:45
uint decimal_point
Definition: sql_locale.h:48
const char * description
Definition: sql_locale.h:40
uint thousand_sep
Definition: sql_locale.h:49
const char * grouping
Definition: sql_locale.h:50
TYPELIB * day_names
Definition: sql_locale.h:44
const bool is_ascii
Definition: sql_locale.h:41
uint max_day_name_length
Definition: sql_locale.h:47
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:52
const char * name
Definition: sql_locale.h:39
MY_LOCALE_ERRMSGS * errmsgs
Definition: sql_locale.h:51
TYPELIB * ab_month_names
Definition: sql_locale.h:43
uint max_month_name_length
Definition: sql_locale.h:46
uint number
Definition: sql_locale.h:38
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
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:70
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:75
void cleanup_errmsgs(void)
Definition: sql_locale.cc:2912
MY_LOCALE * my_locale_by_number(uint number)
Definition: sql_locale.cc:2864
MY_LOCALE * my_locales[]
Definition: sql_locale.cc:2832
MY_LOCALE * my_default_lc_time_names
Definition: mysqld.cc:1530
MYSQL_PLUGIN_IMPORT MY_LOCALE * my_default_lc_messages
Definition: mysqld.cc:1529
MY_LOCALE my_locale_en_US
MY_LOCALE * my_locale_by_name(THD *thd, const char *name, size_t length)
Definition: sql_locale.cc:2884
case opt name
Definition: sslopt-case.h:32
Definition: typelib.h:34
unsigned int uint
Definition: uca-dump.cc:29