mirror of
https://github.com/MariaDB/server.git
synced 2026-04-27 02:35:29 +02:00
MDEV-16765: Missing rows with pushdown condition defined with CASE using Item_cond
The bug appears because of the wrong pushdown into the WHERE clause of the materialized derived table/view work. For the excl_dep_on_grouping_fields() method that checks if the condition can be pushed into the WHERE clause the case when Item_cond is used is missing. For Item_cond elements this method always returns positive result (that condition can be pushed). So this condition is pushed even if is shouldn't be pushed. To fix it new Item_cond::excl_dep_on_grouping_fields() method is added.
This commit is contained in:
parent
862a97749d
commit
0de3c423cc
4 changed files with 275 additions and 0 deletions
|
|
@ -4970,6 +4970,19 @@ Item *Item_cond::build_clone(THD *thd, MEM_ROOT *mem_root)
|
|||
}
|
||||
|
||||
|
||||
bool Item_cond::excl_dep_on_grouping_fields(st_select_lex *sel)
|
||||
{
|
||||
List_iterator_fast<Item> li(list);
|
||||
Item *item;
|
||||
while ((item= li++))
|
||||
{
|
||||
if (!item->excl_dep_on_grouping_fields(sel))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Item_cond_and::mark_as_condition_AND_part(TABLE_LIST *embedding)
|
||||
{
|
||||
List_iterator<Item> li(list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue