1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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

@ -3220,7 +3220,7 @@ int select_export::send_data(List<Item> &items)
((uint64) res->length() / res->charset()->mbminlen + 1) *
write_cs->mbmaxlen + 1;
set_if_smaller(estimated_bytes, UINT_MAX32);
if (cvt_str.realloc((uint32) estimated_bytes))
if (cvt_str.alloc((uint32) estimated_bytes))
{
my_error(ER_OUTOFMEMORY, MYF(ME_FATAL), (uint32) estimated_bytes);
goto err;