1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
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;
#
# Bug#46633 Obsolete Serbian locale name
#
SET lc_messages=sr_YU;
Warnings:
Warning 1287 'sr_YU' is deprecated and will be removed in a future release. Please 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
#
# Bug#43207 wrong LC_TIME names for romanian locale
#
SET NAMES utf8;
SET lc_time_names=ro_RO;
SELECT DATE_FORMAT('2001-01-01', '%w %a %W');
DATE_FORMAT('2001-01-01', '%w %a %W')
1 Lu Luni
SELECT DATE_FORMAT('2001-01-02', '%w %a %W');
DATE_FORMAT('2001-01-02', '%w %a %W')
2 Ma Marţi
SELECT DATE_FORMAT('2001-01-03', '%w %a %W');
DATE_FORMAT('2001-01-03', '%w %a %W')
3 Mi Miercuri
SELECT DATE_FORMAT('2001-01-04', '%w %a %W');
DATE_FORMAT('2001-01-04', '%w %a %W')
4 Jo Joi
SELECT DATE_FORMAT('2001-01-05', '%w %a %W');
DATE_FORMAT('2001-01-05', '%w %a %W')
5 Vi Vineri
SELECT DATE_FORMAT('2001-01-06', '%w %a %W');
DATE_FORMAT('2001-01-06', '%w %a %W')
6 Sâ Sâmbătă
SELECT DATE_FORMAT('2001-01-07', '%w %a %W');
DATE_FORMAT('2001-01-07', '%w %a %W')
0 Du Duminică
End of 5.4 tests
SET NAMES utf8;
SET lc_time_names=de_AT;
SELECT monthname('2001-01-01');
monthname('2001-01-01')
Jänner
SELECT monthname('2001-02-01');
monthname('2001-02-01')
Februar
SELECT monthname('2001-03-01');
monthname('2001-03-01')
März
#
# MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field
#
SET NAMES utf8;
CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
INSERT INTO t1 VALUES ('test',now());
Warnings:
Note 1265 Data truncated for column 'd' at row 1
SET lc_time_names=ru_RU;
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
SET lc_time_names=en_US;
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
c
test
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
c
test
SET NAMES latin1;
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
c
test
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
c
test
DROP TABLE t1;
#
# Start of 5.6 tests
#
#
# WL#5303 Romansh locale for DAYNAME, MONTHNAME, DATE_FORMAT
#
SET NAMES utf8;
SET @old_50915_lc_time_names := @@lc_time_names;
SET lc_time_names=en_US;
SELECT DATE_FORMAT('2001-01-01', '%w %a %W');
DATE_FORMAT('2001-01-01', '%w %a %W')
1 Mon Monday
SELECT DATE_FORMAT('2001-03-01', '%c %b %M');
DATE_FORMAT('2001-03-01', '%c %b %M')
3 Mar March
SET lc_time_names=rm_CH;
SELECT DATE_FORMAT('2001-01-01', '%w %a %W');
DATE_FORMAT('2001-01-01', '%w %a %W')
1 gli glindesdi
SELECT DATE_FORMAT('2001-01-02', '%w %a %W');
DATE_FORMAT('2001-01-02', '%w %a %W')
2 ma mardi
SELECT DATE_FORMAT('2001-01-03', '%w %a %W');
DATE_FORMAT('2001-01-03', '%w %a %W')
3 me mesemna
SELECT DATE_FORMAT('2001-01-04', '%w %a %W');
DATE_FORMAT('2001-01-04', '%w %a %W')
4 gie gievgia
SELECT DATE_FORMAT('2001-01-05', '%w %a %W');
DATE_FORMAT('2001-01-05', '%w %a %W')
5 ve venderdi
SELECT DATE_FORMAT('2001-01-06', '%w %a %W');
DATE_FORMAT('2001-01-06', '%w %a %W')
6 so sonda
SELECT DATE_FORMAT('2001-01-07', '%w %a %W');
DATE_FORMAT('2001-01-07', '%w %a %W')
0 du dumengia
SELECT DATE_FORMAT('2001-01-01', '%c %b %M');
DATE_FORMAT('2001-01-01', '%c %b %M')
1 schan schaner
SELECT DATE_FORMAT('2001-02-01', '%c %b %M');
DATE_FORMAT('2001-02-01', '%c %b %M')
2 favr favrer
SELECT DATE_FORMAT('2001-03-01', '%c %b %M');
DATE_FORMAT('2001-03-01', '%c %b %M')
3 mars mars
SELECT DATE_FORMAT('2001-04-01', '%c %b %M');
DATE_FORMAT('2001-04-01', '%c %b %M')
4 avr avrigl
SELECT DATE_FORMAT('2001-05-01', '%c %b %M');
DATE_FORMAT('2001-05-01', '%c %b %M')
5 matg matg
SELECT DATE_FORMAT('2001-06-01', '%c %b %M');
DATE_FORMAT('2001-06-01', '%c %b %M')
6 zercl zercladur
SELECT DATE_FORMAT('2001-07-01', '%c %b %M');
DATE_FORMAT('2001-07-01', '%c %b %M')
7 fan fanadur
SELECT DATE_FORMAT('2001-08-01', '%c %b %M');
DATE_FORMAT('2001-08-01', '%c %b %M')
8 avust avust
SELECT DATE_FORMAT('2001-09-01', '%c %b %M');
DATE_FORMAT('2001-09-01', '%c %b %M')
9 sett settember
SELECT DATE_FORMAT('2001-10-01', '%c %b %M');
DATE_FORMAT('2001-10-01', '%c %b %M')
10 oct october
SELECT DATE_FORMAT('2001-11-01', '%c %b %M');
DATE_FORMAT('2001-11-01', '%c %b %M')
11 nov november
SELECT DATE_FORMAT('2001-12-01', '%c %b %M');
DATE_FORMAT('2001-12-01', '%c %b %M')
12 dec december
SET lc_time_names=de_CH;
SELECT DATE_FORMAT('2001-01-06', '%w %a %W');
DATE_FORMAT('2001-01-06', '%w %a %W')
6 Sa Samstag
SELECT DATE_FORMAT('2001-09-01', '%c %b %M');
DATE_FORMAT('2001-09-01', '%c %b %M')
9 Sep September
SELECT DATE_FORMAT('2010-03-23 11:00:00','%h %p');
DATE_FORMAT('2010-03-23 11:00:00','%h %p')
11 AM
SELECT DATE_FORMAT('2010-03-23 13:00:00','%h %p');
DATE_FORMAT('2010-03-23 13:00:00','%h %p')
01 PM
SELECT format(123456789,2,'rm_CH');
format(123456789,2,'rm_CH')
123'456'789,00
SET lc_messages=rm_CH;
SELECT * FROM non_existent;
ERROR 42S02: Table 'test.non_existent' doesn't exist
SET lc_time_names=@old_50915_lc_time_names;
#
# End of 10.0 tests
#
#
# End of 10.1 tests
#
create view v1 as select
format(123456789,2) as b,
format(123456789,2,'rm_CH') as b1;
select * from v1;
b b1
123,456,789.00 123'456'789,00
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select format(123456789,2) AS `b`,format(123456789,2,'rm_CH') AS `b1` utf8 utf8_general_ci
drop view v1;
#
# End of 10.2 tests
#
|