diff --git a/mysql/encoding.go b/mysql/encoding.go index 9c1adb23..e5599524 100644 --- a/mysql/encoding.go +++ b/mysql/encoding.go @@ -551,7 +551,7 @@ func AppendBinaryValue(data []byte, fieldType uint8, value interface{}) ([]byte, case string: switch fieldType { case TypeDatetime, TypeTimestamp: - if v == "0000-00-00 00:00:00" { + if strings.HasPrefix(v, "0000-00-00 00:00:00"){ t = append(t, 0) } else { ts, err := time.Parse("2006-01-02 15:04:05", v)