示例#1
0
文件: Shard.go 项目: ASAPPinc/fun-go
func IsDuplicateExecError(err errs.Err) bool {
	str := err.StandardErrorMessage()
	return strings.HasPrefix(str, "Error 1060: Duplicate column name") ||
		strings.HasPrefix(str, "Error 1061: Duplicate key name") ||
		strings.HasPrefix(str, "Error 1050: Table") ||
		strings.HasPrefix(str, "Error 1022: Can't write; duplicate key in table")
}
示例#2
0
文件: Shard.go 项目: ASAPPinc/fun-go
func IsDuplicateEntryError(err errs.Err) bool {
	str := err.StandardErrorMessage()
	return strings.Contains(str, "Duplicate entry")
}