mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-15853: Assertion `tab->filesort_result == 0' failed
The issue here is that the window function execution is not called for the correct join tab, when we have GROUP BY where we create extra temporary tables then we need to call window function execution for the last join tab. For doing so the current code does not take into account the JOIN::aggr_tables. Fixed by introducing a new function JOIN::total_join_tab_cnt that takes in account the temporary tables also.
This commit is contained in:
@ -1503,6 +1503,15 @@ public:
|
||||
/* Number of tables actually joined at the top level */
|
||||
uint exec_join_tab_cnt() { return tables_list ? top_join_tab_count : 0; }
|
||||
|
||||
/*
|
||||
Number of tables in the join which also includes the temporary tables
|
||||
created for GROUP BY, DISTINCT , WINDOW FUNCTION etc.
|
||||
*/
|
||||
uint total_join_tab_cnt()
|
||||
{
|
||||
return exec_join_tab_cnt() + aggr_tables - 1;
|
||||
}
|
||||
|
||||
int prepare(TABLE_LIST *tables, uint wind_num,
|
||||
COND *conds, uint og_num, ORDER *order, bool skip_order_by,
|
||||
ORDER *group, Item *having, ORDER *proc_param, SELECT_LEX *select,
|
||||
|
Reference in New Issue
Block a user