MDEV-10500 CASE/IF Statement returns multiple values and shifts further result values to the next column

We assume all around the code that null_value==true is in sync
with NULL value returned by val_str()/val_decimal().
Item_sum_sum::val_decimal() erroneously returned a non-NULL value together
with null_value set to true. Fixing to return NULL instead.
This commit is contained in:
Alexander Barkov 2016-08-08 16:04:40 +04:00
commit 1b3430a5ae
3 changed files with 53 additions and 1 deletions

View file

@ -1462,7 +1462,7 @@ my_decimal *Item_sum_sum::val_decimal(my_decimal *val)
if (aggr)
aggr->endup();
if (hybrid_type == DECIMAL_RESULT)
return (dec_buffs + curr_dec_buff);
return null_value ? NULL : (dec_buffs + curr_dec_buff);
return val_decimal_from_real(val);
}