Skip to content

Commit

Permalink
Merge pull request #198 from XiaoMi/fix-mysql8-charset
Browse files Browse the repository at this point in the history
修复后端 mysql 5.x,使用 mysql8 客户端客户连接时 charset 错误
  • Loading branch information
xiyangxixian authored Mar 1, 2022
2 parents 5b3b01d + c4bb752 commit c58faee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/direct_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func (dc *DirectConnection) SetAutoCommit(v uint8) error {
func (dc *DirectConnection) SetCharset(charset string, collation mysql.CollationID) ( /*changed*/ bool, error) {
charset = strings.Trim(charset, "\"'`")

if collation == 0 {
if collation == 0 || collation > 247 {
collation = mysql.CollationNames[mysql.Charsets[charset]]
}

Expand Down

0 comments on commit c58faee

Please sign in to comment.