1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Fixed LP bug #800518.

The function simple_pred did not take into account that a multiple equality
could include ref items (more exactly items of the class Item_direct_view_ref).
It caused crashes for queries over derived tables or views if the
min/max optimization could be applied to these queries.
This commit is contained in:
Igor Babaev
2011-06-23 14:48:45 -07:00
parent 1f6b32bc37
commit 3cf0d6f446
3 changed files with 39 additions and 4 deletions

View File

@@ -494,12 +494,14 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order)
/* MULT_EQUAL_FUNC */
{
Item_equal *item_equal= (Item_equal *) func_item;
Item_equal_fields_iterator it(*item_equal);
args[0]= it++;
if (it++)
return 0;
if (!(args[1]= item_equal->get_const()))
return 0;
Item_equal_fields_iterator it(*item_equal);
if (!(item= it++))
return 0;
args[0]= item->real_item();
if (it++)
return 0;
}
break;
case 1: