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.
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 ?
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring