Commit 55f734ed authored by Monty's avatar Monty

Change to LONGLONG_BUFFER_SIZE usage to avoid extra mallocs

This change is needed in 10.5 to avoid extra malloc calls in val_str().
In 10.6 it's not needed anymore but the extra +1 byte doesn't harm
that much.
parent c8992fc3
...@@ -1085,7 +1085,7 @@ Field_longstr::make_packed_sort_key_part(uchar *buff, ...@@ -1085,7 +1085,7 @@ Field_longstr::make_packed_sort_key_part(uchar *buff,
uchar* uchar*
Field_longstr::pack_sort_string(uchar *to, const SORT_FIELD_ATTR *sort_field) Field_longstr::pack_sort_string(uchar *to, const SORT_FIELD_ATTR *sort_field)
{ {
StringBuffer<LONGLONG_BUFFER_SIZE> buf; StringBuffer<LONGLONG_BUFFER_SIZE+1> buf;
val_str(&buf, &buf); val_str(&buf, &buf);
return to + sort_field->pack_sort_string(to, &buf, field_charset()); return to + sort_field->pack_sort_string(to, &buf, field_charset());
} }
......
...@@ -3634,7 +3634,7 @@ String *Item_int::val_str(String *str) ...@@ -3634,7 +3634,7 @@ String *Item_int::val_str(String *str)
void Item_int::print(String *str, enum_query_type query_type) void Item_int::print(String *str, enum_query_type query_type)
{ {
StringBuffer<LONGLONG_BUFFER_SIZE> buf; StringBuffer<LONGLONG_BUFFER_SIZE+1> buf;
// my_charset_bin is good enough for numbers // my_charset_bin is good enough for numbers
buf.set_int(value, unsigned_flag, &my_charset_bin); buf.set_int(value, unsigned_flag, &my_charset_bin);
str->append(buf); str->append(buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment