+ if (maria_multi_check(thd, packet, packet_length))
+ break;
+ {
+ /* We have to store next length because it will be destroyed
by '\0' */
+ uint next_subpacket_length= uint3korr(packet);
+ unsigned char *readbuff= net->buff;
+ unsigned long readbuff_max_packet= net->max_packet;
+
Remove the above one extra empty line.
Add also some documentation why we are changing net->buff here instead
of creating another buffer and using this instead.
Actually it's much better to create a new buffer for packet becasue
of:
- The buffer only need to be of size packet_length, not
net->max_packet which can be much longer.
- Clearer code as you don't have to manipulate net internal structures
or restore these.
- The disadvantage is that you can't allow COM_CHANGE_USER, but I
don't think one should be able to do that anyway as this may ask for
more information from the client.