Skip to content

Commit 6a8a4b1

Browse files
committed
Update support scripts
- Port new mappings from latest master - Add utf8mb3 -> utf_8 missing mapping - rebuild ext/mysql2/mysql_enc_to_ruby.h and ext/mysql2/mysql_enc_name_to_ruby.h from Mysql 8.0.32
1 parent 4dd1348 commit 6a8a4b1

File tree

4 files changed

+179
-85
lines changed

4 files changed

+179
-85
lines changed

ext/mysql2/mysql_enc_name_to_ruby.h

+63-58
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* C code produced by gperf version 3.0.3 */
1+
/* C code produced by gperf version 3.0.4 */
22
/* Command-line: gperf */
33
/* Computed positions: -k'1,3,$' */
44

@@ -30,7 +30,7 @@ error "gperf generated tables don't work with this execution character set. Plea
3030
#endif
3131

3232
struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; };
33-
/* maximum key range = 66, duplicates = 0 */
33+
/* maximum key range = 71, duplicates = 0 */
3434

3535
#ifdef __GNUC__
3636
__inline
@@ -46,39 +46,39 @@ mysql2_mysql_enc_name_to_rb_hash (str, len)
4646
{
4747
static const unsigned char asso_values[] =
4848
{
49-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
50-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
51-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
52-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
53-
69, 69, 69, 69, 69, 69, 69, 69, 40, 5,
54-
0, 69, 0, 40, 25, 20, 10, 55, 69, 69,
55-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
56-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
57-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
58-
69, 69, 69, 69, 69, 69, 69, 35, 5, 0,
59-
10, 0, 20, 0, 5, 5, 69, 0, 10, 15,
60-
0, 0, 69, 69, 25, 5, 5, 0, 69, 30,
61-
69, 0, 69, 69, 69, 69, 69, 69, 69, 69,
62-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
63-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
64-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
65-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
66-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
67-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
68-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
70-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
71-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
72-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
73-
69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
74-
69, 69, 69, 69, 69, 69
49+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
50+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
51+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
52+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
53+
74, 74, 74, 74, 74, 74, 74, 74, 15, 5,
54+
0, 30, 5, 25, 40, 10, 20, 50, 74, 74,
55+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
56+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
57+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
58+
74, 74, 74, 74, 74, 74, 74, 40, 5, 0,
59+
15, 10, 0, 0, 0, 5, 74, 0, 25, 5,
60+
0, 5, 74, 74, 20, 5, 5, 0, 74, 45,
61+
74, 0, 74, 74, 74, 74, 74, 74, 74, 74,
62+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
63+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
64+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
65+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
66+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
67+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
68+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
69+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
70+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
71+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
72+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
73+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
74+
74, 74, 74, 74, 74, 74
7575
};
7676
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
7777
}
7878

