diff options
author | unknown <bell@sanja.is.com.ua> | 2003-03-11 01:06:28 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-03-11 01:06:28 +0200 |
commit | 0c1af74d8aeafa09e2f216b0758204828ab47f9e (patch) | |
tree | 219aba0cea1c6f1fed0b6235ebf1893bfef27954 /sql/sql_lex.cc | |
parent | bbc8f836c0400f361458bffd42d71ea2177a9e18 (diff) | |
download | mariadb-git-0c1af74d8aeafa09e2f216b0758204828ab47f9e.tar.gz |
processing of subselect in global ORDER BY (fifed crash of server)
this implementation have limitation: prohibited subselect in ORDER BY dependence of most outer query (will be solved after removing passing first select_lex as fake select for global mysql_select())
mysql-test/r/subselect.result:
test of subselect in global ORDER BY
mysql-test/t/subselect.test:
test of subselect in global ORDER BY
sql/sql_lex.cc:
fixed comments
processing of subselect in global ORDER BY
sql/sql_lex.h:
processing of subselect in global ORDER BY
sql/sql_parse.cc:
processing of subselect in global ORDER BY
sql/sql_yacc.yy:
processing of subselect in global ORDER BY
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 94c06d41634..61114247fed 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1240,23 +1240,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) |