• unknown's avatar
    Fixed bug#15950: NOW() optimized away in VIEWs · 09255a2d
    unknown authored
    This bug is a side-effect of bug fix #16377. NOW() is optimized in
    BETWEEN to integer constants to speed up query execution. When view is being
    created it saves already modified query and thus becomes wrong.
    
    The agg_cmp_type() function now substitutes constant result DATE/TIME functions 
    for their results only if the current query isn't CREATE VIEW or SHOW CREATE
    VIEW.
    
    
    mysql-test/t/view.test:
      Added a test case for bug#15950: NOW() optimized away in VIEWs
    mysql-test/r/view.result:
      Added a test case for bug#15950: NOW() optimized away in VIEWs
    sql/item_cmpfunc.cc:
      Fixed bug#15950: NOW() optimized away in VIEWs
      The agg_cmp_type() function now substitutes constant result DATE/TIME functions 
      for their results only if the current query isn't CREATE VIEW or SHOW CREATE
      VIEW.
    09255a2d
view.test 70 KB