• Mithun C Y's avatar
    Bug #19892803: ASSERTION FAILED: N < M_SIZE WITH DISTINCT TIME · c9f7948b
    Mithun C Y authored
    ISSUE:
    ------
    We pre-allocate the ref_pointer_array before we resolve outer
    references. This means that in some cases the
    ref_pointer_array may not be large enough to hold all
    references created. One such case is aggregate functions in
    having clause of a subquery which may add items to select list
    of outer query. So it is necessary to consider
    select_n_having_items for subqueries while allocating
    ref_pointer_array else we will get buffer overflow.
    
    SOLUTION:
    ---------
    Allocate a larger ref_pointer_array by aggregating
    select_n_having_items for subqueries.
    The fix in sql_yacc.yy is a backport from bug fix 18782905.
    c9f7948b
sql_yacc.yy 438 KB