summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorunknown <ibabaev@bk-internal.mysql.com>2007-04-21 00:36:21 +0200
committerunknown <ibabaev@bk-internal.mysql.com>2007-04-21 00:36:21 +0200
commit8a702a1e7bc8268d9a9b176429d98f89a4024cf5 (patch)
tree08522754ba4467b3b568f0ebd6462ec5edbb5926 /sql/sql_view.cc
parent4a3027aaa22e947c36f398c45a2e77324c6492e4 (diff)
parent323a2135392ce64957d3a4f46599d01375bf4c6c (diff)
downloadmariadb-git-8a702a1e7bc8268d9a9b176429d98f89a4024cf5.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into bk-internal.mysql.com:/data0/bk/mysql-5.0-opt sql/item_cmpfunc.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_view.cc: Auto merged
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 14d9aeb4df5..d717aea9a3e 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1279,13 +1279,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;
}