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:
@ -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;
|
||||
|
Reference in New Issue
Block a user