Merge branch '10.2' into 10.3

This commit is contained in:
Oleksandr Byelkin 2020-05-04 16:47:11 +02:00
commit 7fb73ed143
130 changed files with 3685 additions and 3334 deletions

View file

@ -1221,7 +1221,7 @@ void Session_tracker::store(THD *thd, String *buf)
}
size_t length= buf->length() - start;
uchar *data= (uchar *)(buf->ptr() + start);
uchar *data;
uint size;
if ((size= net_length_size(length)) != 1)
@ -1231,8 +1231,16 @@ void Session_tracker::store(THD *thd, String *buf)
buf->length(start); // it is safer to have 0-length block in case of error
return;
}
/*
The 'buf->reserve()' can change the buf->ptr() so we cannot
calculate the 'data' earlier.
*/
data= (uchar *)(buf->ptr() + start);
memmove(data + (size - 1), data, length);
}
else
data= (uchar *)(buf->ptr() + start);
net_store_length(data - 1, length);
}