• Sergey Petrunya's avatar
    BUG#860553: Crash in create_ref_for_key with semijoin + materialization · f5987a0c
    Sergey Petrunya authored
    - The problem was that JOIN::save/restore_query_plan() did not save/restore parts of 
      the query plan that are located inside SJ_MATERIALIZATION_INFO structures. This could
      cause parts of one plan to be used with another, which led get_best_combination() to
      constructing non-sensical join plans (and crash).
      Fixed by saving/restoring SJM parts of the query plans.
    
    - check_and_do_in_subquery_rewrites() will not set SUBS_MATERIALIZATION flag when it 
      records that the subquery predicate is to be converted into semi-join. 
      If convert_join_subqueries_to_semijoins() later decides not to convert to semi-join,
      let it set SUBS_MATERIALIZATION flag, if appropriate.
    f5987a0c
sql_select.h 50.5 KB