1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug mdev-5635.

After constant row substitution some field items become constant items.
The range analyzer should take into account this fact when looking for
ranges.
This commit is contained in:
Igor Babaev
2014-02-27 13:54:05 -08:00
parent 472bc477f6
commit 1a536c8daf
3 changed files with 30 additions and 2 deletions

View File

@ -7941,7 +7941,8 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
value= cond_func->arg_count > 1 ? cond_func->arguments()[1] : NULL;
if (value && value->is_expensive())
DBUG_RETURN(0);
ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
if (!cond_func->arguments()[0]->real_item()->const_item())
ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
}
/*
Even if get_full_func_mm_tree() was executed above and did not
@ -7966,7 +7967,8 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
value= cond_func->arguments()[0];
if (value && value->is_expensive())
DBUG_RETURN(0);
ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
if (!cond_func->arguments()[1]->real_item()->const_item())
ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
}
}