Skip to content
/ server Public

Commit 2d03393

Browse files
committed
MDEV-38520 Add month name formatting (%M shows month names in genitive case)
1 parent e2088ce commit 2d03393

18 files changed

+280
-36
lines changed

mysql-test/main/ctype_ucs.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,16 +1514,16 @@ LOWER(DAYNAME(19700101))
15141514
четверг
15151515
SELECT LOWER(MONTHNAME(19700101));
15161516
LOWER(MONTHNAME(19700101))
1517-
января
1517+
январь
15181518
SELECT UPPER(DAYNAME(19700101));
15191519
UPPER(DAYNAME(19700101))
15201520
ЧЕТВЕРГ
15211521
SELECT UPPER(MONTHNAME(19700101));
15221522
UPPER(MONTHNAME(19700101))
1523-
ЯНВАРЯ
1523+
ЯНВАРЬ
15241524
SELECT HEX(MONTHNAME(19700101));
15251525
HEX(MONTHNAME(19700101))
1526-
042F043D043204300440044F
1526+
044F043D043204300440044C
15271527
SELECT HEX(DAYNAME(19700101));
15281528
HEX(DAYNAME(19700101))
15291529
0427043504420432043504400433

mysql-test/main/ctype_utf8.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ insert into t1 values (date_format('2004-02-02','%W'));
114114
insert into t1 values (date_format('2004-02-02','%a'));
115115
select hex(s1), s1 from t1;
116116
hex(s1) s1
117-
E6C5D7D2C1CCD1 Февраля
117+
C6C5D7D2C1CCD1 февраля
118118
E6C5D7 Фев
119119
F0CFCEC5C4C5CCD8CEC9CB Понедельник
120120
F0CEC4 Пнд

mysql-test/main/ctype_utf8mb4.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ insert into t1 values (date_format('2004-02-02','%W'));
114114
insert into t1 values (date_format('2004-02-02','%a'));
115115
select hex(s1), s1 from t1;
116116
hex(s1) s1
117-
E6C5D7D2C1CCD1 Февраля
117+
C6C5D7D2C1CCD1 февраля
118118
E6C5D7 Фев
119119
F0CFCEC5C4C5CCD8CEC9CB Понедельник
120120
F0CEC4 Пнд

mysql-test/main/ctype_utf8mb4_heap.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ insert into t1 values (date_format('2004-02-02','%W'));
149149
insert into t1 values (date_format('2004-02-02','%a'));
150150
select hex(s1), s1 from t1;
151151
hex(s1) s1
152+
C6C5D7D2C1CCD1 февраля
152153
E6C5D7 Фев
153-
E6C5D7D2C1CCD1 Февраля
154154
F0CEC4 Пнд
155155
F0CFCEC5C4C5CCD8CEC9CB Понедельник
156156
drop table t1;

mysql-test/main/ctype_utf8mb4_innodb.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ insert into t1 values (date_format('2004-02-02','%W'));
149149
insert into t1 values (date_format('2004-02-02','%a'));
150150
select hex(s1), s1 from t1;
151151
hex(s1) s1
152+
C6C5D7D2C1CCD1 февраля
152153
E6C5D7 Фев
153-
E6C5D7D2C1CCD1 Февраля
154154
F0CEC4 Пнд
155155
F0CFCEC5C4C5CCD8CEC9CB Понедельник
156156
drop table t1;

mysql-test/main/ctype_utf8mb4_myisam.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ insert into t1 values (date_format('2004-02-02','%W'));
149149
insert into t1 values (date_format('2004-02-02','%a'));
150150
select hex(s1), s1 from t1;
151151
hex(s1) s1
152+
C6C5D7D2C1CCD1 февраля
152153
E6C5D7 Фев
153-
E6C5D7D2C1CCD1 Февраля
154154
F0CEC4 Пнд
155155
F0CFCEC5C4C5CCD8CEC9CB Понедельник
156156
drop table t1;

mysql-test/main/date_formats.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ set lc_time_names=ru_RU;
440440
set names koi8r;
441441
select date_format('2004-01-01','%W (%a), %e %M (%b) %Y');
442442
date_format('2004-01-01','%W (%a), %e %M (%b) %Y')
443-
������� (���), 1 ������ (���) 2004
443+
������� (���), 1 ������ (���) 2004
444444
set lc_time_names=de_DE;
445445
set names latin1;
446446
select date_format('2004-01-01','%W (%a), %e %M (%b) %Y');

