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

@ -480,8 +480,7 @@ static void make_base_query(String *new_query,
/* We do not support UCS2, UTF16, UTF32 as a client character set */
DBUG_ASSERT(current_thd->variables.character_set_client->mbminlen == 1);
new_query->length(0); // Don't copy anything from old buffer
if (new_query->realloc(query_length + additional_length))
if (new_query->alloc(query_length + additional_length))
{
/*
We could not allocate the query. Use original query for