• unknown's avatar
    Fixed bug #28598. · ebedff77
    unknown authored
    mysqld crashed when a long-running explain query was killed from
    another connection.
    
    When the current thread caught a kill signal executing the function
    best_extension_by_limited_search it just silently returned to  
    the calling function greedy_search without initializing elements of
    the join->best_positions array.
    However, the greedy_search function ignored thd->killed status
    after a calls to the best_extension_by_limited_search function, and
    after several calls the greedy_search function used an uninitialized
    data from the join->best_positions[idx] to search position in the
    join->best_ref array. 
    That search failed, and greedy_search tried to call swap_variables
    function with NULL argument - that caused a crash.
    
    
    sql/sql_select.cc:
      Fixed bug #28598.
      choose_plan(), greedy_search(), best_extension_by_limited_search()
      and find_best() functions have been changed to return TRUE in case
      of fatal error.
    mysql-test/t/kill.test:
      Updated test case for bug #28598.
    mysql-test/r/kill.result:
      Updated test case for bug #28598.
    ebedff77
sql_select.cc 488 KB