• Sergey Petrunya's avatar
    BUG#779885: Crash in eliminate_item_equal with materialization=on in maria-5.3 · 30575353
    Sergey Petrunya authored
    - In eliminate_item_equal(), we could end up in a situation where:
      = The multiple equality has a constant C1 (and so it is the "head item")
      = The join order was such that we've generated "sj_inner_table1=C1" equality,
        and now are looking to generate "sj_inner_table2_=..." equality. 
      When looking for what should be the other member of equality, we run
    
          Item *head_item= current_sjm? current_sjm_head: head;
      
      which sees current_sjm!=NULL, and takes current_sjm_head (which is NULL because 
      the constant C1 is the head for all cases).
    
    - Fixed in a trivial way: take current_sjm_head if we don't have constant.
    30575353
subselect_no_opts.result 175 KB