mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge remote-tracking branch 'origin/11.2' into 11.4
This commit is contained in:
@@ -2407,8 +2407,12 @@ JOIN::optimize_inner()
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (select_lex->with_rownum && ! order && ! group_list &&
|
||||
!select_distinct && conds && select_lex == unit->global_parameters())
|
||||
!select_distinct && conds && select_lex == unit->global_parameters() &&
|
||||
select_lex->first_rownum_optimization)
|
||||
{
|
||||
optimize_rownum(thd, unit, conds);
|
||||
select_lex->first_rownum_optimization= false;
|
||||
}
|
||||
|
||||
having= optimize_cond(this, having, join_list, TRUE,
|
||||
&having_value, &having_equal);
|
||||
@@ -3651,7 +3655,8 @@ bool JOIN::make_aggr_tables_info()
|
||||
{
|
||||
List<Item> *curr_all_fields= &all_fields;
|
||||
List<Item> *curr_fields_list= &fields_list;
|
||||
JOIN_TAB *curr_tab= join_tab + const_tables;
|
||||
// Avoid UB (applying .. offset to nullptr) when join_tab is nullptr
|
||||
JOIN_TAB *curr_tab= join_tab ? join_tab + const_tables : nullptr;
|
||||
TABLE *exec_tmp_table= NULL;
|
||||
bool distinct= false;
|
||||
const bool has_group_by= this->group;
|
||||
@@ -4212,9 +4217,9 @@ bool JOIN::make_aggr_tables_info()
|
||||
- duplicate value removal
|
||||
Both of these operations are done after window function computation step.
|
||||
*/
|
||||
curr_tab= join_tab + total_join_tab_cnt();
|
||||
if (select_lex->window_funcs.elements)
|
||||
{
|
||||
curr_tab= join_tab + total_join_tab_cnt();
|
||||
if (!(curr_tab->window_funcs_step= new Window_funcs_computation))
|
||||
DBUG_RETURN(true);
|
||||
if (curr_tab->window_funcs_step->setup(thd, &select_lex->window_funcs,
|
||||
|
Reference in New Issue
Block a user