mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed bug mdev-4952
When in function remove_eq_conds() a sub-formula of the processed condition is replaced for another formula we should ensure that in the resulting formula AND/OR levels must alternate.
This commit is contained in:
@@ -13407,7 +13407,20 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
|
||||
}
|
||||
else
|
||||
{
|
||||
li.replace(new_item);
|
||||
if (new_item->type() == Item::COND_ITEM &&
|
||||
((Item_cond*) new_item)->functype() ==
|
||||
((Item_cond*) cond)->functype())
|
||||
{
|
||||
List<Item> *new_item_arg_list=
|
||||
((Item_cond *) new_item)->argument_list();
|
||||
uint cnt= new_item_arg_list->elements;
|
||||
li.replace(*new_item_arg_list);
|
||||
/* Make iterator li ignore new items */
|
||||
for (cnt--; cnt; cnt--)
|
||||
li++;
|
||||
}
|
||||
else
|
||||
li.replace(new_item);
|
||||
should_fix_fields= 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user