• Sergey Vojtovich's avatar
    BUG#11766720 - setting storage engine to null segfaults mysqld · 659ff293
    Sergey Vojtovich authored
    MONTHNAME(0) claims that it is about to return NOT NULL
    value, whereas it actually returns NULL.
    
    As a result storage_engine variable (which cannot be NULL)
    protection was bypassed and NULL value was accepted, causing
    server crash.
    
    Fixed MONTHNAME(0) to report valid NULL flag.
    
    mysql-test/r/func_time.result:
      A test case for BUG#11766720.
    mysql-test/t/func_time.test:
      A test case for BUG#11766720.
    sql/item_timefunc.cc:
      MONTHNAME(0) must report NULL, as opposed to base class
      MONTH(0) which is NOT NULL.
      
      Fixed Item_func_monthname to inherit from Item_str_func
      instead of Item_func_month.
    sql/item_timefunc.h:
      MONTHNAME(0) must report NULL, as opposed to base class
      MONTH(0) which is NOT NULL.
      
      Fixed Item_func_monthname to inherit from Item_str_func
      instead of Item_func_month.
    659ff293
func_time.test 36.3 KB