Skip to content

Commit b8ab80d

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 b8ab80d

File tree

4 files changed

+183
-99
lines changed

4 files changed

+183
-99
lines changed

ext/mysql2/mysql_enc_name_to_ruby.h

+67-72
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* C code produced by gperf version 3.0.3 */
2-
/* Command-line: gperf */
1+
/* ANSI-C code produced by gperf version 3.1 */
2+
/* Command-line: /usr/bin/gperf */
33
/* Computed positions: -k'1,3,$' */
44

55
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -26,11 +26,11 @@
2626
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
2727
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
2828
/* The character set is not based on ISO-646. */
29-
error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu[email protected]>."
29+
#error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>."
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
@@ -40,123 +40,118 @@ inline
4040
#endif
4141
#endif
4242
static unsigned int
43-
mysql2_mysql_enc_name_to_rb_hash (str, len)
44-
register const char *str;
45-
register unsigned int len;
43+
mysql2_mysql_enc_name_to_rb_hash (register const char *str, register size_t len)
4644
{
4745
static const unsigned char asso_values[] =
4846
{
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
47+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
48+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
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, 15, 5,
52+
0, 30, 5, 25, 40, 10, 20, 50, 74, 74,
53+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
54+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
55+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
56+
74, 74, 74, 74, 74, 74, 74, 40, 5, 0,
57+
15, 10, 0, 0, 0, 5, 74, 0, 25, 5,
58+
0, 5, 74, 74, 20, 5, 5, 0, 74, 45,
59+
74, 0, 74, 74, 74, 74, 74, 74, 74, 74,
60+
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
61+
74, 74, 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
7573
};
7674
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
7775
}
7876

79-
#ifdef __GNUC__
80-
__inline
81-
#ifdef __GNUC_STDC_INLINE__
82-
__attribute__ ((__gnu_inline__))
83-
#endif
84-
#endif
8577
const struct mysql2_mysql_enc_name_to_rb_map *
86-
mysql2_mysql_enc_name_to_rb (str, len)
87-
register const char *str;
88-
register unsigned int len;
78+
mysql2_mysql_enc_name_to_rb (register const char *str, register size_t len)
8979
{
9080
enum
9181
{
92-
TOTAL_KEYWORDS = 39,
82+
TOTAL_KEYWORDS = 42,
9383
MIN_WORD_LENGTH = 3,
9484
MAX_WORD_LENGTH = 8,
9585
MIN_HASH_VALUE = 3,
96-
MAX_HASH_VALUE = 68
86+
MAX_HASH_VALUE = 73
9787
};
9888

9989
static const struct mysql2_mysql_enc_name_to_rb_map wordlist[] =
10090
{
10191
{""}, {""}, {""},
10292
{"gbk", "GBK"},
10393
{""},
104-
{"greek", "ISO-8859-7"},
94+
{"utf32", "UTF-32"},
10595
{"gb2312", "GB2312"},
10696
{"keybcs2", NULL},
10797
{""},
10898
{"ucs2", "UTF-16BE"},
10999
{"koi8u", "KOI8-R"},
110100
{"binary", "ASCII-8BIT"},
111-
{"eucjpms", "eucJP-ms"},
112-
{""},
101+
{"utf8mb4", "UTF-8"},
102+
{"macroman", "macRoman"},
113103
{"ujis", "eucJP-ms"},
114-
{"cp852", "CP852"},
104+
{"greek", "ISO-8859-7"},
115105
{"cp1251", "Windows-1251"},
116-
{"geostd8", NULL},
106+
{"utf16le", "UTF-16LE"},
117107
{""},
118108
{"sjis", "Shift_JIS"},
119109
{"macce", "macCentEuro"},
110+
{"cp1257", "Windows-1257"},
111+
{"eucjpms", "eucJP-ms"},
112+
{""},
113+
{"utf8", "UTF-8"},
114+
{"cp852", "CP852"},
115+
{"cp1250", "Windows-1250"},
116+
{"gb18030", "GB18030"},
117+
{""},
118+
{"swe7", NULL},
119+
{"koi8r", "KOI8-R"},
120+
{"tis620", "TIS-620"},
121+
{"geostd8", NULL},
122+
{""},
123+
{"big5", "Big5"},
124+
{"euckr", "EUC-KR"},
120125
{"latin2", "ISO-8859-2"},
126+
{"utf8mb3", "UTF-8"},
121127
{""},
122-
{"macroman", "macRoman"},
123128
{"dec8", NULL},
124-
{"utf32", "UTF-32"},
129+
{"cp850", "CP850"},
125130
{"latin1", "UTF-8"},
126-
{"utf8mb4", "UTF-8"},
131+
{""},
127132
{"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"},
133+
{""},
134+
{"utf16", "UTF-16"},
137135
{"latin7", "ISO-8859-13"},
138136
{""}, {""}, {""},
139137
{"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"},
138+
{"cp1256", "Windows-1256"},
148139
{""}, {""}, {""},
149140
{"cp932", "Windows-31J"},
141+
{"hebrew", "ISO-8859-8"},
142+
{""}, {""}, {""}, {""},
150143
{"latin5", "ISO-8859-9"},
151-
{""}, {""}, {""}, {""}, {""}, {""},
144+
{""}, {""}, {""},
145+
{"cp866", "IBM866"},
146+
{""}, {""}, {""}, {""}, {""}, {""}, {""},
152147
{"armscii8", NULL}
153148
};
154149

155150
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
156151
{
157-
register int key = mysql2_mysql_enc_name_to_rb_hash (str, len);
152+
register unsigned int key = mysql2_mysql_enc_name_to_rb_hash (str, len);
158153

159-
if (key <= MAX_HASH_VALUE && key >= 0)
154+
if (key <= MAX_HASH_VALUE)
160155
{
161156
register const char *s = wordlist[key].name;
162157

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)