• evgen@moonbone.local's avatar
    Bug#28133: Wrong DATE/DATETIME comparison in IN() function. · 7d473a1a
    evgen@moonbone.local authored
    The IN function was comparing DATE/DATETIME values either as ints or as
    strings. Both methods have their disadvantages and may lead to a wrong
    result.
    
    Now IN function checks whether all of its arguments has the STRING result
    types and at least one of them is a DATE/DATETIME item. If so it uses either
    an object of the in_datetime class or an object of the cmp_item_datetime
    class to perform its work. If the IN() function arguments are rows then
    row columns are checked whether the DATE/DATETIME comparator should be used
    to compare them.
    The in_datetime class is used to find occurence of the item to be checked
    in the vector of the constant DATE/DATETIME values. The cmp_item_datetime
    class is used to compare items one by one in the DATE/DATETIME context.
    Both classes obtain values from items with help of the get_datetime_value()
    function and cache the left item if it is a constant one.
    7d473a1a
item_cmpfunc.cc 120 KB