• tnurnberg@mysql.com/white.intern.koehntopp.de's avatar
    Bug#31990: MINUTE() and SECOND() return bogus results when used on a DATE · 3f0f2750
    HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast.
    This happened because DATE-cast object did not overload get_time() method
    in superclass Item. The default method was inappropriate here and
    misinterpreted the data.
    
    Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL
    on NULL input, 0 otherwise. This coincides with the way DATE-columns
    behave.
    
    Also fixes similar bug in Date-Field now.
    3f0f2750
cast.test 8.02 KB