• unknown's avatar
    Fixed bug #19490. The bug that caused server crash manifested · a12e597d
    unknown authored
    itself when executing queries referring to a view with GROUP BY
    an expression containing non-constant interval.
    It happened because Item_date_add_interval::eq neglected the
    fact that the method can be applied to an expression of the form
        date(col) + interval time_to_sec(col) second
    at the time when col could not be evaluated yet.
    An attempt to evaluate time_to_sec(col) in this method resulted
    in a crash.
    
    
    mysql-test/r/view.result:
      Added a test case for bug #19490.
    mysql-test/t/view.test:
      Added a test case for bug #19490.
    sql/item_timefunc.cc:
      Fixed bug #19490. The bug that caused server crash manifested
      itself when executing queries referring to a view with GROUP BY
      an expression containing non-constant interval.
      It happened because Item_date_add_interval::eq neglected the
      fact that the method can be applied to an expression of the form
          date(col) + interval time_to_sec(col) second
      at the time when col could not be evaluated yet.
      An attempt to evaluate time_to_sec(col) in this method resulted
      in a crash.
      The code of Item_date_add_interval::eq was corrected.
    a12e597d
item_timefunc.cc 81.9 KB