• Martin Hansson's avatar
    Bug#47925: regression of range optimizer and date comparison in 5.1.39! · f539e0c8
    Martin Hansson authored
    When a query was using a DATE or DATETIME value formatted
    using any other separator characters beside hyphen '-', a
    query with a greater-or-equal '>=' condition matching only
    the greatest value in an indexed column, the result was
    empty if index range scan was employed.
    
    The range optimizer got a new feature between 5.1.38 and
    5.1.39 that changes a greater-or-equal condition to a
    greater-than if the value matching that in the query was not
    present in the table. But the value comparison function
    compared the dates as strings instead of dates.
    
    The bug was fixed by splitting the function
    get_date_from_str in two: One part that parses and does
    error checking. This function is now visible outside the
    module. The old get_date_from_str now calls the new
    function.
    f539e0c8
item.cc 208 KB