mysql-test/main/locale.result

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ format(123456789,2) as b,
229229
format(123456789,2,'rm_CH') as b1;
230230
select * from v1;
231231
a a1 b b1
232-
10 Oct October 10 Окт Октября 123,456,789.00 123'456'789,00
232+
10 Oct October 10 Окт октября 123,456,789.00 123'456'789,00
233233
show create view v1;
234234
View Create View character_set_client collation_connection
235235
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select date_format('2001-10-02','%c %b %M') AS `a`,date_format('2001-10-02','%c %b %M','ru_RU') AS `a1`,format(123456789,2) AS `b`,format(123456789,2,'rm_CH') AS `b1` utf8mb3 utf8mb3_uca1400_ai_ci
@@ -369,3 +369,19 @@ SET lc_messages=DEFAULT;
369369
#
370370
# End of 10.11 tests
371371
#
372+
SET lc_time_names=uk_UA;
373+
SELECT monthname('2001-10-01'), monthname('2001-02-15'), monthname('2001-03-30');
374+
monthname('2001-10-01') monthname('2001-02-15') monthname('2001-03-30')
375+
жовтень лютий березень
376+
SELECT date_format('2026-10-01','%d %M %Y'), date_format('2026-08-24','%d %M %Y'), date_format('2026-01-22','%d %M %Y');
377+
date_format('2026-10-01','%d %M %Y') date_format('2026-08-24','%d %M %Y') date_format('2026-01-22','%d %M %Y')
378+
01 жовтня 2026 24 серпня 2026 22 січня 2026
379+
SET lc_time_names=be_BY;
380+
SELECT date_format('2026-10-01','%d %M %Y'), date_format('2026-08-24','%d %M %Y'), date_format('2026-01-22','%d %M %Y');
381+
date_format('2026-10-01','%d %M %Y') date_format('2026-08-24','%d %M %Y') date_format('2026-01-22','%d %M %Y')
382+
01 кастрычніка 2026 24 жніўня 2026 22 студзеня 2026
383+
SET lc_time_names=eu_ES;
384+
SELECT date_format('2026-04-16','%d %M %Y'), date_format('2026-08-24','%d %M %Y'), date_format('2026-01-22','%d %M %Y');
385+
date_format('2026-04-16','%d %M %Y') date_format('2026-08-24','%d %M %Y') date_format('2026-01-22','%d %M %Y')
386+
16 apirilak 2026 24 abuztuak 2026 22 urtarrilak 2026
387+
SET lc_time_names=DEFAULT;

mysql-test/main/locale.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,20 @@ SET lc_messages=DEFAULT;
241241
--echo #
242242
--echo # End of 10.11 tests
243243
--echo #
244+
245+
246+
#
247+
# MDEV-38520 Add month name formatting (%M shows month names in genitive case)
248+
#
249+
250+
SET lc_time_names=uk_UA;
251+
SELECT monthname('2001-10-01'), monthname('2001-02-15'), monthname('2001-03-30');
252+
SELECT date_format('2026-10-01','%d %M %Y'), date_format('2026-08-24','%d %M %Y'), date_format('2026-01-22','%d %M %Y');
253+
254+
SET lc_time_names=be_BY;
255+
SELECT date_format('2026-10-01','%d %M %Y'), date_format('2026-08-24','%d %M %Y'), date_format('2026-01-22','%d %M %Y');
256+
257+
SET lc_time_names=eu_ES;
258+
SELECT date_format('2026-04-16','%d %M %Y'), date_format('2026-08-24','%d %M %Y'), date_format('2026-01-22','%d %M %Y');
259+
260+
SET lc_time_names=DEFAULT;

mysql-test/main/variables.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ select @@lc_time_names;
782782
@@lc_time_names
783783
sw_KE
784784
LC_TIME_NAMES: testing a number beyond the valid ID range:
785-
set lc_time_names=113;
786-
ERROR HY000: Unknown locale: '113'
785+
set lc_time_names=114;
786+
ERROR HY000: Unknown locale: '114'
787787
select @@lc_time_names;
788788
@@lc_time_names
789789
sw_KE

0 commit comments

Comments
 (0)