Consider the example:
There is an assumption that doubles represented as strings couldn't take more then 22 chars. This is incorrect if a big double is sent into FORMAT() function. However the expression args->max_char_length() that is called inside Item_func_format::fix_length_and_dec() returns 22 and this causes the error.
This is also relevant for ColumnStore.