summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-07-03 02:30:52 +0300
committerunknown <bell@sanja.is.com.ua>2003-07-03 02:30:52 +0300
commit69be8b9d64e0a4e3f3374fd2cb3124b7deaa25a3 (patch)
treebaf496555ea973850414a91a38ffbb81729b0bc6 /sql/item_subselect.cc
parent29898afbdd4fde10353695365eb4278ad4d005b7 (diff)
downloadmariadb-git-69be8b9d64e0a4e3f3374fd2cb3124b7deaa25a3.tar.gz
(SCRUM)
It looks like samll revolution in SELECT_LEX tree, but it was only natural way to solve problem with name resolution of external fields inside subselect which belongs to global order of union also it have following advantages: - removed mess with current_select type conversion - type checking/converting - a lot of virtual methods - fake select for union execution allocated only once (it was allocated for every subselect with union executing) changes: fixed bug with outer fields name resolution of subqueries which belong to global ORDER BY clause remuved select_lex() function, now thd->lex.current_select always have type SELECT_LEX new SELECT_LEX (fake_select_lex) will be allocated in case of UNION for using in UNION processing fake_select_lex allocated for union hold global ORDER BY & LIMIT clauses and have linkage equal to GLOBAL_OPTIONS_TYPE new description of SELECT_LEX tree (SCRUM) sql/item.cc: global parameters moved to fake_select_lex sql/item_subselect.cc: global parameters moved to fake_select_lex sql/item_sum.cc: no need type checking & converion now sql/sql_delete.cc: no need type checking & converion now sql/sql_derived.cc: global parameters moved to fake_select_lex sql/sql_lex.cc: not used fields/mrthods moved from st_select_lex_node to st_select_lex global parameters moved to fake_select_lex sql/sql_lex.h: comments about new tree of select_lex s not used fields/mrthods moved from st_select_lex_node to st_select_lex global parameters moved to fake_select_lex sql/sql_parse.cc: global parameters moved to fake_select_lex allocation of fake_select_lex on demand sql/sql_select.cc: now fake_select_lex marked as GLOBAL_OPTIONS_TYPE sql/sql_union.cc: global parameters moved to fake_select_lex sql/sql_yacc.yy: global parameters moved to fake_select_lex
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index f29ac3b3c9c..d295e5c8261 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -336,8 +336,8 @@ Item_exists_subselect::Item_exists_subselect(THD *thd,
bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit)
{
- if (unit->global_parameters == unit &&
- unit->global_parameters->test_limit())
+ if (unit->fake_select_lex &&
+ unit->fake_select_lex->test_limit())
return(1);
SELECT_LEX *sl= unit->first_select();
@@ -495,7 +495,8 @@ Item_in_subselect::single_value_transformer(JOIN *join,
SELECT_LEX_UNIT *unit= select_lex->master_unit();
substitution= optimizer= new Item_in_optimizer(left_expr, this);
- SELECT_LEX_NODE *current= thd->lex.current_select, *up;
+ SELECT_LEX *current= thd->lex.current_select, *up;
+
thd->lex.current_select= up= current->return_after_parsing();
//optimizer never use Item **ref => we can pass 0 as parameter
if (!optimizer || optimizer->fix_left(thd, up->get_table_list(), 0))
@@ -658,7 +659,7 @@ Item_in_subselect::row_value_transformer(JOIN *join,
SELECT_LEX_UNIT *unit= select_lex->master_unit();
substitution= optimizer= new Item_in_optimizer(left_expr, this);
- SELECT_LEX_NODE *current= thd->lex.current_select, *up;
+ SELECT_LEX *current= thd->lex.current_select, *up;
thd->lex.current_select= up= current->return_after_parsing();
//optimizer never use Item **ref => we can pass 0 as parameter
if (!optimizer || optimizer->fix_left(thd, up->get_table_list(), 0))
@@ -771,7 +772,7 @@ int subselect_single_select_engine::prepare()
if (prepared)
return 0;
prepared= 1;
- SELECT_LEX_NODE *save_select= thd->lex.current_select;
+ SELECT_LEX *save_select= thd->lex.current_select;
thd->lex.current_select= select_lex;
if (join->prepare(&select_lex->ref_pointer_array,
(TABLE_LIST*) select_lex->table_list.first,
@@ -876,7 +877,7 @@ int subselect_single_select_engine::exec()
{
DBUG_ENTER("subselect_single_select_engine::exec");
char const *save_where= join->thd->where;
- SELECT_LEX_NODE *save_select= join->thd->lex.current_select;
+ SELECT_LEX *save_select= join->thd->lex.current_select;
join->thd->lex.current_select= select_lex;
if (!optimized)
{