• unknown's avatar
    Fix for bug #33389: Selecting from a view into a table from within SP · d5092fa9
    unknown authored
                        or trigger crashes server
    
    Under some circumstances a combination of VIEWs, subselects with outer
    references and PS/SP/triggers could lead to use of uninitialized memory
    and server crash as a result.
    
    Fixed by changing the code in Item_field::fix_fields() so that in cases
    when the field is a VIEW reference, we first check whether the field
    is also an outer reference, and mark it appropriately before returning.
    
    
    mysql-test/r/view.result:
      Added a test case for bug #33389.
    mysql-test/t/view.test:
      Added a test case for bug #33389.
    sql/item.cc:
      In cases when in Item_field::fix_fields() from_field is a view reference,
      do not return too early, i.e. before marking the reference as an outer
      one when needed.
    d5092fa9
view.result 106 KB