summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-07-12 18:12:20 +0300
committerMonty <monty@mariadb.org>2018-07-13 20:14:27 +0300
commita9ca819897f5c82582bfd3fedb09c78131cf8e00 (patch)
treea5caee7d6da5c9ee1046cdf509586e4f7a313e56 /sql/sql_cache.cc
parent5180eda342c07d44bdc06b9b872f1673224fdeed (diff)
downloadmariadb-git-a9ca819897f5c82582bfd3fedb09c78131cf8e00.tar.gz
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
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc3
1 files changed, 1 insertions, 2 deletions
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