Study (and fix) the interplay between window functions and other SQL constructs, like ORDER BY ... LIMIT, DISTINCT, etc.
- LIMIT should be applied AFTER the window functions are computed (that is, window function computation should see rows that are cut off by LIMIT)
- DISTINCT must not be converted into GROUP BY when window functions are present
- need to check window functions inside derived table and/or union. Item_window_func::update_field() is not implemented, is this ok?