From a9ca819897f5c82582bfd3fedb09c78131cf8e00 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 12 Jul 2018 18:12:20 +0300 Subject: 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 --- sql/sql_cache.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sql/sql_cache.cc') diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 76b2d6db247..44211fca506 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -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 -- cgit v1.2.1