diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2010-01-28 16:48:33 +0300 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2010-01-28 16:48:33 +0300 |
commit | f47b2d38f6c4851ef6bd069f5d1ffe033056d582 (patch) | |
tree | 84f3ebd6121f993eb30656da64790920566c5c46 /sql/item_buff.cc | |
parent | 742afd8eaeccb3531fa350b31445e8397dab7848 (diff) | |
download | mariadb-git-f47b2d38f6c4851ef6bd069f5d1ffe033056d582.tar.gz |
Subquery optimizations: non-semijoin materialization
- Backport into Maria DB 5.3, part 1
Diffstat (limited to 'sql/item_buff.cc')
-rw-r--r-- | sql/item_buff.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 2f45d0a17c2..037a988ebbc 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -27,11 +27,16 @@ Create right type of Cached_item for an item. */ -Cached_item *new_Cached_item(THD *thd, Item *item) +Cached_item *new_Cached_item(THD *thd, Item *item, bool use_result_field) { if (item->real_item()->type() == Item::FIELD_ITEM && !(((Item_field *) (item->real_item()))->field->flags & BLOB_FLAG)) - return new Cached_item_field((Item_field *) (item->real_item())); + { + Item_field *real_item= (Item_field *) item->real_item(); + Field *cached_field= use_result_field ? real_item->result_field : + real_item->field; + return new Cached_item_field(cached_field); + } switch (item->result_type()) { case STRING_RESULT: return new Cached_item_str(thd, (Item_field *) item); |