diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-04 16:47:11 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-04 16:47:11 +0200 |
commit | 7fb73ed1432f53d1d8ab6c7aeb299ac913727ce8 (patch) | |
tree | a4931bf9418b28824d3ff4c68f4a2d888b584f65 /sql/session_tracker.cc | |
parent | 42bba9782b36247c6c2241ea4d5996723af273fd (diff) | |
parent | 5008fc709bca54bd29a4d3f35aebf6e25468b9dd (diff) | |
download | mariadb-git-7fb73ed1432f53d1d8ab6c7aeb299ac913727ce8.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/session_tracker.cc')
-rw-r--r-- | sql/session_tracker.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc index 45d7db91fb4..1b21012f09e 100644 --- a/sql/session_tracker.cc +++ b/sql/session_tracker.cc @@ -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); } |