From d99eb63b2bff35f561225c1d8b46fd0da61c817f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 4 Feb 2025 14:13:00 +0100 Subject: [PATCH 1/2] Use 4-byte UTF-8 by default --- mysql/const.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql/const.go b/mysql/const.go index 09c62cc3d..293382a38 100644 --- a/mysql/const.go +++ b/mysql/const.go @@ -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 ( From e1779b2f281a3ad63e2c8942b985817c23c83f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 7 Feb 2025 08:10:25 +0100 Subject: [PATCH 2/2] update comment --- client/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/auth.go b/client/auth.go index 200009609..a491dd82f 100644 --- a/client/auth.go +++ b/client/auth.go @@ -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