1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Call alloc() instead of realloc()

Use alloc() if we don't need original string (avoid copy)
Removed not needed test of str_length in sql_string.cc
This commit is contained in:
Monty
2018-07-12 18:12:20 +03:00
parent 5180eda342
commit a9ca819897
5 changed files with 11 additions and 15 deletions

View File

@ -103,8 +103,7 @@ bool String::realloc_raw(size_t alloc_length)
(thread_specific ?
MY_THREAD_SPECIFIC : 0)))))
{
if (str_length > len - 1)
str_length= 0;
DBUG_ASSERT(str_length < len);
if (str_length) // Avoid bugs in memcpy on AIX
memcpy(new_ptr,Ptr,str_length);
new_ptr[str_length]=0;