makePacket wraps a payload in a MySQL protocol packet header.
(seq byte, payload []byte)
| 281 | |
| 282 | // makePacket wraps a payload in a MySQL protocol packet header. |
| 283 | func makePacket(seq byte, payload []byte) []byte { |
| 284 | pkt := make([]byte, 4+len(payload)) |
| 285 | pkt[0] = byte(len(payload)) |
| 286 | pkt[1] = byte(len(payload) >> 8) |
| 287 | pkt[2] = byte(len(payload) >> 16) |
| 288 | pkt[3] = seq |
| 289 | copy(pkt[4:], payload) |
| 290 | return pkt |
| 291 | } |
| 292 | |
| 293 | // TestGetSystemVarBufferReuse verifies that getSystemVar returns a value that |
| 294 | // is not corrupted by the subsequent skipRows call. |
no outgoing calls
no test coverage detected