diff options
author | gkodinov/kgeorge@magare.gmz <> | 2007-04-20 12:06:52 +0300 |
---|---|---|
committer | gkodinov/kgeorge@magare.gmz <> | 2007-04-20 12:06:52 +0300 |
commit | 0d70f964aa7cf64f6c6f0bdc14687f9076b6317e (patch) | |
tree | 503df238204acc944162c36965213aa279fba89c /sql/sql_view.cc | |
parent | bfac9ea67e0812d998a98cbfeae8345376a22511 (diff) | |
parent | 4c89a5960fbd73c684b9f8d3a07ee8d78436b732 (diff) | |
download | mariadb-git-0d70f964aa7cf64f6c6f0bdc14687f9076b6317e.tar.gz |
Merge magare.gmz:/home/kgeorge/mysql/work/B27786-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/B27786-addon-5.1-opt
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index f84847f2f9c..ee99a2974f4 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1270,13 +1270,18 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, unit->slave= save_slave; // fix include_down initialisation } + /* + We can safely ignore the VIEW's ORDER BY if we merge into union + branch, as order is not important there. + */ + if (!table->select_lex->master_unit()->is_union()) + table->select_lex->order_list.push_back(&lex->select_lex.order_list); /* This SELECT_LEX will be linked in global SELECT_LEX list to make it processed by mysql_handle_derived(), but it will not be included to SELECT_LEX tree, because it will not be executed - */ - table->select_lex->order_list.push_back(&lex->select_lex.order_list); + */ goto ok; } |