| 13919 | |
| 13920 | |
| 13921 | void st_select_lex::optimize_out_order_list() |
| 13922 | { |
| 13923 | /* Cleanup first related window funcs */ |
| 13924 | for (ORDER *ord= order_list.first; ord; ord= ord->next) |
| 13925 | { |
| 13926 | if (ord->window_funcs.is_empty()) |
| 13927 | continue; |
| 13928 | |
| 13929 | List_iterator<Item_window_func> it_sl(window_funcs); |
| 13930 | List_iterator<Item_window_func> it_ord(ord->window_funcs); |
| 13931 | Item_window_func *wf_sl, *wf_ord; |
| 13932 | while ((wf_sl= it_sl++)) |
| 13933 | { |
| 13934 | it_ord.rewind(); |
| 13935 | while ((wf_ord= it_ord++)) |
| 13936 | { |
| 13937 | if (wf_ord == wf_sl) |
| 13938 | { |
| 13939 | it_sl.remove(); |
| 13940 | it_ord.remove(); |
| 13941 | break; |
| 13942 | } |
| 13943 | } |
| 13944 | if (ord->window_funcs.is_empty()) |
| 13945 | break; |
| 13946 | } |
| 13947 | } |
| 13948 | order_list.empty(); |
| 13949 | } |
| 13950 | |
| 13951 | |
| 13952 | /* |