• Ramil Kalimullin's avatar
    Fix for bug #40757: Starting server on Windows with · 13b564e4
    Ramil Kalimullin authored
    innodb_flush_method=wrong_value causes crash
    
    Problem: after a failed plugin initialization, incompletely 
    initialized data remained in the plugin and handlerton data 
    structures. These were used later and caused the crash.
    
    Fix: clean-up plugin related data if initialization failed.
    
    Note: no test case added, hand tested.
    
    
    sql/handler.cc:
      Fix for bug #40757: Starting server on Windows with 
      innodb_flush_method=wrong_value causes crash
        - free allocated hton and set plugin->data 
          (pointing to handlerton) to NULL if plugin->init() fails,
          as we use it as a sign that ha_initialize_handlerton() is failed,
          which is used in ha_finalize_handlerton().
        - do the same if there's no free slot for a plugin in the
          hton2plugin[] array or there are too many storage engines.
        - call plugin->deinit() in such cases as we successfully
          called plugin->init() before.
    13b564e4
handler.cc 138 KB