summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2003-04-23 11:20:19 +0300
committerbell@sanja.is.com.ua <>2003-04-23 11:20:19 +0300
commitc4637293fd71e4c93776af967c41b29a505beec6 (patch)
treef990ceb0b0676587ce26deb5505e45e1cfcf7e72 /sql/sql_lex.cc
parenta3d3937ac219dc90e2cad761f6a200c467912add (diff)
parentc96e5884905f02f007f47242ae052a2532b27c04 (diff)
downloadmariadb-git-c4637293fd71e4c93776af967c41b29a505beec6.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-order-4.1
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc55
1 files changed, 46 insertions, 9 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index d5d438fc3a1..d88908d9e0f 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1203,23 +1203,60 @@ TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table,
}
ulong st_select_lex_node::get_table_join_options() { return 0; }
-/*
- This is used for UNION & subselect to create a new table list of all used
- tables.
- The table_list->table entry in all used tables are set to point
- to the entries in this list.
-*/
-// interface
+/*
+ Interface method of table list creation for query
+
+ SYNOPSIS
+ st_select_lex_unit::create_total_list()
+ thd THD pointer
+ result pointer on result list of tables pointer
+ check_derived force derived table chacking (used for creating
+ table list for derived query)
+ DESCRIPTION
+ This is used for UNION & subselect to create a new table list of all used
+ tables.
+ The table_list->table entry in all used tables are set to point
+ to the entries in this list.
+
+ RETURN
+ 0 - OK
+ !0 - error
+*/
bool st_select_lex_unit::create_total_list(THD *thd, st_lex *lex,
TABLE_LIST **result,
bool check_derived)
{
*result= 0;
- return create_total_list_n_last_return(thd, lex, &result, check_derived);
+ for (SELECT_LEX_UNIT *unit= this; unit; unit= unit->next_unit())
+ {
+ if ((res= unit->create_total_list_n_last_return(thd, lex, &result,
+ check_derived)))
+ return res;
+ }
+ return 0;
}
-// list creator
+/*
+ Table list creation for query
+
+ SYNOPSIS
+ st_select_lex_unit::create_total_list()
+ thd THD pointer
+ lex pointer on LEX stricture
+ result pointer on pointer on result list of tables pointer
+ check_derived force derived table chacking (used for creating
+ table list for derived query)
+ DESCRIPTION
+ This is used for UNION & subselect to create a new table list of all used
+ tables.
+ The table_list->table entry in all used tables are set to point
+ to the entries in this list.
+
+ RETURN
+ 0 - OK
+ !0 - error
+*/
bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex,
TABLE_LIST ***result,
bool check_derived)