7979
#ifdef __GNUC__
8080
__inline
81-
#ifdef __GNUC_STDC_INLINE__
81+
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
8282
__attribute__ ((__gnu_inline__))
8383
#endif
8484
#endif
@@ -89,66 +89,71 @@ mysql2_mysql_enc_name_to_rb (str, len)
8989
{
9090
enum
9191
{
92-
TOTAL_KEYWORDS = 39,
92+
TOTAL_KEYWORDS = 42,
9393
MIN_WORD_LENGTH = 3,
9494
MAX_WORD_LENGTH = 8,
9595
MIN_HASH_VALUE = 3,
96-
MAX_HASH_VALUE = 68
96+
MAX_HASH_VALUE = 73
9797
};
9898

9999
static const struct mysql2_mysql_enc_name_to_rb_map wordlist[] =
100100
{
101101
{""}, {""}, {""},
102102
{"gbk", "GBK"},
103103
{""},
104-
{"greek", "ISO-8859-7"},
104+
{"utf32", "UTF-32"},
105105
{"gb2312", "GB2312"},
106106
{"keybcs2", NULL},
107107
{""},
108108
{"ucs2", "UTF-16BE"},
109109
{"koi8u", "KOI8-R"},
110110
{"binary", "ASCII-8BIT"},
111-
{"eucjpms", "eucJP-ms"},
112-
{""},
111+
{"utf8mb4", "UTF-8"},
112+
{"macroman", "macRoman"},
113113
{"ujis", "eucJP-ms"},
114-
{"cp852", "CP852"},
114+
{"greek", "ISO-8859-7"},
115115
{"cp1251", "Windows-1251"},
116-
{"geostd8", NULL},
116+
{"utf16le", "UTF-16LE"},
117117
{""},
118118
{"sjis", "Shift_JIS"},
119119
{"macce", "macCentEuro"},
120+
{"cp1257", "Windows-1257"},
121+
{"eucjpms", "eucJP-ms"},
122+
{""},
123+
{"utf8", "UTF-8"},
124+
{"cp852", "CP852"},
125+
{"cp1250", "Windows-1250"},
126+
{"gb18030", "GB18030"},
127+
{""},
128+
{"swe7", NULL},
129+
{"koi8r", "KOI8-R"},
130+
{"tis620", "TIS-620"},
131+
{"geostd8", NULL},
132+
{""},
133+
{"big5", "Big5"},
134+
{"euckr", "EUC-KR"},
120135
{"latin2", "ISO-8859-2"},
136+
{"utf8mb3", "UTF-8"},
121137
{""},
122-
{"macroman", "macRoman"},
123138
{"dec8", NULL},
124-
{"utf32", "UTF-32"},
125-
{"latin1", "UTF-8"},
126-
{"utf8mb4", "UTF-8"},
139+
{"cp850", "CP850"},
140+
{"latin1", "ISO-8859-1"},
141+
{""},
127142
{"hp8", NULL},
128-
{"swe7", NULL},
129-
{"euckr", "EUC-KR"},
130-
{"cp1257", "Windows-1257"},
131-
{""}, {""},
132-
{"utf8", "UTF-8"},
133-
{"koi8r", "KOI8-R"},
134-
{"cp1256", "Windows-1256"},
135-
{""}, {""}, {""},
136-
{"cp866", "IBM866"},
143+
{""},
144+
{"utf16", "UTF-16"},
137145
{"latin7", "ISO-8859-13"},
138146
{""}, {""}, {""},
139147
{"ascii", "US-ASCII"},
140-
{"hebrew", "ISO-8859-8"},
141-
{""}, {""},
142-
{"big5", "Big5"},
143-
{"utf16", "UTF-16"},
144-
{"cp1250", "Windows-1250"},
145-
{""}, {""}, {""},
146-
{"cp850", "CP850"},
147-
{"tis620", "TIS-620"},
148+
{"cp1256", "Windows-1256"},
148149
{""}, {""}, {""},
149150
{"cp932", "Windows-31J"},
151+
{"hebrew", "ISO-8859-8"},
152+
{""}, {""}, {""}, {""},
150153
{"latin5", "ISO-8859-9"},
151-
{""}, {""}, {""}, {""}, {""}, {""},
154+
{""}, {""}, {""},
155+
{"cp866", "IBM866"},
156+
{""}, {""}, {""}, {""}, {""}, {""}, {""},
152157
{"armscii8", NULL}
153158
};
154159

ext/mysql2/mysql_enc_to_ruby.h

+94-14
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ const char *mysql2_mysql_enc_to_rb[] = {
5454
"macRoman",
5555
"UTF-16",
5656
"UTF-16",
57-
NULL,
57+
"UTF-16LE",
5858
"Windows-1256",
5959
"Windows-1257",
6060
"Windows-1257",
6161
"UTF-32",
6262
"UTF-32",
63-
NULL,
63+
"UTF-16LE",
6464
"ASCII-8BIT",
6565
NULL,
6666
"US-ASCII",
@@ -74,7 +74,7 @@ const char *mysql2_mysql_enc_to_rb[] = {
7474
NULL,
7575
"KOI8-R",
7676
"KOI8-R",
77-
NULL,
77+
"UTF-8",
7878
"ISO-8859-2",
7979
"ISO-8859-9",
8080
"ISO-8859-13",
@@ -119,10 +119,10 @@ const char *mysql2_mysql_enc_to_rb[] = {
119119
"UTF-16",
120120
"UTF-16",
121121
"UTF-16",
122-
NULL,
123-
NULL,
124-
NULL,
125-
NULL,
122+
"UTF-16",
123+
"UTF-16",
124+
"UTF-16",
125+
"UTF-16",
126126
NULL,
127127
NULL,
128128
NULL,
@@ -146,18 +146,22 @@ const char *mysql2_mysql_enc_to_rb[] = {
146146
"UTF-16BE",
147147
"UTF-16BE",
148148
"UTF-16BE",
149+
"UTF-16BE",
150+
"UTF-16BE",
151+
"UTF-16BE",
152+
"UTF-16BE",
149153
NULL,
150154
NULL,
151155
NULL,
152156
NULL,
153157
NULL,
154158
NULL,
155159
NULL,
156-
NULL,
157-
NULL,
158-
NULL,
159-
NULL,
160-
NULL,
160+
"UTF-16BE",
161+
"UTF-32",
162+
"UTF-32",
163+
"UTF-32",
164+
"UTF-32",
161165
"UTF-32",
162166
"UTF-32",
163167
"UTF-32",
@@ -186,6 +190,33 @@ const char *mysql2_mysql_enc_to_rb[] = {
186190
NULL,
187191
NULL,
188192
NULL,
193+
"UTF-8",
194+
"UTF-8",
195+
"UTF-8",
196+
"UTF-8",
197+
"UTF-8",
198+
"UTF-8",
199+
"UTF-8",
200+
"UTF-8",
201+
"UTF-8",
202+
"UTF-8",
203+
"UTF-8",
204+
"UTF-8",
205+
"UTF-8",
206+
"UTF-8",
207+
"UTF-8",
208+
"UTF-8",
209+
"UTF-8",
210+
"UTF-8",
211+
"UTF-8",
212+
"UTF-8",
213+
"UTF-8",
214+
"UTF-8",
215+
"UTF-8",
216+
"UTF-8",
217+
NULL,
218+
NULL,
219+
NULL,
189220
NULL,
190221
NULL,
191222
NULL,
@@ -210,18 +241,67 @@ const char *mysql2_mysql_enc_to_rb[] = {
210241
"UTF-8",
211242
"UTF-8",
212243
"UTF-8",
244+
"UTF-8",
245+
"UTF-8",
246+
"UTF-8",
247+
"UTF-8",
248+
"UTF-8",
249+
"GB18030",
250+
"GB18030",
251+
"GB18030",
213252
NULL,
214253
NULL,
215254
NULL,
216255
NULL,
256+
"UTF-8",
257+
"UTF-8",
258+
"UTF-8",
259+
"UTF-8",
260+
"UTF-8",
261+
"UTF-8",
262+
"UTF-8",
263+
"UTF-8",
264+
"UTF-8",
265+
"UTF-8",
266+
"UTF-8",
267+
"UTF-8",
268+
"UTF-8",
269+
"UTF-8",
270+
"UTF-8",
271+
"UTF-8",
272+
"UTF-8",
217273
NULL,
274+
"UTF-8",
275+
"UTF-8",
276+
"UTF-8",
218277
NULL,
278+
"UTF-8",
279+
"UTF-8",
280+
"UTF-8",
281+
"UTF-8",
282+
"UTF-8",
283+
"UTF-8",
284+
"UTF-8",
285+
"UTF-8",
286+
"UTF-8",
287+
"UTF-8",
288+
"UTF-8",
289+
"UTF-8",
290+
"UTF-8",
291+
"UTF-8",
292+
"UTF-8",
293+
"UTF-8",
294+
"UTF-8",
295+
"UTF-8",
219296
NULL,
297+
"UTF-8",
298+
"UTF-8",
299+
"UTF-8",
220300
NULL,
301+
"UTF-8",
221302
NULL,
222303
NULL,
223-
NULL,
224-
NULL,
304+
"UTF-8",
225305
"UTF-8",
226306
"UTF-8",
227307
"UTF-8",

0 commit comments

Comments
 (0)