Skip to content

Commit

Permalink
util/charset: Add utf8mb4 as alias for utf8 (#7339) (#8048)
Browse files Browse the repository at this point in the history
  • Loading branch information
winkyao authored Oct 25, 2018
1 parent 4c86815 commit 587ff8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions expression/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,8 @@ func (s *testIntegrationSuite) TestStringBuiltin(c *C) {
result.Check(testkit.Rows("'121' '0' '中文' <nil>"))

// for convert
result = tk.MustQuery(`select convert("123" using "866"), convert("123" using "binary"), convert("中文" using "binary"), convert("中文" using "utf8"), convert(cast("中文" as binary) using "utf8");`)
result.Check(testkit.Rows("123 123 中文 中文 中文"))
result = tk.MustQuery(`select convert("123" using "866"), convert("123" using "binary"), convert("中文" using "binary"), convert("中文" using "utf8"), convert("中文" using "utf8mb4"), convert(cast("中文" as binary) using "utf8");`)
result.Check(testkit.Rows("123 123 中文 中文 中文 中文"))

// for insert
result = tk.MustQuery(`select insert("中文", 1, 1, cast("aaa" as binary)), insert("ba", -1, 1, "aaa"), insert("ba", 1, 100, "aaa"), insert("ba", 100, 1, "aaa");`)
Expand Down
1 change: 1 addition & 0 deletions util/charset/encoding_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var encodings = map[string]struct {
"unicode-1-1-utf-8": {encoding.Nop, "utf-8"},
"utf-8": {encoding.Nop, "utf-8"},
"utf8": {encoding.Nop, "utf-8"},
"utf8mb4": {encoding.Nop, "utf-8"},
"binary": {encoding.Nop, "binary"},
"866": {charmap.CodePage866, "ibm866"},
"cp866": {charmap.CodePage866, "ibm866"},
Expand Down

0 comments on commit 587ff8c

Please sign in to comment.