diff options
Diffstat (limited to 'sql/sql_window.h')
-rw-r--r-- | sql/sql_window.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/sql_window.h b/sql/sql_window.h index 5e76a33dcd0..66ea8c7dd4d 100644 --- a/sql/sql_window.h +++ b/sql/sql_window.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, 2017 MariaDB + Copyright (c) 2016, 2022 MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -120,10 +120,15 @@ class Window_spec : public Sql_alloc Window_spec *referenced_win_spec; - Window_spec(LEX_CSTRING *win_ref, - SQL_I_List<ORDER> *part_list, - SQL_I_List<ORDER> *ord_list, - Window_frame *win_frame) + /* + Window_spec objects are numbered by the number of their appearance in the + query. This is used by compare_order_elements() to provide a predictable + ordering of PARTITION/ORDER BY clauses. + */ + int win_spec_number; + + Window_spec(LEX_CSTRING *win_ref, SQL_I_List<ORDER> *part_list, + SQL_I_List<ORDER> *ord_list, Window_frame *win_frame) : window_names_are_checked(false), window_ref(win_ref), partition_list(part_list), save_partition_list(NULL), order_list(ord_list), save_order_list(NULL), |