Skip to content

Commit

Permalink
support utf8mb3 charset
Browse files Browse the repository at this point in the history
  • Loading branch information
陈家启 committed Aug 31, 2022
1 parent 3bca03d commit 1f320e2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions charset/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ type Collation struct {
IsDefault bool
}

var collationsIDMap = make(map[int]*Collation)
var collationsNameMap = make(map[string]*Collation)
var supportedCollations = make([]*Collation, 0, len(supportedCollationNames))
var (
collationsIDMap = make(map[int]*Collation)
collationsNameMap = make(map[string]*Collation)
supportedCollations = make([]*Collation, 0, len(supportedCollationNames))
)

// All the supported charsets should be in the following table.
var charsetInfos = map[string]*Charset{
Expand Down Expand Up @@ -235,6 +237,7 @@ const (
CharsetUTF16 = "utf16"
CharsetUTF16LE = "utf16le"
CharsetUTF32 = "utf32"
CharsetUTF8MB3 = "utf8mb3"
)

var collations = []*Collation{
Expand Down Expand Up @@ -459,6 +462,7 @@ var collations = []*Collation{
{247, "utf8mb4", "utf8mb4_vietnamese_ci", false},
{255, "utf8mb4", "utf8mb4_0900_ai_ci", false},
{2048, "utf8mb4", "utf8mb4_zh_pinyin_tidb_as_cs", false},
{2049, "utf8mb3", "utf8mb3_general_ci", true},
}

// AddCharset adds a new charset.
Expand Down

0 comments on commit 1f320e2

Please sign in to comment.