MySQL  8.0.17
Source Code Documentation
sql_locale.h
Go to the documentation of this file.
1 /* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
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 
31 class MY_LOCALE_ERRMSGS;
32 class THD;
33 
34 struct TYPELIB;
35 
36 class 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 
77 extern MY_LOCALE *my_locales[];
80 
81 /* Exported functions */
82 
83 MY_LOCALE *my_locale_by_name(THD *thd, const char *name, size_t length);
85 void cleanup_errmsgs(void);
86 
87 #endif /* SQL_LOCALE_INCLUDED */
uint thousand_sep
Definition: sql_locale.h:49
TYPELIB * day_names
Definition: sql_locale.h:44
MY_LOCALE * my_locales[]
Definition: sql_locale.cc:2831
MYSQL_PLUGIN_IMPORT MY_LOCALE * my_default_lc_messages
Definition: mysqld.cc:1322
const char * name
Definition: sql_locale.h:39
const string name("\ame\)
MY_LOCALE * my_locale_by_number(uint number)
Definition: sql_locale.cc:2863
Some integer typedefs for easier portability.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
uint number
Definition: sql_locale.h:38
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
Functions related to handling of plugins and other dynamically loaded libraries.
const bool is_ascii
Definition: sql_locale.h:41
MY_LOCALE * my_locale_by_name(THD *thd, const char *name, size_t length)
Definition: sql_locale.cc:2883
uint max_month_name_length
Definition: sql_locale.h:46
unsigned int uint
Definition: uca-dump.cc:29
uint max_day_name_length
Definition: sql_locale.h:47
const char * description
Definition: sql_locale.h:40
Definition: typelib.h:34
void cleanup_errmsgs(void)
Definition: sql_locale.cc:2911
MY_LOCALE_ERRMSGS * errmsgs
Definition: sql_locale.h:51
TYPELIB * ab_day_names
Definition: sql_locale.h:45
const char * grouping
Definition: sql_locale.h:50
Definition: derror.h:56
TYPELIB * ab_month_names
Definition: sql_locale.h:43
uint decimal_point
Definition: sql_locale.h:48
MY_LOCALE * my_default_lc_time_names
Definition: mysqld.cc:1323
Definition: sql_locale.h:36
MY_LOCALE my_locale_en_US
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
TYPELIB * month_names
Definition: sql_locale.h:42
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:777