diff --git a/packets.go b/packets.go index d5ea888fd..ef0c7b5ce 100644 --- a/packets.go +++ b/packets.go @@ -1008,6 +1008,13 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error { } case time.Time: + if stmt.mc.strict && v.IsZero() { + nullMask[i/8] |= 1 << (uint(i) & 7) + paramTypes[i+i] = fieldTypeNULL + paramTypes[i+i+1] = 0x00 + continue + } + paramTypes[i+i] = fieldTypeString paramTypes[i+i+1] = 0x00