summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-03-17 14:26:26 +0200
committerbell@sanja.is.com.ua <>2004-03-17 14:26:26 +0200
commit8035ce40eca47844ecda29d48e84639f9c9334d9 (patch)
tree879e13469f1915539666e702fc32401e7f3a61d2 /sql/item_subselect.cc
parentb8c065c527846fdeb0122e26d3fc20731e28ca4f (diff)
downloadmariadb-git-8035ce40eca47844ecda29d48e84639f9c9334d9.tar.gz
DBUG_ASSERT(fixed == 0) added to fix_fields()
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index deb1ebabef9..90070e21953 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -102,6 +102,7 @@ Item_subselect::select_transformer(JOIN *join)
bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
engine->set_thd((thd= thd_param));
stmt= thd->current_statement;
@@ -125,8 +126,10 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
engine->exclude();
substitution= 0;
fixed= 1;
- thd->where= "checking transformed subquery";
- int ret= (*ref)->fix_fields(thd, tables, ref);
+ thd->where= "checking transformed subquery";
+ int ret= 0;
+ if (!(*ref)->fixed)
+ ret= (*ref)->fix_fields(thd, tables, ref);
// We can't substitute aggregate functions (like (SELECT (max(i)))
if ((*ref)->with_sum_func)
{
@@ -651,9 +654,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
select_lex->item_list.empty();
select_lex->item_list.push_back(item);
- if (item->fix_fields(thd, join->tables_list,
- select_lex->item_list.head_ref()))
- goto err;
+ // fix_fields call for 'item' will be made during new subquery fix_fields
subs= new Item_singlerow_subselect(select_lex);
}