1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00

Bug #46607: Assertion failed: (cond_type == Item::FUNC_ITEM)

results in server crash 
 
check_group_min_max_predicates() assumed the input condition 
item to be one of COND_ITEM, SUBSELECT_ITEM, or FUNC_ITEM. 
Since a condition of the form "field" is also a valid condition 
equivalent to "field <> 0", using such a condition in a query 
where the loose index scan was chosen resulted in a debug 
assertion failure. 
 
Fixed by handling conditions of the FIELD_ITEM type in 
check_group_min_max_predicates().
This commit is contained in:
Alexey Kopytov
2009-08-30 11:03:37 +04:00
parent 502eb9843e
commit 62b95b90df
3 changed files with 38 additions and 1 deletions

View File

@ -9628,7 +9628,17 @@ check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item,
*/
if (cond_type == Item::SUBSELECT_ITEM)
DBUG_RETURN(FALSE);
/*
Condition of the form 'field' is equivalent to 'field <> 0' and thus
satisfies the SA3 condition.
*/
if (cond_type == Item::FIELD_ITEM)
{
DBUG_PRINT("info", ("Analyzing: %s", cond->full_name()));
DBUG_RETURN(TRUE);
}
/* We presume that at this point there are no other Items than functions. */
DBUG_ASSERT(cond_type == Item::FUNC_ITEM);