Skip to content

Commit

Permalink
Use 4-byte UTF-8 by default (#979)
Browse files Browse the repository at this point in the history
* Use 4-byte UTF-8 by default

* update comment

---------

Co-authored-by: lance6716 <[email protected]>
  • Loading branch information
dveeden and lance6716 authored Feb 7, 2025
1 parent b039e99 commit a5c10ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (c *Conn) writeAuthHandshake() error {
data[11] = 0x00

// Charset [1 byte]
// use default collation id 33 here, is `utf8mb3_general_ci`
// use default collation id 255 here, is `utf8mb4_0900_ai_ci`
collationName := c.collation
if len(collationName) == 0 {
collationName = DEFAULT_COLLATION_NAME
Expand Down
8 changes: 4 additions & 4 deletions mysql/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ const (
DEFAULT_IPV6_ADDR = "[::1]:3306"
DEFAULT_USER = "root"
DEFAULT_PASSWORD = ""
DEFAULT_FLAVOR = "mysql"
DEFAULT_CHARSET = "utf8"
DEFAULT_COLLATION_ID uint8 = 33
DEFAULT_COLLATION_NAME string = "utf8_general_ci"
DEFAULT_FLAVOR = MySQLFlavor
DEFAULT_CHARSET = "utf8mb4"
DEFAULT_COLLATION_ID uint8 = 255
DEFAULT_COLLATION_NAME string = "utf8mb4_0900_ai_ci"
)

const (
Expand Down

0 comments on commit a5c10ba

Please sign in to comment.