Hi Sergey,
Sergei Golubchik wrote:
> Hi, Evgeny!
>
> On Oct 16, Evgeny Potemkin wrote:
>> #At file:///work/bzrroot/43668-bug-5.1-bugteam/ based on
> revid:satya.bn@stripped
>>
>> 3165 Evgeny Potemkin 2009-10-16
>> Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
>
> Hm. There are many Items that needs to do comparisons. If we want to use
> Arg_comparator consistently everywhere - I mean, if it's the long-term
> goal - then your approach doesn't hold.
>
> Better would be to keep the 'owner' non-NULL, but change it from
> Item_bool_func2* to Item_func*. It'll allow to use owner->functype(),
> and owner->func_name() as before. You will still need to move
> tmp_value1/tmp_value2 inside the Arg_comparator, just as you did in your
> patch (but you forgot to remove them from Item_bool_func2).
>
> As for adjusting owner->null_value - you can remove this code completely
> and move it to Item_bool_func2::fix_fields (or fix_length_and_dec), as
> every other item sets its nullability in fix_fields.
The owner->null_value isn't set once, but after each comparison based on whether
items being compared NULL or not. But I can add a flag which will control
setting of the owner->null_value depending on the owner->functype().
>
> With these changes you can not only start using Arg_comparator in
> MIN/MAX, but later it could be also used in IN, CASE, FIELD, and so on.
>
> What do you think ?
I general I agree, will fix & re-commit.
>
> Regards / Mit vielen Grüßen,
> Sergei
>
Regards, Evgen.