MCPcopy Create free account
hub / github.com/MariaDB/server / alloc_buffer

Function alloc_buffer

sql/item_strfunc.cc:3262–3281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3260
3261
3262inline String* alloc_buffer(String *res,String *str,String *tmp_value,
3263 ulong length)
3264{
3265 if (res->alloced_length() < length)
3266 {
3267 if (str->alloced_length() >= length)
3268 {
3269 (void) str->copy(*res);
3270 str->length(length);
3271 return str;
3272 }
3273 if (tmp_value->alloc(length))
3274 return 0;
3275 (void) tmp_value->copy(*res);
3276 tmp_value->length(length);
3277 return tmp_value;
3278 }
3279 res->length(length);
3280 return res;
3281}
3282
3283
3284bool Item_func_repeat::fix_length_and_dec(THD *thd)

Callers 2

val_strMethod · 0.85
initMethod · 0.85

Calls 4

alloced_lengthMethod · 0.45
copyMethod · 0.45
lengthMethod · 0.45
allocMethod · 0.45

Tested by

no test coverage detected