@@ -789,13 +789,13 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
789
789
790
790
if len (args ) > 0 {
791
791
pos := minPktLen
792
- // NULL-bitmap [(len(args)+7)/8 bytes]
792
+
793
793
var nullMask []byte
794
794
if maskLen , typesLen := (len (args )+ 7 )/ 8 , 1 + 2 * len (args ); pos + maskLen + typesLen >= len (data ) {
795
- // buffer has to be extended but we don't know by how much
796
- // so we depend on append after nullMask fits .
797
- // The default size didn't suffice and we have to deal with a lot of columns,
798
- // so allocation size is hard to guess.
795
+ // buffer has to be extended but we don't know by how much so
796
+ // we depend on append after all data with known sizes fit .
797
+ // We stop at that because we deal with a lot of columns here
798
+ // which makes the required allocation size hard to guess.
799
799
tmp := make ([]byte , pos + maskLen + typesLen )
800
800
copy (tmp [:pos ], data [:pos ])
801
801
data = tmp
@@ -824,7 +824,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
824
824
for i , arg := range args {
825
825
// build NULL-bitmap
826
826
if arg == nil {
827
- nullMask [i / 8 ] |= 1 << (uint (i ) & 7 ) // |= 1 << uint(i)
827
+ nullMask [i / 8 ] |= 1 << (uint (i ) & 7 )
828
828
paramTypes [i + i ] = fieldTypeNULL
829
829
paramTypes [i + i + 1 ] = 0x00
830
830
continue
@@ -894,7 +894,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
894
894
}
895
895
896
896
// Handle []byte(nil) as a NULL value
897
- nullMask [i / 8 ] |= 1 << (uint (i ) & 7 ) // |= 1 << uint(i)
897
+ nullMask [i / 8 ] |= 1 << (uint (i ) & 7 )
898
898
paramTypes [i + i ] = fieldTypeNULL
899
899
paramTypes [i + i + 1 ] = 0x00
900
900
0 commit comments