List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:June 25 2009 2:59pm
Subject:bzr commit into mysql-5.4 branch (bar:2807) WL#4642
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-azalea-alik/ based on revid:bar@stripped

 2807 Alexander Barkov	2009-06-25
      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
=== added file 'mysql-test/r/locale.result'
--- a/mysql-test/r/locale.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/locale.result	2009-06-25 12:59:23 +0000
@@ -0,0 +1,49 @@
+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	Δευ	Δ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	Μά6-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

=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result	2009-06-02 08:36:21 +0000
+++ b/mysql-test/r/variables.result	2009-06-25 12:59:23 +0000
@@ -810,16 +810,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;

=== added file 'mysql-test/t/locale.test'
--- a/mysql-test/t/locale.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/locale.test	2009-06-25 12:59:23 +0000
@@ -0,0 +1,34 @@
+--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

=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test	2009-06-24 08:14:35 +0000
+++ b/mysql-test/t/variables.test	2009-06-25 12:59:23 +0000
@@ -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;

=== modified file 'sql/sql_locale.cc'
--- a/sql/sql_locale.cc	2009-06-24 08:14:35 +0000
+++ b/sql/sql_locale.cc	2009-06-25 12:59:23 +0000
@@ -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 
   };
 

Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20090625125923-awekq1td0p0n7b8l.bundle
Thread
bzr commit into mysql-5.4 branch (bar:2807) WL#4642Alexander Barkov25 Jun 2009