1
0
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:
Igor Babaev
2013-08-26 15:51:47 -07:00
parent 901737c978
commit 650d3266bb
4 changed files with 60 additions and 1 deletions

View File

@@ -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;
}
}