mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge 10.3 into 10.4
This commit is contained in:
@ -1701,8 +1701,7 @@ JOIN::optimize_inner()
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
if (thd->lex->sql_command == SQLCOM_SELECT &&
|
||||
optimizer_flag(thd, OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY))
|
||||
if (optimizer_flag(thd, OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY))
|
||||
{
|
||||
TABLE_LIST *tbl;
|
||||
List_iterator_fast<TABLE_LIST> li(select_lex->leaf_tables);
|
||||
@ -1727,8 +1726,7 @@ JOIN::optimize_inner()
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
if (thd->lex->sql_command == SQLCOM_SELECT &&
|
||||
optimizer_flag(thd, OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED))
|
||||
if (optimizer_flag(thd, OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED))
|
||||
{
|
||||
TABLE_LIST *tbl;
|
||||
List_iterator_fast<TABLE_LIST> li(select_lex->leaf_tables);
|
||||
@ -1925,6 +1923,14 @@ JOIN::optimize_inner()
|
||||
error= 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (!group_list)
|
||||
{
|
||||
/* The output has only one row */
|
||||
order=0;
|
||||
simple_order=1;
|
||||
group_optimized_away= 1;
|
||||
select_distinct=0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate how to do the join */
|
||||
@ -3811,7 +3817,7 @@ bool JOIN::save_explain_data(Explain_query *output, bool can_overwrite,
|
||||
If there is SELECT in this statement with the same number it must be the
|
||||
same SELECT
|
||||
*/
|
||||
DBUG_ASSERT(select_lex->select_number == UINT_MAX ||
|
||||
DBUG_SLOW_ASSERT(select_lex->select_number == UINT_MAX ||
|
||||
select_lex->select_number == INT_MAX ||
|
||||
!output ||
|
||||
!output->get_select(select_lex->select_number) ||
|
||||
@ -6577,7 +6583,7 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab)
|
||||
Item_field *cur_item;
|
||||
key_map possible_keys(0);
|
||||
|
||||
if (join->group_list || join->simple_group)
|
||||
if (join->group_list)
|
||||
{ /* Collect all query fields referenced in the GROUP clause. */
|
||||
for (cur_group= join->group_list; cur_group; cur_group= cur_group->next)
|
||||
(*cur_group->item)->walk(&Item::collect_item_field_processor, 0,
|
||||
|
Reference in New Issue
Block a user