• Dmitry Shulga's avatar
    MDEV-31296: Crash in Item_func::fix_fields when prepared statement with... · 47f2b16a
    Dmitry Shulga authored
    MDEV-31296: Crash in Item_func::fix_fields when prepared statement with subqueries and window function is executed with sql_mode = ONLY_FULL_GROUP_BY
    
    Crash was caused by referencing a null pointer on getting
    the number of the nesting levels of the set function for the current
    select_lex at the method Item_field::fix_fields.
    
    The current select for processing is taken from Name_resolution_context
    that filled in at the function set_new_item_local_context() and
    where initialization of the data member Name_resolution_context
    was mistakenly removed by the commit
      d6ee351b
       (Revert "MDEV-24454 Crash at change_item_tree")
    
    To fix the issue, correct initialization of data member
      Name_resolution_context::select_lex
    that was removed by the commit d6ee351b
    is restored.
    47f2b16a
win.result 96.4 KB