• Vicențiu Ciorbaru's avatar
    MDEV-25032: Window functions without column references get removed from ORDER BY · 5da6ffe2
    Vicențiu Ciorbaru authored
    row_number() over () window function can be used without any column in the OVER
    clause. Additionally, the item doesn't reference any tables, as it's not
    effectively referencing any table. Rather it is specifically built based
    on the end temporary table used for window function computation.
    
    This caused remove_const function to wrongly drop it from the ORDER
    list. Effectively, we shouldn't be dropping any window function from the
    ORDER clause, so adjust remove_const to account for that.
    
    Reviewed by: Sergei Petrunia sergey@mariadb.com
    5da6ffe2
win.test 61.3 KB