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") }
func IsDuplicateEntryError(err errs.Err) bool { str := err.StandardErrorMessage() return strings.Contains(str, "Duplicate entry") }