From 41021c0254207c914e271fc4dfc910093dd4a92d Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 3 Feb 2016 17:15:22 +0100 Subject: MDEV-9462: Out of memory using explain on 2 empty tables Fixed adding derived tables items to outer one. --- sql/sql_view.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sql/sql_view.cc') diff --git a/sql/sql_view.cc b/sql/sql_view.cc index e6c5ffddfcf..5bd82fdd842 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1523,8 +1523,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, /* Fields in this view can be used in upper select in case of merge. */ if (table->select_lex) - table->select_lex->select_n_where_fields+= - lex->select_lex.select_n_where_fields; + table->select_lex->add_where_field(&lex->select_lex); } /* This method has a dependency on the proper lock type being set, -- cgit v1.2.1