summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-11-04 22:12:45 +0200
committerunknown <bell@sanja.is.com.ua>2002-11-04 22:12:45 +0200
commit53a386ca874d69d471eaf1600c2f55e063e03c5a (patch)
tree12c9202ba6e7b1dca9c4741f7b30fad9fa4a7d40 /sql/sql_lex.cc
parent07573b03afc40bc4735411dab634674932b9de70 (diff)
downloadmariadb-git-53a386ca874d69d471eaf1600c2f55e063e03c5a.tar.gz
moved similar code to function
onversion with check sql/item.cc: removed similar code sql/item_sum.cc: conversion with check sql/sql_delete.cc: conversion with check sql/sql_derived.cc: style fix sql/sql_lex.cc: conversion with check moved similar code to function sql/sql_lex.h: conversion with check moved similar code to function sql/sql_parse.cc: conversion with check sql/sql_update.cc: conversion with check sql/sql_yacc.yy: conversion with check
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc56
1 files changed, 54 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 97cf936240f..b5dd5218e7d 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -21,6 +21,7 @@
#include "item_create.h"
#include <m_ctype.h>
#include <hash.h>
+#include <assert.h>
LEX_STRING tmp_table_alias= {(char*) "tmp-table",8};
@@ -1043,17 +1044,23 @@ void st_select_lex_node::exclude()
*/
}
+st_select_lex* st_select_lex_node::select_lex()
+{
+ DBUG_ENTER("st_select_lex_node::select_lex (never should be called)");
+ DBUG_ASSERT(1);
+ DBUG_RETURN(0);
+}
+
bool st_select_lex_node::add_item_to_list(Item *item)
{
return 1;
}
-bool st_select_lex_node::add_group_to_list(Item *item, bool asc)
+bool st_select_lex_node::add_group_to_list(Item *item, bool asc)
{
return 1;
}
-//why compiler/linker do not allow make it inline?
bool st_select_lex_node::add_order_to_list(Item *item, bool asc)
{
return add_to_list(order_list,item,asc);
@@ -1064,6 +1071,47 @@ bool st_select_lex_node::add_ftfunc_to_list(Item_func_match *func)
return 1;
}
+/*
+ st_select_lex_node::mark_as_dependent mark all st_select_lex struct from
+ this to 'last' as dependent
+
+ SYNOPSIS
+ last - pointer to last st_select_lex struct, before wich all
+ st_select_lex have to be marked as dependent
+
+ NOTE
+ 'last' should be reachable from this st_select_lex_node
+
+*/
+
+void st_select_lex_node::mark_as_dependent(SELECT_LEX *last)
+{
+ /*
+ Mark all selects from resolved to 1 before select where was
+ found table as depended (of select where was found table)
+ */
+ for (SELECT_LEX_NODE *s= this;
+ s &&s != last;
+ s= s->outer_select())
+ if( !s->dependent )
+ {
+ // Select is dependent of outer select
+ s->dependent= 1;
+ if (s->linkage != GLOBAL_OPTIONS_TYPE)
+ {
+ //s is st_select_lex*
+
+ s->master_unit()->dependent= 1;
+ //Tables will be reopened many times
+ for (TABLE_LIST *tbl=
+ s->get_table_list();
+ tbl;
+ tbl= tbl->next)
+ tbl->shared= 1;
+ }
+ }
+}
+
bool st_select_lex_node::set_braces(bool value) { return 1; }
bool st_select_lex_node::inc_in_sum_expr() { return 1; }
uint st_select_lex_node::get_in_sum_expr() { return 0; }
@@ -1168,6 +1216,10 @@ st_select_lex* st_select_lex_unit::outer_select()
return (st_select_lex*) master;
}
+st_select_lex* st_select_lex::select_lex()
+{
+ return this;
+}
bool st_select_lex::add_item_to_list(Item *item)
{