diff options
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index e3bfe37b172..a4da5c48b6d 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1808,7 +1808,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table, if (view_is_mergeable && (table->select_lex->master_unit() != &old_lex->unit || old_lex->can_use_merged()) && - !old_lex->can_not_use_merged(0)) + !old_lex->can_not_use_merged()) { /* lex should contain at least one table */ DBUG_ASSERT(view_main_select_tables != 0); @@ -1841,8 +1841,11 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table, */ if (!table->select_lex->master_unit()->is_unit_op() && table->select_lex->order_list.elements == 0) + { table->select_lex->order_list. push_back(&lex->first_select_lex()->order_list); + lex->first_select_lex()->order_list.empty(); + } else { if (old_lex->sql_command == SQLCOM_SELECT && |