mirror of
https://github.com/MariaDB/server.git
synced 2026-04-22 16:25:30 +02:00
MDEV-18383: Missing rows with pushdown condition defined with IF-function
using Item_cond This bug is similar to the bug MDEV-16765. It appears because of the wrong pushdown into HAVING clause while this pushdown shouldn't be made at all. This happens because function that checks if Item_cond can be pushed always returns that it can be pushed. To fix it new method Item_cond::excl_dep_on_table() was added.
This commit is contained in:
parent
57dd892ce8
commit
2faefe5f7f
4 changed files with 61 additions and 0 deletions
|
|
@ -4994,6 +4994,23 @@ Item *Item_cond::build_clone(THD *thd, MEM_ROOT *mem_root)
|
|||
}
|
||||
|
||||
|
||||
bool Item_cond::excl_dep_on_table(table_map tab_map)
|
||||
{
|
||||
if (used_tables() & OUTER_REF_TABLE_BIT)
|
||||
return false;
|
||||
if (!(used_tables() & ~tab_map))
|
||||
return true;
|
||||
List_iterator_fast<Item> li(list);
|
||||
Item *item;
|
||||
while ((item= li++))
|
||||
{
|
||||
if (!item->excl_dep_on_table(tab_map))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Item_cond::excl_dep_on_grouping_fields(st_select_lex *sel)
|
||||
{
|
||||
List_iterator_fast<Item> li(list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue