← Back to team overview

maria-developers team mailing list archive

Re: For review https://mariadb.atlassian.net/browse/MDEV-9058


Hi, Monty!

On 12.01.2016 15:13, Oleksandr Byelkin wrote:

+    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

- 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.

It appeared that it is not OK. The NET belong to THD so I just cant; allocate new (or I misunderstood what you meant).

Otherweise it is fixed in :

revision-id: ec9b1f6f6d95d9a004d38dac4927fbd7512b7752 (mariadb-10.1.8-75-gec9b1f6)
parent(s): b92189b69d68a560240692d84155095607337ce5
committer: Oleksandr Byelkin
timestamp: 2016-01-13 19:36:00 +0100

MDEV-9058: post-review changes.