summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2003-04-26 15:26:28 +0300
committerSinisa@sinisa.nasamreza.org <>2003-04-26 15:26:28 +0300
commit5dc8dbea5f40938d0d0d653b9820f5ab98a3e1f4 (patch)
tree1d443ccbc69a259401b8fbbdce0a7e01e41f9db7 /sql/sql_lex.cc
parent3ca1a152ebd5eaa0bf5c714404633444d69be5e4 (diff)
parent050d5b54879c9a29c20dad6441cd622b834fd0e6 (diff)
downloadmariadb-git-5dc8dbea5f40938d0d0d653b9820f5ab98a3e1f4.tar.gz
merge fix
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 ec77668c968..9bc4dfc74e7 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)