On 02/11/11 11:00 AM, Jorgen Loland wrote:
> >@@ -599,15 +604,17 @@ longlong Item_singlerow_subselect::val_i
> >
> > String *Item_singlerow_subselect::val_str(String *str)
> > {
> >+ DBUG_ENTER("Item_singlerow_subselect::val_str");
> > if (!exec() && !value->null_value)
> > {
>
> JL: The bug was that this code assumes that value->null_value will not
> change when value->val_* is called. As this bug shows, this is an
> incorrect assumption. I think that it's unsafe to assume anything about
> val->null_value before calling val_ in all Item_singlerow_subselect::val_*
> functions.
I think this is generally true for all Items. One cannot rely on
null_value being set until a val_xxx method has been called.
Good catch, Jørgen.
--
Øystein
> This is only a theory and remains to be tested. I send this
> concern without investigating thoroughly because we are in a hurry with
> this patch:)