• Evgeny Potemkin's avatar
    Bug#59330: Incorrect result when comparing an aggregate function with · 5c56bce3
    Evgeny Potemkin authored
    TIMESTAMP.
    
    Item_cache::get_cache wasn't treating TIMESTAMP as a DATETIME value thus
    returning string cache for items with TIMESTAMP type. This led to incorrect
    TIMESTAMP -> INT conversion and to a wrong query result.
    
    Fixed by using Item::is_datetime function to check for DATETIME type group.
    
    
    mysql-test/r/type_timestamp.result:
      Added a test case for the bug#59330.
    mysql-test/t/type_timestamp.test:
      Added a test case for the bug#59330.
    sql/item.cc:
      Bug#59330: Incorrect result when comparing an aggregate function with
      TIMESTAMP.
      Item_cache::get_cache now uses is_datetime member function to detect DATETIME
      type group.
    5c56bce3
item.cc 226 KB