MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used

- Make Item_subselect::fix_fields() ignore UNCACHEABLE_EXPLAIN flag when deciding whether 
  the subquery item should be marked as constant.
This commit is contained in:
Sergey Petrunya 2012-07-25 20:41:48 +04:00
commit 55597a4869
12 changed files with 277 additions and 52 deletions

View file

@ -287,7 +287,7 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
else
goto end;
if ((uncacheable= engine->uncacheable()))
if ((uncacheable= engine->uncacheable() & ~UNCACHEABLE_EXPLAIN))
{
const_item_cache= 0;
if (uncacheable & UNCACHEABLE_RAND)