diff options
author | Ekaterine Papava <papava.e@gtu.ge> | 2023-03-06 11:04:48 +0100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2023-03-08 11:22:57 +1100 |
commit | 6b8370a90f2670641e673ff5bac8431eac7b7b96 (patch) | |
tree | 66d9ecb668b12fb143aa50e32fe7804c53c63500 | |
parent | b56c613e2d081cc0713c8ca6ae27ad9176d8ac3d (diff) | |
download | mariadb-git-6b8370a90f2670641e673ff5bac8431eac7b7b96.tar.gz |
MDEV-30789: Add Georgian error messages and locale
Test case and minor fixes by Daniel Black
Reviewer: Alexander Barkov
-rw-r--r-- | mysql-test/main/locale.result | 10 | ||||
-rw-r--r-- | mysql-test/main/locale.test | 15 | ||||
-rw-r--r-- | mysql-test/main/variables.result | 10 | ||||
-rw-r--r-- | mysql-test/main/variables.test | 5 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/locales.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/lc_time_names_basic.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/lc_time_names_basic.test | 4 | ||||
-rw-r--r-- | sql/sql_locale.cc | 46 |
8 files changed, 89 insertions, 9 deletions
diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result index d29482ceffa..39f11053df6 100644 --- a/mysql-test/main/locale.result +++ b/mysql-test/main/locale.result @@ -306,3 +306,13 @@ date_format('2001-01-06', '%w %a %W', 'de_CH') select date_format('2001-09-01', '%c %b %M', 'de_CH'); date_format('2001-09-01', '%c %b %M', 'de_CH') 9 Sep September +# +# MDEV-30789 Add Georgian error messages and locale +# +SET lc_messages=ka_GE; +SELECT x; +ERROR 42S22: უცნობი სვეტი 'x' 'field list'-ში +SET lc_messages=DEFAULT; +# +# End of 10.11 tests +# diff --git a/mysql-test/main/locale.test b/mysql-test/main/locale.test index a9a507bc387..9f4ceb270d9 100644 --- a/mysql-test/main/locale.test +++ b/mysql-test/main/locale.test @@ -181,3 +181,18 @@ select date_format('2001-10-01', '%c %b %M', 'rm_CH'); select date_format('2001-12-01', '%c %b %M', 'rm_CH'); select date_format('2001-01-06', '%w %a %W', 'de_CH'); select date_format('2001-09-01', '%c %b %M', 'de_CH'); + + +--echo # +--echo # MDEV-30789 Add Georgian error messages and locale +--echo # + +SET lc_messages=ka_GE; +--error ER_BAD_FIELD_ERROR +SELECT x; + +SET lc_messages=DEFAULT; + +--echo # +--echo # End of 10.11 tests +--echo # diff --git a/mysql-test/main/variables.result b/mysql-test/main/variables.result index f6817a2a4d2..9b54a24be71 100644 --- a/mysql-test/main/variables.result +++ b/mysql-test/main/variables.result @@ -777,16 +777,16 @@ select @@lc_time_names; @@lc_time_names en_US LC_TIME_NAMES: testing locale with the last ID: -set lc_time_names=110; +set lc_time_names=111; select @@lc_time_names; @@lc_time_names -rm_CH +ka_GE LC_TIME_NAMES: testing a number beyond the valid ID range: -set lc_time_names=111; -ERROR HY000: Unknown locale: '111' +set lc_time_names=112; +ERROR HY000: Unknown locale: '112' select @@lc_time_names; @@lc_time_names -rm_CH +ka_GE LC_TIME_NAMES: testing that 0 is en_US: set lc_time_names=0; select @@lc_time_names; diff --git a/mysql-test/main/variables.test b/mysql-test/main/variables.test index c8b36925df6..89267560ca6 100644 --- a/mysql-test/main/variables.test +++ b/mysql-test/main/variables.test @@ -538,12 +538,13 @@ set lc_time_names=NULL; --error ER_UNKNOWN_LOCALE set lc_time_names=-1; select @@lc_time_names; +# note same boundary condition tests in sys_vars.lc_time_names_basic --echo LC_TIME_NAMES: testing locale with the last ID: -set lc_time_names=110; +set lc_time_names=111; select @@lc_time_names; --echo LC_TIME_NAMES: testing a number beyond the valid ID range: --error ER_UNKNOWN_LOCALE -set lc_time_names=111; +set lc_time_names=112; select @@lc_time_names; --echo LC_TIME_NAMES: testing that 0 is en_US: set lc_time_names=0; diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result index e906d27c21e..a6848fb8486 100644 --- a/mysql-test/suite/plugins/r/locales.result +++ b/mysql-test/suite/plugins/r/locales.result @@ -112,6 +112,7 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU 108 zh_HK Chinese - Hong Kong SAR 3 3 . , english 109 el_GR Greek - Greece 11 9 , . greek 110 rm_CH Romansh - Switzerland 9 9 , ' english +111 ka_GE Georgian - Georgia 10 9 , georgian show locales; Id Name Description Error_Message_Language 0 en_US English - United States english @@ -225,6 +226,7 @@ Id Name Description Error_Message_Language 108 zh_HK Chinese - Hong Kong SAR english 109 el_GR Greek - Greece greek 110 rm_CH Romansh - Switzerland english +111 ka_GE Georgian - Georgia georgian show locales like '%spanish%'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'like '%spanish%'' at line 1 show locales where description like '%spanish%'; diff --git a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result index 7d98f44f27b..c1896a0cd73 100644 --- a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result +++ b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result @@ -1024,7 +1024,11 @@ SELECT @@lc_time_names; @@lc_time_names rm_CH SET @@lc_time_names = 111; -ERROR HY000: Unknown locale: '111' +SELECT @@lc_time_names; +@@lc_time_names +ka_GE +SET @@lc_time_names = 112; +ERROR HY000: Unknown locale: '112' '#--------------------FN_DYNVARS_060_10-------------------------#' SET @@lc_time_names = en_EN; ERROR HY000: Unknown locale: 'en_EN' diff --git a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test index 7f748bec2c0..7e634eda996 100644 --- a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test +++ b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test @@ -621,8 +621,10 @@ SET @@lc_time_names = 109; SELECT @@lc_time_names; SET @@lc_time_names = 110; SELECT @@lc_time_names; ---Error ER_UNKNOWN_LOCALE SET @@lc_time_names = 111; +SELECT @@lc_time_names; +--Error ER_UNKNOWN_LOCALE +SET @@lc_time_names = 112; --echo '#--------------------FN_DYNVARS_060_10-------------------------#' ############################################################################# diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index 6c9499c028b..eb5e3fbbc5a 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -3318,6 +3318,51 @@ MY_LOCALE my_locale_rm_CH /***** LOCALE END rm_CH *****/ +/***** LOCALE BEGIN ka_GE: Georgian - Georgia *****/ +static const char *my_locale_month_names_ka_GE[13] = + {"იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი", NullS }; + +static const char *my_locale_ab_month_names_ka_GE[13] = + {"იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექტ","ოქტ","ნოე","დეკ", NullS }; + +static const char *my_locale_day_names_ka_GE[8] = + {"ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი","კვირა", NullS }; + +static const char *my_locale_ab_day_names_ka_GE[8] = + {"ორშ","სამშ","ოთხშ","ხუთშ","პარ","შაბ","კვ", NullS }; + +static TYPELIB my_locale_typelib_month_names_ka_GE = + { array_elements(my_locale_month_names_ka_GE)-1, "", my_locale_month_names_ka_GE, NULL }; + +static TYPELIB my_locale_typelib_ab_month_names_ka_GE = + { array_elements(my_locale_ab_month_names_ka_GE)-1, "", my_locale_ab_month_names_ka_GE, NULL }; + +static TYPELIB my_locale_typelib_day_names_ka_GE = + { array_elements(my_locale_day_names_ka_GE)-1, "", my_locale_day_names_ka_GE, NULL }; + +static TYPELIB my_locale_typelib_ab_day_names_ka_GE = + { array_elements(my_locale_ab_day_names_ka_GE)-1, "", my_locale_ab_day_names_ka_GE, NULL }; + +MY_LOCALE my_locale_ka_GE +( + 111, + "ka_GE", + "Georgian - Georgia", + FALSE, + &my_locale_typelib_month_names_ka_GE, + &my_locale_typelib_ab_month_names_ka_GE, + &my_locale_typelib_day_names_ka_GE, + &my_locale_typelib_ab_day_names_ka_GE, + 10, + 9, + ',', /* decimal point ka_GE */ + ' ', /* thousands_sep ka_GE */ + "\x03", /* grouping ka_GE */ + &global_errmsgs[ka_GE] +); +/***** LOCALE END ka_GE *****/ + + /* The list of all locales. Note, locales must be ordered according to their @@ -3437,6 +3482,7 @@ MY_LOCALE *my_locales[]= &my_locale_zh_HK, &my_locale_el_GR, &my_locale_rm_CH, + &my_locale_ka_GE, NULL }; |