summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-11-23 22:58:53 +0200
committermonty@mysql.com <>2005-11-23 22:58:53 +0200
commit4575a662cb99b63ec4c790ed00ac6ec09deb7cc3 (patch)
tree8972ae3c8dffff8f3b6f27565d191af346c9ac8d /sql/item_subselect.cc
parent30b360bfccdf9471efb444df0514693f0fb94444 (diff)
parente42c98096746bc675e0c6d6b45776937d7cfb05b (diff)
downloadmariadb-git-4575a662cb99b63ec4c790ed00ac6ec09deb7cc3.tar.gz
Merge mysql.com:/home/my/mysql-5.1
into mysql.com:/home/my/mysql-5.1-TDC
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 8c4bc996100..3f87af4038d 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -133,6 +133,7 @@ Item_subselect::select_transformer(JOIN *join)
bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
{
char const *save_where= thd_param->where;
+ uint8 uncacheable;
bool res;
DBUG_ASSERT(fixed == 0);
@@ -178,15 +179,17 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
fix_length_and_dec();
}
else
- return 1;
- uint8 uncacheable= engine->uncacheable();
- if (uncacheable)
+ goto err;
+
+ if ((uncacheable= engine->uncacheable()))
{
const_item_cache= 0;
if (uncacheable & UNCACHEABLE_RAND)
used_tables_cache|= RAND_TABLE_BIT;
}
fixed= 1;
+
+err:
thd->where= save_where;
return res;
}
@@ -1797,7 +1800,7 @@ void subselect_uniquesubquery_engine::print(String *str)
str->append(STRING_WITH_LEN("<primary_index_lookup>("));
tab->ref.items[0]->print(str);
str->append(STRING_WITH_LEN(" in "));
- str->append(tab->table->s->table_name);
+ str->append(tab->table->s->table_name.str, tab->table->s->table_name.length);
KEY *key_info= tab->table->key_info+ tab->ref.key;
str->append(STRING_WITH_LEN(" on "));
str->append(key_info->name);
@@ -1815,7 +1818,7 @@ void subselect_indexsubquery_engine::print(String *str)
str->append(STRING_WITH_LEN("<index_lookup>("));
tab->ref.items[0]->print(str);
str->append(STRING_WITH_LEN(" in "));
- str->append(tab->table->s->table_name);
+ str->append(tab->table->s->table_name.str, tab->table->s->table_name.length);
KEY *key_info= tab->table->key_info+ tab->ref.key;
str->append(STRING_WITH_LEN(" on "));
str->append(key_info->name);