summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorgshchepa/uchum@gleb.loc <>2007-11-11 06:07:38 +0400
committergshchepa/uchum@gleb.loc <>2007-11-11 06:07:38 +0400
commitf457080109d0ae20b3a5db8067de7c61b1d6c959 (patch)
tree5ab8e236fdcd628ece92a5362dbe2c32fa6d48fb /sql/item_subselect.cc
parent0437a0506da1b82b89464f8b877552a9d10eee83 (diff)
parent8b21045f9be6148ebdd907eedd73bc4a66968b2e (diff)
downloadmariadb-git-f457080109d0ae20b3a5db8067de7c61b1d6c959.tar.gz
Merge gleb.loc:/home/uchum/5.0-opt
into gleb.loc:/home/uchum/5.1-opt
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 843c6ced263..e8e64faf865 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1760,7 +1760,7 @@ void subselect_engine::set_row(List<Item> &item_list, Item_cache **row)
item->decimals= sel_item->decimals;
item->unsigned_flag= sel_item->unsigned_flag;
maybe_null= sel_item->maybe_null;
- if (!(row[i]= Item_cache::get_cache(res_type)))
+ if (!(row[i]= Item_cache::get_cache(sel_item)))
return;
row[i]->setup(sel_item);
}
@@ -2222,6 +2222,7 @@ int subselect_indexsubquery_engine::exec()
((Item_in_subselect *) item)->value= 0;
empty_result_set= TRUE;
null_keypart= 0;
+ table->status= 0;
if (check_null)
{
@@ -2234,6 +2235,16 @@ int subselect_indexsubquery_engine::exec()
if (copy_ref_key())
DBUG_RETURN(1);
+ if (table->status)
+ {
+ /*
+ We know that there will be no rows even if we scan.
+ Can be set in copy_ref_key.
+ */
+ ((Item_in_subselect *) item)->value= 0;
+ DBUG_RETURN(0);
+ }
+
if (null_keypart)
DBUG_RETURN(scan_table());