From 76001900fd1a13a4dba02472cbbda0f04214db34 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2004 13:09:27 +0300 Subject: thd pointer fixed BitKeeper/etc/ignore: Added libmysqld/sql_trigger.cc to the ignore list mysql-test/r/merge.result: fix of test --- sql/item_subselect.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'sql/item_subselect.cc') diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 9cd01255d43..25bb2701101 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -272,7 +272,8 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex) DBUG_VOID_RETURN; } -Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, +Item_maxmin_subselect::Item_maxmin_subselect(THD *thd_param, + Item_subselect *parent, st_select_lex *select_lex, bool max_arg) :Item_singlerow_subselect() @@ -291,6 +292,12 @@ Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, used_tables_cache= parent->get_used_tables_cache(); const_item_cache= parent->get_const_item_cache(); + /* + this subquery alwais creates during preparation, so we can assign + thd here + */ + thd= thd_param; + DBUG_VOID_RETURN; } @@ -316,6 +323,8 @@ Item_singlerow_subselect::select_transformer(JOIN *join) SELECT_LEX *select_lex= join->select_lex; /* Juggle with current arena only if we're in prepared statement prepare */ + DBUG_PRINT("TANSF:", ("thd %p, select_lex->join->thd: %s", + thd, select_lex->join->thd)); Item_arena *arena= thd->current_arena; Item_arena backup; if (arena->is_conventional()) @@ -723,7 +732,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, // remove LIMIT placed by ALL/ANY subquery select_lex->master_unit()->global_parameters->select_limit= HA_POS_ERROR; - subs= new Item_maxmin_subselect(this, select_lex, func->l_op()); + subs= new Item_maxmin_subselect(thd, this, select_lex, func->l_op()); } // left expression belong to outer select SELECT_LEX *current= thd->lex->current_select, *up; @@ -899,7 +908,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) } thd->where= "row IN/ALL/ANY subquery"; - Item_arena *arena= join->thd->current_arena, backup; + Item_arena *arena= thd->current_arena, backup; if (arena->is_conventional()) arena= 0; else -- cgit v1.2.1