• Sergey Petrunya's avatar
    BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared... · 27cd8d7b
    Sergey Petrunya authored
    BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared statement with semijoin
    - If convert_join_subqueries_to_semijoins() decides to wrap Item_in_subselect in Item_in_optimizer, 
      it should do so in prep_on_expr/prep_where, too, as long as they are present.
      There seems to be two possibilities of how we arrive in this function:
      - prep_on_expr/prep_where==NULL, and will be set later by simplify_joins()
      - prep_on_expr/prep_where!=NULL, and it is a copy_and_or_structure()-made copy of on_expr/where.
      the latter can happen for some (but not all!) nested joins. This bug was that we didn't handle this case.
    27cd8d7b
subselect_sj_jcl6.result 71.3 KB