Skip to content

Commit 1f320e2

Browse files
author
陈家启
committed
support utf8mb3 charset
1 parent 3bca03d commit 1f320e2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

charset/charset.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ type Collation struct {
4646
IsDefault bool
4747
}
4848

49-
var collationsIDMap = make(map[int]*Collation)
50-
var collationsNameMap = make(map[string]*Collation)
51-
var supportedCollations = make([]*Collation, 0, len(supportedCollationNames))
49+
var (
50+
collationsIDMap = make(map[int]*Collation)
51+
collationsNameMap = make(map[string]*Collation)
52+
supportedCollations = make([]*Collation, 0, len(supportedCollationNames))
53+
)
5254

5355
// All the supported charsets should be in the following table.
5456
var charsetInfos = map[string]*Charset{
@@ -235,6 +237,7 @@ const (
235237
CharsetUTF16 = "utf16"
236238
CharsetUTF16LE = "utf16le"
237239
CharsetUTF32 = "utf32"
240+
CharsetUTF8MB3 = "utf8mb3"
238241
)
239242

240243
var collations = []*Collation{
@@ -459,6 +462,7 @@ var collations = []*Collation{
459462
{247, "utf8mb4", "utf8mb4_vietnamese_ci", false},
460463
{255, "utf8mb4", "utf8mb4_0900_ai_ci", false},
461464
{2048, "utf8mb4", "utf8mb4_zh_pinyin_tidb_as_cs", false},
465+
{2049, "utf8mb3", "utf8mb3_general_ci", true},
462466
}
463467

464468
// AddCharset adds a new charset.

0 commit comments

Comments
 (0)