1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Added item.real_type() for easy access to the underlaying types for Item_ref and Item_cache_wrapper()

This allows us to simplify and speed up some tests and also remove get_cached_item()

sql/item.h:
  Added item.real_type()
  Removed get_cached_item()
sql/opt_range.cc:
  Simplify test
sql/sql_select.cc:
  Simplify test
sql/sql_show.cc:
  Simplify test
This commit is contained in:
Michael Widenius
2011-03-09 17:55:00 +02:00
parent 139a2b64bf
commit 2f9579151b
4 changed files with 13 additions and 15 deletions

View File

@ -3003,10 +3003,7 @@ bool uses_only_table_name_fields(Item *item, TABLE_LIST *table)
else if (item->type() == Item::REF_ITEM)
return uses_only_table_name_fields(item->real_item(), table);
if ((item->type() == Item::SUBSELECT_ITEM ||
(item->get_cached_item() &&
item->get_cached_item()->type() == Item::SUBSELECT_ITEM))
&& !item->const_item())
if (item->real_type() == Item::SUBSELECT_ITEM && !item->const_item())
return 0;
return 1;