Skip to content

Commit 37f338b

Browse files
author
Anushree Prakash B
committed
WL#16709: Locale and Internationalization support in JavaScript stored
programs [noclose] Modify mysql thd attributes service methods to retrieve locale information. Change-Id: I0aca0ee11862bbc48b7be8564322792ebbee7be1
1 parent 35f4026 commit 37f338b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sql/server_component/mysql_thd_attributes_imp.cc

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2021, 2025, Oracle and/or its affiliates.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
3333
#include "sql/sql_class.h"
3434
#include "sql/sql_digest.h"
3535
#include "sql/sql_lex.h"
36+
#include "sql/sql_locale.h"
3637
#include "sql/sql_rewrite.h"
3738
#include "sql/tztime.h"
3839

@@ -140,6 +141,11 @@ DEFINE_BOOL_METHOD(mysql_thd_attributes_imp::get,
140141
} else if (!strcmp(name, "time_zone_name")) {
141142
*reinterpret_cast<MYSQL_LEX_CSTRING *>(inout_pvalue) =
142143
t->time_zone()->get_name()->lex_cstring();
144+
} else if (!strcmp(name, "locale")) {
145+
auto locale = t->variables.lc_time_names;
146+
const char *locale_name = locale->name;
147+
*((mysql_cstring_with_length *)inout_pvalue) = {locale_name,
148+
strlen(locale_name)};
143149
} else if (!strcmp(name, "da_status")) {
144150
*((uint16_t *)inout_pvalue) = [&t](auto status) {
145151
switch (status) {

0 commit comments

Comments
 (0)