File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1212# Individual Persons
1313
1414Aaron Hopkins <go-sql-driver at die.net>
15+ Achille Roussel <achille.roussel at gmail.com>
1516Arne Hormann <arnehormann at gmail.com>
1617Asta Xie <xiemengjun at gmail.com>
1718Bulat Gaifullin <gaifullinbf at gmail.com>
Original file line number Diff line number Diff line change @@ -1078,17 +1078,19 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
10781078 paramTypes [i + i ] = fieldTypeString
10791079 paramTypes [i + i + 1 ] = 0x00
10801080
1081- var val []byte
1081+ var a [64 ]byte
1082+ var b = a [:0 ]
1083+
10821084 if v .IsZero () {
1083- val = [] byte ( "0000-00-00" )
1085+ b = append ( b , "0000-00-00" ... )
10841086 } else {
1085- val = [] byte ( v .In (mc .cfg .Loc ).Format ( timeFormat ) )
1087+ b = v .In (mc .cfg .Loc ).AppendFormat ( b , timeFormat )
10861088 }
10871089
10881090 paramValues = appendLengthEncodedInteger (paramValues ,
1089- uint64 (len (val )),
1091+ uint64 (len (b )),
10901092 )
1091- paramValues = append (paramValues , val ... )
1093+ paramValues = append (paramValues , b ... )
10921094
10931095 default :
10941096 return fmt .Errorf ("can not convert type: %T" , arg )
You can’t perform that action at this time.
0 commit comments