Skip to content

Commit a5c10ba

Browse files
dveedenlance6716
andauthored
Use 4-byte UTF-8 by default (#979)
* Use 4-byte UTF-8 by default * update comment --------- Co-authored-by: lance6716 <[email protected]>
1 parent b039e99 commit a5c10ba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (c *Conn) writeAuthHandshake() error {
275275
data[11] = 0x00
276276

277277
// Charset [1 byte]
278-
// use default collation id 33 here, is `utf8mb3_general_ci`
278+
// use default collation id 255 here, is `utf8mb4_0900_ai_ci`
279279
collationName := c.collation
280280
if len(collationName) == 0 {
281281
collationName = DEFAULT_COLLATION_NAME

mysql/const.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ const (
183183
DEFAULT_IPV6_ADDR = "[::1]:3306"
184184
DEFAULT_USER = "root"
185185
DEFAULT_PASSWORD = ""
186-
DEFAULT_FLAVOR = "mysql"
187-
DEFAULT_CHARSET = "utf8"
188-
DEFAULT_COLLATION_ID uint8 = 33
189-
DEFAULT_COLLATION_NAME string = "utf8_general_ci"
186+
DEFAULT_FLAVOR = MySQLFlavor
187+
DEFAULT_CHARSET = "utf8mb4"
188+
DEFAULT_COLLATION_ID uint8 = 255
189+
DEFAULT_COLLATION_NAME string = "utf8mb4_0900_ai_ci"
190190
)
191191

192192
const (

0 commit comments

Comments
 (0)