mirror of
https://github.com/MariaDB/server.git
synced 2025-07-14 13:41:20 +03:00
cleanup: Field_set::empty_set_string
in particular, it overwrites pre-allocated buffer in val_buffer, so following val_buffer->append()'s cause totally unnecessary mallocs.
This commit is contained in:
10
sql/field.cc
10
sql/field.cc
@ -9381,16 +9381,6 @@ String *Field_set::val_str(String *val_buffer,
|
||||
ulonglong tmp=(ulonglong) Field_enum::val_int();
|
||||
uint bitnr=0;
|
||||
|
||||
/*
|
||||
Some callers expect *val_buffer to contain the result,
|
||||
so we assign to it, rather than doing 'return &empty_set_string.
|
||||
*/
|
||||
*val_buffer= empty_set_string;
|
||||
if (tmp == 0)
|
||||
{
|
||||
return val_buffer;
|
||||
}
|
||||
|
||||
val_buffer->set_charset(field_charset());
|
||||
val_buffer->length(0);
|
||||
|
||||
|
Reference in New Issue
Block a user