MySQL Connector/C++ 9.3.0
MySQL connector library for C and C++ applications
All Classes Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
mysql_collations.h
1/*
2 * Copyright (c) 2016, 2024, Oracle and/or its affiliates.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2.0, as
6 * published by the Free Software Foundation.
7 *
8 * This program is designed to work with certain software (including
9 * but not limited to OpenSSL) that is licensed under separate terms, as
10 * designated in a particular file or component or in included license
11 * documentation. The authors of MySQL hereby grant you an additional
12 * permission to link the program and your derivative works with the
13 * separately licensed software that they have either included with
14 * the program or referenced in the documentation.
15 *
16 * Without limiting anything contained in the foregoing, this file,
17 * which is part of Connector/C++, is also subject to the
18 * Universal FOSS Exception, version 1.0, a copy of which can be found at
19 * https://oss.oracle.com/licenses/universal-foss-exception.
20 *
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * See the GNU General Public License, version 2.0, for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31/*
32 Lists of collations used by MySQL Server and its protocols. These lists
33 define mapping from MySQL collation ID to charset ID.
34
35 Note: Keep this file in sync with <mysql/cdk/protocol/mysqlx/collations.h>
36*/
37
38#ifndef MYSQLX_MYSQL_COLLATIONS_H
39#define MYSQLX_MYSQL_COLLATIONS_H
40
41/*
42 Each line X(CS, ID, COLL, SENSITIVITY) in the expansion of
43 a COLLATION_XXX() macro declares collation with name COLL for character set
44 CS. ID is the MySQL id number for the collation. SENSITIVITY is either 'bin'
45 for binary collations or a combination of sensitivity flags such as 'ai_ci',
46 using the same conventions as the ones used in MySQL collation names.
47
48 Note: CS, COLL and SENSITIVITY are used to reconstruct the full MySQL name of
49 the collation and should follow the same naming conventions (with few
50 exceptions that we handle separately)
51*/
52
53
54#define COLLATIONS_big5(X) \
55 X(big5,1,chinese,ci) \
56 X(big5,84,bin,bin) \
57
58#define COLLATIONS_dec8(X) \
59 X(dec8,3,swedish,ci) \
60 X(dec8,69,bin,bin) \
61
62#define COLLATIONS_cp850(X) \
63 X(cp850,4,general,ci) \
64 X(cp850,80,bin,bin) \
65
66#define COLLATIONS_hp8(X) \
67 X(hp8,6,english,ci) \
68 X(hp8,72,bin,bin) \
69
70#define COLLATIONS_koi8r(X) \
71 X(koi8r,7,general,ci) \
72 X(koi8r,74,bin,bin) \
73
74#define COLLATIONS_latin1(X) \
75 X(latin1,5,german1,ci) \
76 X(latin1,8,swedish,ci) \
77 X(latin1,15,danish,ci) \
78 X(latin1,31,german2,ci) \
79 X(latin1,47,bin,bin) \
80 X(latin1,48,general,ci) \
81 X(latin1,49,general,cs) \
82 X(latin1,94,spanish,ci) \
83
84#define COLLATIONS_latin2(X) \
85 X(latin2,2,czech,cs) \
86 X(latin2,9,general,ci) \
87 X(latin2,21,hungarian,ci) \
88 X(latin2,27,croatian,ci) \
89 X(latin2,77,bin,bin) \
90
91#define COLLATIONS_swe7(X) \
92 X(swe7,10,swedish,ci) \
93 X(swe7,82,bin,bin) \
94
95#define COLLATIONS_ascii(X) \
96 X(ascii,11,general,ci) \
97 X(ascii,65,bin,bin) \
98
99#define COLLATIONS_ujis(X) \
100 X(ujis,12,japanese,ci) \
101 X(ujis,91,bin,bin) \
102
103#define COLLATIONS_sjis(X) \
104 X(sjis,13,japanese,ci) \
105 X(sjis,88,bin,bin) \
106
107#define COLLATIONS_hebrew(X) \
108 X(hebrew,16,general,ci) \
109 X(hebrew,71,bin,bin) \
110
111#define COLLATIONS_tis620(X) \
112 X(tis620,18,thai,ci) \
113 X(tis620,89,bin,bin) \
114
115#define COLLATIONS_euckr(X) \
116 X(euckr,19,korean,ci) \
117 X(euckr,85,bin,bin) \
118
119#define COLLATIONS_koi8u(X) \
120 X(koi8u,22,general,ci) \
121 X(koi8u,75,bin,bin) \
122
123#define COLLATIONS_gb2312(X) \
124 X(gb2312,24,chinese,ci) \
125 X(gb2312,86,bin,bin) \
126
127#define COLLATIONS_greek(X) \
128 X(greek,25,general,ci) \
129 X(greek,70,bin,bin) \
130
131#define COLLATIONS_cp1250(X) \
132 X(cp1250,26,general,ci) \
133 X(cp1250,34,czech,cs) \
134 X(cp1250,44,croatian,ci) \
135 X(cp1250,66,bin,bin) \
136 X(cp1250,99,polish,ci) \
137
138#define COLLATIONS_gbk(X) \
139 X(gbk,28,chinese,ci) \
140 X(gbk,87,bin,bin) \
141
142#define COLLATIONS_latin5(X) \
143 X(latin5,30,turkish,ci) \
144 X(latin5,78,bin,bin) \
145
146#define COLLATIONS_armscii8(X) \
147 X(armscii8,32,general,ci) \
148 X(armscii8,64,bin,bin) \
149
150#define COLLATIONS_utf8mb3(X) \
151 X(utf8mb3,33,general,ci) \
152 X(utf8mb3,76,tolower,ci) \
153 X(utf8mb3,83,bin,bin) \
154 X(utf8mb3,192,unicode,ci) \
155 X(utf8mb3,193,icelandic,ci) \
156 X(utf8mb3,194,latvian,ci) \
157 X(utf8mb3,195,romanian,ci) \
158 X(utf8mb3,196,slovenian,ci) \
159 X(utf8mb3,197,polish,ci) \
160 X(utf8mb3,198,estonian,ci) \
161 X(utf8mb3,199,spanish,ci) \
162 X(utf8mb3,200,swedish,ci) \
163 X(utf8mb3,201,turkish,ci) \
164 X(utf8mb3,202,czech,ci) \
165 X(utf8mb3,203,danish,ci) \
166 X(utf8mb3,204,lithuanian,ci) \
167 X(utf8mb3,205,slovak,ci) \
168 X(utf8mb3,206,spanish2,ci) \
169 X(utf8mb3,207,roman,ci) \
170 X(utf8mb3,208,persian,ci) \
171 X(utf8mb3,209,esperanto,ci) \
172 X(utf8mb3,210,hungarian,ci) \
173 X(utf8mb3,211,sinhala,ci) \
174 X(utf8mb3,212,german2,ci) \
175 X(utf8mb3,213,croatian,ci) \
176 X(utf8mb3,214,unicode_520,ci) \
177 X(utf8mb3,215,vietnamese,ci) \
178 X(utf8mb3,223,general_mysql500,ci) \
179
180#define COLLATIONS_ucs2(X) \
181 X(ucs2,35,general,ci) \
182 X(ucs2,90,bin,bin) \
183 X(ucs2,128,unicode,ci) \
184 X(ucs2,129,icelandic,ci) \
185 X(ucs2,130,latvian,ci) \
186 X(ucs2,131,romanian,ci) \
187 X(ucs2,132,slovenian,ci) \
188 X(ucs2,133,polish,ci) \
189 X(ucs2,134,estonian,ci) \
190 X(ucs2,135,spanish,ci) \
191 X(ucs2,136,swedish,ci) \
192 X(ucs2,137,turkish,ci) \
193 X(ucs2,138,czech,ci) \
194 X(ucs2,139,danish,ci) \
195 X(ucs2,140,lithuanian,ci) \
196 X(ucs2,141,slovak,ci) \
197 X(ucs2,142,spanish2,ci) \
198 X(ucs2,143,roman,ci) \
199 X(ucs2,144,persian,ci) \
200 X(ucs2,145,esperanto,ci) \
201 X(ucs2,146,hungarian,ci) \
202 X(ucs2,147,sinhala,ci) \
203 X(ucs2,148,german2,ci) \
204 X(ucs2,149,croatian,ci) \
205 X(ucs2,150,unicode_520,ci) \
206 X(ucs2,151,vietnamese,ci) \
207 X(ucs2,159,general_mysql500,ci) \
208
209#define COLLATIONS_cp866(X) \
210 X(cp866,36,general,ci) \
211 X(cp866,68,bin,bin) \
212
213#define COLLATIONS_keybcs2(X) \
214 X(keybcs2,37,general,ci) \
215 X(keybcs2,73,bin,bin) \
216
217#define COLLATIONS_macce(X) \
218 X(macce,38,general,ci) \
219 X(macce,43,bin,bin) \
220
221#define COLLATIONS_macroman(X) \
222 X(macroman,39,general,ci) \
223 X(macroman,53,bin,bin) \
224
225#define COLLATIONS_cp852(X) \
226 X(cp852,40,general,ci) \
227 X(cp852,81,bin,bin) \
228
229#define COLLATIONS_latin7(X) \
230 X(latin7,20,estonian,cs) \
231 X(latin7,41,general,ci) \
232 X(latin7,42,general,cs) \
233 X(latin7,79,bin,bin) \
234
235#define COLLATIONS_utf8mb4(X) \
236 X(utf8mb4,255,uca0900,ai_ci) \
237 X(utf8mb4,278,uca0900,as_cs) \
238 X(utf8mb4,46,bin,bin) \
239 X(utf8mb4,245,croatian,ci) \
240 X(utf8mb4,266,cs_0900,ai_ci) \
241 X(utf8mb4,289,cs_0900,as_cs) \
242 X(utf8mb4,234,czech,ci) \
243 X(utf8mb4,235,danish,ci) \
244 X(utf8mb4,267,da_0900,ai_ci) \
245 X(utf8mb4,290,da_0900,as_cs) \
246 X(utf8mb4,256,de_pb_0900,ai_ci) \
247 X(utf8mb4,279,de_pb_0900,as_cs) \
248 X(utf8mb4,273,eo_0900,ai_ci) \
249 X(utf8mb4,296,eo_0900,as_cs) \
250 X(utf8mb4,241,esperanto,ci) \
251 X(utf8mb4,230,estonian,ci) \
252 X(utf8mb4,263,es_0900,ai_ci) \
253 X(utf8mb4,286,es_0900,as_cs) \
254 X(utf8mb4,270,es_trad_0900,ai_ci) \
255 X(utf8mb4,293,es_trad_0900,as_cs) \
256 X(utf8mb4,262,et_0900,ai_ci) \
257 X(utf8mb4,285,et_0900,as_cs) \
258 X(utf8mb4,45,general,ci) \
259 X(utf8mb4,244,german2,ci) \
260 X(utf8mb4,275,hr_0900,ai_ci) \
261 X(utf8mb4,298,hr_0900,as_cs) \
262 X(utf8mb4,242,hungarian,ci) \
263 X(utf8mb4,274,hu_0900,ai_ci) \
264 X(utf8mb4,297,hu_0900,as_cs) \
265 X(utf8mb4,225,icelandic,ci) \
266 X(utf8mb4,257,is_0900,ai_ci) \
267 X(utf8mb4,280,is_0900,as_cs) \
268 X(utf8mb4,303,ja_0900,as_cs) \
269 X(utf8mb4,226,latvian,ci) \
270 X(utf8mb4,271,la_0900,ai_ci) \
271 X(utf8mb4,294,la_0900,as_cs) \
272 X(utf8mb4,236,lithuanian,ci) \
273 X(utf8mb4,268,lt_0900,ai_ci) \
274 X(utf8mb4,291,lt_0900,as_cs) \
275 X(utf8mb4,258,lv_0900,ai_ci) \
276 X(utf8mb4,281,lv_0900,as_cs) \
277 X(utf8mb4,240,persian,ci) \
278 X(utf8mb4,261,pl_0900,ai_ci) \
279 X(utf8mb4,284,pl_0900,as_cs) \
280 X(utf8mb4,229,polish,ci) \
281 X(utf8mb4,227,romanian,ci) \
282 X(utf8mb4,239,roman,ci) \
283 X(utf8mb4,259,ro_0900,ai_ci) \
284 X(utf8mb4,282,ro_0900,as_cs) \
285 X(utf8mb4,243,sinhala,ci) \
286 X(utf8mb4,269,sk_0900,ai_ci) \
287 X(utf8mb4,292,sk_0900,as_cs) \
288 X(utf8mb4,237,slovak,ci) \
289 X(utf8mb4,228,slovenian,ci) \
290 X(utf8mb4,260,sl_0900,ai_ci) \
291 X(utf8mb4,283,sl_0900,as_cs) \
292 X(utf8mb4,238,spanish2,ci) \
293 X(utf8mb4,231,spanish,ci) \
294 X(utf8mb4,264,sv_0900,ai_ci) \
295 X(utf8mb4,287,sv_0900,as_cs) \
296 X(utf8mb4,232,swedish,ci) \
297 X(utf8mb4,265,tr_0900,ai_ci) \
298 X(utf8mb4,288,tr_0900,as_cs) \
299 X(utf8mb4,233,turkish,ci) \
300 X(utf8mb4,246,unicode_520,ci) \
301 X(utf8mb4,224,unicode,ci) \
302 X(utf8mb4,247,vietnamese,ci) \
303 X(utf8mb4,277,vi_0900,ai_ci) \
304 X(utf8mb4,300,vi_0900,as_cs) \
305 X(utf8mb4,304,ja_0900,as_cs_ks) \
306 X(utf8mb4,305,uca0900,as_ci) \
307 X(utf8mb4,306,ru_0900,ai_ci) \
308 X(utf8mb4,307,ru_0900,as_cs) \
309 X(utf8mb4,308,zh_0900,as_cs) \
310 X(utf8mb4,309,uca0900,bin) \
311 X(utf8mb4,310,nb_0900,ai_ci) \
312 X(utf8mb4,311,nb_0900,as_cs) \
313 X(utf8mb4,312,nn_0900,ai_ci) \
314 X(utf8mb4,313,nn_0900,as_cs) \
315 X(utf8mb4,314,sr_latn_0900,ai_ci) \
316 X(utf8mb4,315,sr_latn_0900,as_cs) \
317 X(utf8mb4,316,bs_0900,ai_ci) \
318 X(utf8mb4,317,bs_0900,as_cs) \
319 X(utf8mb4,318,bg_0900,ai_ci) \
320 X(utf8mb4,319,bg_0900,as_cs) \
321 X(utf8mb4,320,gl_0900,ai_ci) \
322 X(utf8mb4,321,gl_0900,as_cs) \
323 X(utf8mb4,322,mn_cyrl_0900,ai_ci) \
324 X(utf8mb4,323,mn_cyrl_0900,as_cs) \
325 COLLATIONS_utf8mb4_EXTRA
326
327#define COLLATIONS_utf8mb4_EXTRA
328
329
330#define COLLATIONS_cp1251(X) \
331 X(cp1251,14,bulgarian,ci) \
332 X(cp1251,23,ukrainian,ci) \
333 X(cp1251,50,bin,bin) \
334 X(cp1251,51,general,ci) \
335 X(cp1251,52,general,cs) \
336
337#define COLLATIONS_utf16(X) \
338 X(utf16,54,general,ci) \
339 X(utf16,55,bin,bin) \
340 X(utf16,101,unicode,ci) \
341 X(utf16,102,icelandic,ci) \
342 X(utf16,103,latvian,ci) \
343 X(utf16,104,romanian,ci) \
344 X(utf16,105,slovenian,ci) \
345 X(utf16,106,polish,ci) \
346 X(utf16,107,estonian,ci) \
347 X(utf16,108,spanish,ci) \
348 X(utf16,109,swedish,ci) \
349 X(utf16,110,turkish,ci) \
350 X(utf16,111,czech,ci) \
351 X(utf16,112,danish,ci) \
352 X(utf16,113,lithuanian,ci) \
353 X(utf16,114,slovak,ci) \
354 X(utf16,115,spanish2,ci) \
355 X(utf16,116,roman,ci) \
356 X(utf16,117,persian,ci) \
357 X(utf16,118,esperanto,ci) \
358 X(utf16,119,hungarian,ci) \
359 X(utf16,120,sinhala,ci) \
360 X(utf16,121,german2,ci) \
361 X(utf16,122,croatian,ci) \
362 X(utf16,123,unicode_520,ci) \
363 X(utf16,124,vietnamese,ci) \
364
365#define COLLATIONS_utf16le(X) \
366 X(utf16le,56,general,ci) \
367 X(utf16le,62,bin,bin) \
368
369#define COLLATIONS_cp1256(X) \
370 X(cp1256,57,general,ci) \
371 X(cp1256,67,bin,bin) \
372
373#define COLLATIONS_cp1257(X) \
374 X(cp1257,29,lithuanian,ci) \
375 X(cp1257,58,bin,bin) \
376 X(cp1257,59,general,ci) \
377
378#define COLLATIONS_utf32(X) \
379 X(utf32,60,general,ci) \
380 X(utf32,61,bin,bin) \
381 X(utf32,160,unicode,ci) \
382 X(utf32,161,icelandic,ci) \
383 X(utf32,162,latvian,ci) \
384 X(utf32,163,romanian,ci) \
385 X(utf32,164,slovenian,ci) \
386 X(utf32,165,polish,ci) \
387 X(utf32,166,estonian,ci) \
388 X(utf32,167,spanish,ci) \
389 X(utf32,168,swedish,ci) \
390 X(utf32,169,turkish,ci) \
391 X(utf32,170,czech,ci) \
392 X(utf32,171,danish,ci) \
393 X(utf32,172,lithuanian,ci) \
394 X(utf32,173,slovak,ci) \
395 X(utf32,174,spanish2,ci) \
396 X(utf32,175,roman,ci) \
397 X(utf32,176,persian,ci) \
398 X(utf32,177,esperanto,ci) \
399 X(utf32,178,hungarian,ci) \
400 X(utf32,179,sinhala,ci) \
401 X(utf32,180,german2,ci) \
402 X(utf32,181,croatian,ci) \
403 X(utf32,182,unicode_520,ci) \
404 X(utf32,183,vietnamese,ci) \
405
406#define COLLATIONS_binary(X) \
407 X(binary,63,bin,bin) \
408
409#define COLLATIONS_geostd8(X) \
410 X(geostd8,92,general,ci) \
411 X(geostd8,93,bin,bin) \
412
413#define COLLATIONS_cp932(X) \
414 X(cp932,95,japanese,ci) \
415 X(cp932,96,bin,bin) \
416
417#define COLLATIONS_eucjpms(X) \
418 X(eucjpms,97,japanese,ci) \
419 X(eucjpms,98,bin,bin) \
420
421#define COLLATIONS_gb18030(X) \
422 X(gb18030,248,chinese,ci) \
423 X(gb18030,249,bin,bin) \
424 X(gb18030,250,unicode_520,ci) \
425
426
427#endif