|
|
@@ -1078,17 +1078,19 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
|
|
|
paramTypes[i+i] = fieldTypeString
|
|
|
paramTypes[i+i+1] = 0x00
|
|
|
|
|
|
- var val []byte
|
|
|
+ var a [64]byte
|
|
|
+ var b = a[:0]
|
|
|
+
|
|
|
if v.IsZero() {
|
|
|
- val = []byte("0000-00-00")
|
|
|
+ b = append(b, "0000-00-00"...)
|
|
|
} else {
|
|
|
- val = []byte(v.In(mc.cfg.Loc).Format(timeFormat))
|
|
|
+ b = v.In(mc.cfg.Loc).AppendFormat(b, timeFormat)
|
|
|
}
|
|
|
|
|
|
paramValues = appendLengthEncodedInteger(paramValues,
|
|
|
- uint64(len(val)),
|
|
|
+ uint64(len(b)),
|
|
|
)
|
|
|
- paramValues = append(paramValues, val...)
|
|
|
+ paramValues = append(paramValues, b...)
|
|
|
|
|
|
default:
|
|
|
return fmt.Errorf("can not convert type: %T", arg)
|