Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9d132648
Commit
9d132648
authored
Nov 02, 2009
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merging a postfix for Bug#46633 Obsolete Serbian locale
from mysql-next-mr-bar
parents
ee15f23c
59ccc261
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
16 deletions
+83
-16
mysql-test/r/locale.result
mysql-test/r/locale.result
+12
-5
mysql-test/t/locale.test
mysql-test/t/locale.test
+6
-5
sql/sql_locale.cc
sql/sql_locale.cc
+65
-6
No files found.
mysql-test/r/locale.result
View file @
9d132648
...
...
@@ -49,11 +49,18 @@ DROP TABLE t1;
#
# Bug#46633 Obsolete Serbian locale name
#
set lc_messages=sr_YU;
ERROR HY000: Unknown locale: 'sr_YU'
set lc_messages=sr_RS;
set lc_time_names=sr_RS;
select format(123456.789, 3, 'sr_RS');
SET lc_messages=sr_YU;
Warnings:
Warning 1287 'sr_YU' is deprecated; use 'sr_RS' instead
SHOW VARIABLES LIKE 'lc_messages';
Variable_name Value
lc_messages sr_RS
SET lc_messages=sr_RS;
SHOW VARIABLES LIKE 'lc_messages';
Variable_name Value
lc_messages sr_RS
SET lc_time_names=sr_RS;
SELECT format(123456.789, 3, 'sr_RS');
format(123456.789, 3, 'sr_RS')
123456.789
End of 5.4 tests
mysql-test/t/locale.test
View file @
9d132648
...
...
@@ -34,10 +34,11 @@ DROP TABLE t1;
--
echo
#
--
echo
# Bug#46633 Obsolete Serbian locale name
--
echo
#
--
error
ER_UNKNOWN_LOCALE
set
lc_messages
=
sr_YU
;
set
lc_messages
=
sr_RS
;
set
lc_time_names
=
sr_RS
;
select
format
(
123456.789
,
3
,
'sr_RS'
);
SET
lc_messages
=
sr_YU
;
SHOW
VARIABLES
LIKE
'lc_messages'
;
SET
lc_messages
=
sr_RS
;
SHOW
VARIABLES
LIKE
'lc_messages'
;
SET
lc_time_names
=
sr_RS
;
SELECT
format
(
123456.789
,
3
,
'sr_RS'
);
--
echo
End
of
5.4
tests
sql/sql_locale.cc
View file @
9d132648
...
...
@@ -1733,6 +1733,24 @@ static TYPELIB my_locale_typelib_day_names_sr_RS =
{
array_elements
(
my_locale_day_names_sr_RS
)
-
1
,
""
,
my_locale_day_names_sr_RS
,
NULL
};
static
TYPELIB
my_locale_typelib_ab_day_names_sr_RS
=
{
array_elements
(
my_locale_ab_day_names_sr_RS
)
-
1
,
""
,
my_locale_ab_day_names_sr_RS
,
NULL
};
MY_LOCALE
my_locale_sr_YU
/* Deprecated, use sr_RS instead */
(
48
,
"sr_YU"
,
"Serbian - Yugoslavia"
,
FALSE
,
&
my_locale_typelib_month_names_sr_RS
,
&
my_locale_typelib_ab_month_names_sr_RS
,
&
my_locale_typelib_day_names_sr_RS
,
&
my_locale_typelib_ab_day_names_sr_RS
,
9
,
10
,
'.'
,
/* decimal point sr_RS */
'\0'
,
/* thousands_sep sr_RS */
"
\x80
"
,
/* grouping sr_RS */
&
global_errmsgs
[
sr_RS
]
);
MY_LOCALE
my_locale_sr_RS
(
48
,
...
...
@@ -3347,6 +3365,13 @@ MY_LOCALE *my_locales[]=
};
MY_LOCALE
*
my_locales_deprecated
[]
=
{
&
my_locale_sr_YU
,
NULL
};
MY_LOCALE
*
my_locale_by_number
(
uint
number
)
{
MY_LOCALE
*
locale
;
...
...
@@ -3359,22 +3384,56 @@ MY_LOCALE *my_locale_by_number(uint number)
}
MY_LOCALE
*
my_locale_by_name
(
const
char
*
name
)
static
MY_LOCALE
*
my_locale_by_name
(
MY_LOCALE
**
locales
,
const
char
*
name
)
{
MY_LOCALE
**
locale
;
for
(
locale
=
my_
locales
;
*
locale
!=
NULL
;
locale
++
)
for
(
locale
=
locales
;
*
locale
!=
NULL
;
locale
++
)
{
if
(
!
my_strcasecmp
(
&
my_charset_latin1
,
(
*
locale
)
->
name
,
name
))
{
// Check that locale is on its correct position in the array
DBUG_ASSERT
((
*
locale
)
==
my_locales
[(
*
locale
)
->
number
]);
return
*
locale
;
}
}
return
NULL
;
}
MY_LOCALE
*
my_locale_by_name
(
const
char
*
name
)
{
MY_LOCALE
*
locale
;
if
((
locale
=
my_locale_by_name
(
my_locales
,
name
)))
{
// Check that locale is on its correct position in the array
DBUG_ASSERT
(
locale
==
my_locales
[
locale
->
number
]);
return
locale
;
}
else
if
((
locale
=
my_locale_by_name
(
my_locales_deprecated
,
name
)))
{
THD
*
thd
=
current_thd
;
/*
Replace the deprecated locale to the corresponding
'fresh' locale with the same ID.
*/
locale
=
my_locales
[
locale
->
number
];
if
(
thd
)
{
// Send a warning to the client
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DEPRECATED_SYNTAX
,
ER
(
ER_WARN_DEPRECATED_SYNTAX
),
name
,
locale
->
name
);
}
else
{
// Send a warning to mysqld error log
sql_print_warning
(
"The syntax '%s' is deprecated and will be removed. "
"Please use %s instead."
,
name
,
locale
->
name
);
}
}
return
locale
;
}
void
cleanup_errmsgs
()
{
for
(
MY_LOCALE_ERRMSGS
*
msgs
=
global_errmsgs
;
msgs
->
language
;
msgs
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment