diff options
author | unknown <bell@sanja.is.com.ua> | 2004-04-08 00:19:43 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-04-08 00:19:43 +0300 |
commit | d5135aff3ad8af11279927185cecda65a6291dd1 (patch) | |
tree | 8623a46473c8c2cb769c792a41b7a28bae698da7 /sql/sql_lex.cc | |
parent | 94002eb59512e78df76922ae5c2204359fc306e4 (diff) | |
parent | c9d856c8b78812dd402b89c62bcea23cc7dbe2a1 (diff) | |
download | mariadb-git-d5135aff3ad8af11279927185cecda65a6291dd1.tar.gz |
merge
sql/item_cmpfunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 4c63a8b7c7f..7fa0591ddc8 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1635,6 +1635,66 @@ void st_select_lex::print_limit(THD *thd, String *str) } /* + unlink first table from table lists + + SYNOPSIS + unlink_first_table() + tables - global table list + global_first - save first global table passed using this parameter + local_first - save first local table passed using this parameter + + RETURN + global list without first table +*/ +TABLE_LIST *st_lex::unlink_first_table(TABLE_LIST *tables, + TABLE_LIST **global_first, + TABLE_LIST **local_first) +{ + *global_first= tables; + *local_first= (TABLE_LIST*)select_lex.table_list.first; + // exclude from global table list + tables= tables->next; + // and from local list if it is not the same + if (&select_lex != all_selects_list) + select_lex.table_list.first= (gptr)(*local_first)->next; + else + select_lex.table_list.first= (gptr)tables; + (*global_first)->next= 0; + return tables; +} + +/* + link unlinked first table back + + SYNOPSIS + link_first_table_back() + tables - global table list + global_first - save first global table + local_first - save first local table + + RETURN + global list +*/ +TABLE_LIST *st_lex::link_first_table_back(TABLE_LIST *tables, + TABLE_LIST *global_first, + TABLE_LIST *local_first) +{ + global_first->next= tables; + tables= global_first; + if (&select_lex != all_selects_list) + { + /* + we do not touch local table 'next' field => we need just + put the table in the list + */ + select_lex.table_list.first= (gptr) local_first; + } + else + select_lex.table_list.first= (gptr) tables; + return tables; +} + +/* There are st_select_lex::add_table_to_list & st_select_lex::set_lock_for_tables are in sql_parse.cc |