Commit 1c58e906 authored by Alexander Barkov's avatar Alexander Barkov

Backporting WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT

added:
  mysql-test/r/locale.result
  mysql-test/t/locale.test
modified:
  mysql-test/r/variables.result
  mysql-test/t/variables.test
  sql/sql_locale.cc
parent 21317d5d
DROP TABLE IF EXISTS t1;
Start of 5.4 tests
#
# WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
#
SET NAMES utf8;
SET @@lc_time_names=109;
SELECT @@lc_time_names;
@@lc_time_names
el_GR
CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES
('2006-01-01'),('2006-01-02'),('2006-01-03'),
('2006-01-04'),('2006-01-05'),('2006-01-06'),('2006-01-07');
SELECT a, date_format(a,'%a') as abday, dayname(a) as day FROM t1 ORDER BY a;
a abday day
2006-01-01 Κυρ Κυριακή
2006-01-02 Δευ Δευτέρα
2006-01-03 Τρί Τρίτη
2006-01-04 Τετ Τετάρτη
2006-01-05 Πέμ Πέμπτη
2006-01-06 Παρ Παρασκευή
2006-01-07 Σάβ Σάββατο
DROP TABLE t1;
CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES
('2006-01-01'),('2006-02-01'),('2006-03-01'),
('2006-04-01'),('2006-05-01'),('2006-06-01'),
('2006-07-01'),('2006-08-01'),('2006-09-01'),
('2006-10-01'),('2006-11-01'),('2006-12-01');
SELECT a, date_format(a,'%b') as abmon, monthname(a) as mon FROM t1 ORDER BY a;
a abmon mon
2006-01-01 Ιαν Ιανουάριος
2006-02-01 Φεβ Φεβρουάριος
2006-03-01 Μάρ Μάρτιος
2006-04-01 Απρ Απρίλιος
2006-05-01 Μάι Μάιος
2006-06-01 Ιούν Ιούνιος
2006-07-01 Ιούλ Ιούλιος
2006-08-01 Αύγ Αύγουστος
2006-09-01 Σεπ Σεπτέμβριος
2006-10-01 Οκτ Οκτώβριος
2006-11-01 Νοέ Νοέμβριος
2006-12-01 Δεκ Δεκέμβριος
SELECT format(123456.789, 3, 'el_GR');
format(123456.789, 3, 'el_GR')
123456.789
DROP TABLE t1;
End of 5.4 tests
......@@ -812,16 +812,16 @@ select @@lc_time_names;
@@lc_time_names
en_US
LC_TIME_NAMES: testing locale with the last ID:
set lc_time_names=108;
set lc_time_names=109;
select @@lc_time_names;
@@lc_time_names
zh_HK
el_GR
LC_TIME_NAMES: testing a number beyond the valid ID range:
set lc_time_names=109;
ERROR HY000: Unknown locale: '109'
set lc_time_names=110;
ERROR HY000: Unknown locale: '110'
select @@lc_time_names;
@@lc_time_names
zh_HK
el_GR
LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
select @@lc_time_names;
......
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo Start of 5.4 tests
--echo #
--echo # WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
--echo #
SET NAMES utf8;
SET @@lc_time_names=109;
SELECT @@lc_time_names;
CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES
('2006-01-01'),('2006-01-02'),('2006-01-03'),
('2006-01-04'),('2006-01-05'),('2006-01-06'),('2006-01-07');
SELECT a, date_format(a,'%a') as abday, dayname(a) as day FROM t1 ORDER BY a;
DROP TABLE t1;
CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES
('2006-01-01'),('2006-02-01'),('2006-03-01'),
('2006-04-01'),('2006-05-01'),('2006-06-01'),
('2006-07-01'),('2006-08-01'),('2006-09-01'),
('2006-10-01'),('2006-11-01'),('2006-12-01');
SELECT a, date_format(a,'%b') as abmon, monthname(a) as mon FROM t1 ORDER BY a;
SELECT format(123456.789, 3, 'el_GR');
DROP TABLE t1;
--echo End of 5.4 tests
......@@ -576,11 +576,11 @@ set lc_time_names=NULL;
set lc_time_names=-1;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing locale with the last ID:
set lc_time_names=108;
set lc_time_names=109;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
--error ER_UNKNOWN_LOCALE
set lc_time_names=109;
set lc_time_names=110;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
......
......@@ -3009,6 +3009,77 @@ MY_LOCALE my_locale_zh_HK
/***** LOCALE END zh_HK *****/
/***** LOCALE BEGIN el_GR: Greek - Greece *****/
static const char *my_locale_month_names_el_GR[13]=
{
"Ιανουάριος", "Φεβρουάριος", "Μάρτιος",
"Απρίλιος", "Μάιος", "Ιούνιος",
"Ιούλιος", "Αύγουστος", "Σεπτέμβριος",
"Οκτώβριος", "Νοέμβριος", "Δεκέμβριος", NullS
};
static const char *my_locale_ab_month_names_el_GR[13]=
{
"Ιαν", "Φεβ", "Μάρ",
"Απρ", "Μάι", "Ιούν",
"Ιούλ","Αύγ", "Σεπ",
"Οκτ", "Νοέ", "Δεκ", NullS
};
static const char *my_locale_day_names_el_GR[8] =
{
"Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη",
"Παρασκευή", "Σάββατο", "Κυριακή", NullS
};
static const char *my_locale_ab_day_names_el_GR[8]=
{
"Δευ", "Τρί", "Τετ", "Πέμ",
"Παρ", "Σάβ", "Κυρ", NullS
};
static TYPELIB my_locale_typelib_month_names_el_GR=
{
array_elements(my_locale_month_names_el_GR) - 1,
"", my_locale_month_names_el_GR, NULL
};
static TYPELIB my_locale_typelib_ab_month_names_el_GR=
{
array_elements(my_locale_ab_month_names_el_GR)-1,
"", my_locale_ab_month_names_el_GR, NULL
};
static TYPELIB my_locale_typelib_day_names_el_GR=
{
array_elements(my_locale_day_names_el_GR)-1,
"", my_locale_day_names_el_GR, NULL
};
static TYPELIB my_locale_typelib_ab_day_names_el_GR=
{
array_elements(my_locale_ab_day_names_el_GR) - 1,
"", my_locale_ab_day_names_el_GR, NULL
};
MY_LOCALE my_locale_el_GR
(
109,
"el_GR",
"Greek - Greece",
FALSE,
&my_locale_typelib_month_names_el_GR,
&my_locale_typelib_ab_month_names_el_GR,
&my_locale_typelib_day_names_el_GR,
&my_locale_typelib_ab_day_names_el_GR,
11, /* max mon name length */
9, /* max day name length */
',', /* decimal point el_GR */
'.', /* thousands_sep el_GR */
"\x80" /* grouping el_GR */
);
/***** LOCALE END el_GR *****/
/*
The list of all locales.
Note, locales must be ordered according to their
......@@ -3126,6 +3197,7 @@ MY_LOCALE *my_locales[]=
&my_locale_no_NO,
&my_locale_sv_FI,
&my_locale_zh_HK,
&my_locale_el_GR,
NULL
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment