mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed the bug mdev-13710.
This patch corrects the code of the patch for mdev-13369 that introduced the splitting technique when using materialized derived tables / views with GROUP BY. The second actual parameters of the call of the method JOIN::reoptimize() in the function JOIN::push_splitting_cond_into_derived() was calculated incorrectly. This could cause different failures for queries using derived tables or views with GROUP BY when their FROM lists contained empty or single-row tables.
This commit is contained in:
@ -9073,12 +9073,10 @@ bool JOIN::push_splitting_cond_into_derived(THD *thd, Item *cond)
|
||||
{
|
||||
enum_reopt_result reopt_result= REOPT_NONE;
|
||||
table_map all_table_map= 0;
|
||||
for (JOIN_TAB *tab= join_tab + const_tables;
|
||||
for (JOIN_TAB *tab= join_tab;
|
||||
tab < join_tab + top_join_tab_count; tab++)
|
||||
{
|
||||
all_table_map|= tab->table->map;
|
||||
}
|
||||
reopt_result= reoptimize(cond, all_table_map, NULL);
|
||||
reopt_result= reoptimize(cond, all_table_map & ~const_table_map, NULL);
|
||||
if (reopt_result == REOPT_ERROR)
|
||||
return true;
|
||||
if (inject_cond_into_where(cond))
|
||||
|
Reference in New Issue
Block a user