优化自增锁性能

This commit is contained in:
刘祥超
2023-07-04 22:02:17 +08:00
parent 9f564a4739
commit 58a84083ae
4 changed files with 58 additions and 4 deletions

View File

@@ -80,3 +80,12 @@ func CheckSQLDuplicateErr(err error) bool {
}
return CheckSQLErrCode(err, 1062)
}
// IsMySQLError Check error is MySQLError
func IsMySQLError(err error) bool {
if err == nil {
return false
}
_, ok := err.(*mysql.MySQLError)
return ok
}