• Sergey Glukhov's avatar
    Bug#54484 explain + prepared statement: crash and Got error -1 from storage engine · 127c721c
    Sergey Glukhov authored
    Subquery executes twice, at top level JOIN::optimize and ::execute stages.
    At first execution create_sort_index() function is called and
    FT_SELECT object is created and destroyed. HANDLER::ft_handler is cleaned up
    in the object destructor and at second execution FT_SELECT::get_next() method
    returns error.
    The fix is to reinit HANDLER::ft_handler field before re-execution of subquery.
    
    
    mysql-test/r/fulltext.result:
      test case
    mysql-test/t/fulltext.test:
      test case
    sql/item_func.cc:
      reinit ft_handler before re-execution of subquery
    sql/item_func.h:
      Fixed method name
    sql/sql_select.cc:
      reinit ft_handler before re-execution of subquery
    127c721c
item_func.h 48.4 KB