• Igor Babaev's avatar
    MDEV-15902 Assertion `n < m_size' failed, sql_array.h:64: · 615ad709
    Igor Babaev authored
    Element_type& Bounds_checked_array<Element_type>::operator[]
    (size_t) [with Element_type = Item*; size_t = long unsigned int]
    
    In sql_yacc.yy the semantic actions for the MEDIAN window function
    lacked a call of st_select_lex::prepare_add_window_spec().
    This function saves the head of the thd->lex->order_list into
    lex->save_order_list in order this head to be restored in
    st_select_lex::add_window_spec after the specification of the
    window function has been parsed.
    Without a call of prepare_add_window_spec() when add_window_spec()
    was called the head of an empty list was copied into
    thd->lex->order_list (instead of assumed saved head this list).
    This made the list thd->lex->order_list invalid and potentially
    could cause many different problems.
    
    Corrected the result set in the test case for MDEV-15899 that
    used the MEDIAN window function and could not be correct
    without this fix.
    615ad709
win_percentile.result 14.9 KB