• Sergei Petrunia's avatar
    MDEV-28201: Server crashes upon SHOW ANALYZE/EXPLAIN FORMAT=JSON · 3f68c216
    Sergei Petrunia authored
    - Describe the lifetime of EXPLAIN data structures in
      sql_explain.h:ExplainDataStructureLifetime.
    
    - Make Item_field::set_field() call set_refers_to_temp_table()
      when it refers to a temp. table.
    - Introduce QT_DONT_ACCESS_TMP_TABLES flag for Item::print.
      It directs Item_field::print to not try access its the
      temp table.
    - Introduce Explain_query::notify_tables_are_closed()
      and call it right before the query closes its tables.
    - Make Explain data stuctures' print_explain_json() methods
      accept "no_tmp_tbl" parameter which means pass
      QT_DONT_ACCESS_TMP_TABLES when printing items.
    - Make Show_explain_request::call_in_target_thread() not call
      set_current_thd(). This wasn't needed as the code inside
      lex->print_explain() uses output->thd anyway. output->thd
      refers to the SHOW command's THD object.
    3f68c216
show_explain.test 37.2 KB