• Evgeny Potemkin's avatar
    Bug#57095: Wrongly chosen expression cache type led to a wrong result. · 731dcfc7
    Evgeny Potemkin authored
    The coalesce function returned DATETIME type due to a DATETIME argument, but
    since it's not a date/time function it can't return correct int value for
    it. Nevertheless Item_datetime_cache was chosen to cache coalesce's result
    and that led to a wrong result.
    
    Now Item_datetime_cache is used only for those function that could return
    correct int representation of DATETIME values.
    
    
    mysql-test/r/type_datetime.result:
      Added a test case for the bug#57095.
    mysql-test/t/type_datetime.test:
      Added a test case for the bug#57095.
    sql/item.cc:
      Bug#57095: Wrongly chosen expression cache type led to a wrong result.
      Now Item_datetime_cache is used only for those function that could return
      correct int representation of DATETIME values.
    731dcfc7
item.cc 225 KB