mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 10:57:54 +02:00
Fix handling of NULL values in decimal fields in FORMAT(). (Bug #13361)
mysql-test/r/func_str.result: Add new results mysql-test/t/func_str.test: Add new regression test sql/item_strfunc.cc: Handle NULL decimal fields in FORMAT().
This commit is contained in:
parent
d2fc3bd424
commit
0f0f72c74f
3 changed files with 18 additions and 0 deletions
|
|
@ -1733,6 +1733,8 @@ String *Item_func_format::val_str(String *str)
|
|||
{
|
||||
my_decimal dec_val, rnd_dec, *res;
|
||||
res= args[0]->val_decimal(&dec_val);
|
||||
if ((null_value=args[0]->null_value))
|
||||
return 0; /* purecov: inspected */
|
||||
my_decimal_round(E_DEC_FATAL_ERROR, res, decimals, false, &rnd_dec);
|
||||
my_decimal2string(E_DEC_FATAL_ERROR, &rnd_dec, 0, 0, 0, str);
|
||||
str_length= str->length();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue