mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-334: Backport of UNION ALL optimization from mysql-5.7.
Although the original code of mysql-5.7 was adjusted to the current MariaDB code the main ideas of the optimization were preserved.
This commit is contained in:
@ -788,7 +788,7 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived)
|
||||
if (!derived->is_merged_derived())
|
||||
{
|
||||
JOIN *join= first_select->join;
|
||||
unit->set_limit(unit->global_parameters);
|
||||
unit->set_limit(unit->global_parameters());
|
||||
unit->optimized= TRUE;
|
||||
if ((res= join->optimize()))
|
||||
goto err;
|
||||
@ -905,7 +905,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
|
||||
}
|
||||
else
|
||||
{
|
||||
unit->set_limit(unit->global_parameters);
|
||||
unit->set_limit(unit->global_parameters());
|
||||
if (unit->select_limit_cnt == HA_POS_ERROR)
|
||||
first_select->options&= ~OPTION_FOUND_ROWS;
|
||||
|
||||
|
Reference in New Issue
Block a user