• Varun Gupta's avatar
    MDEV-15837: Assertion `item1->type() == Item::FIELD_ITEM && item2->type() == Item::FIELD_ITEM' · 1f1a61cf
    Varun Gupta authored
                failed in compare_order_elements function
    
    The issue here is the function compare_order_lists() is called for the order by list of the window functions
    so that those window function that can be computed together are adjacent.
    So in the function compare_order_list we iterate over all the elements in the order list of the two functions and
    compare the items in their order by clause.
    The function compare_order_elements() is called for each item in the
    order by clause. This function assumes that all the items that are in the order by list would be of the type
    Item::FIELD_ITEM.
    
    The case we have is that we have constants in the order by clause. We should ignore the constant and only compare
    items of the type Item::FIELD_ITEM in compare_order_elements()
    1f1a61cf
win.result 73.8 KB