コード例 #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")
}