Commit 7b91cd9a authored by unknown's avatar unknown

table.cc:

  remove unneeded multitable_view assignment
sql_view.cc:
  fix potential memorry overrun in ref_array
  asssign multitable_view in time of view creation (BUG#12569)


sql/sql_view.cc:
  fix potential memorry overrun in ref_array
  asssign multitable_view in time of view creation
sql/table.cc:
  remove unneeded multitable_view assignment
parent 6ff38ce7
...@@ -844,6 +844,9 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ...@@ -844,6 +844,9 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
view_tables); view_tables);
lex->select_lex.context.outer_context= 0; lex->select_lex.context.outer_context= 0;
lex->select_lex.context.select_lex= table->select_lex; lex->select_lex.context.select_lex= table->select_lex;
lex->select_lex.select_n_having_items+=
table->select_lex->select_n_having_items;
/* do not check privileges & hide errors for view underlyings */ /* do not check privileges & hide errors for view underlyings */
for (SELECT_LEX *sl= lex->all_selects_list; for (SELECT_LEX *sl= lex->all_selects_list;
sl; sl;
...@@ -864,7 +867,11 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ...@@ -864,7 +867,11 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
{ {
if (view_tables->next_local) if (view_tables->next_local)
{
table->multitable_view= TRUE; table->multitable_view= TRUE;
if (table->belong_to_view)
table->belong_to_view->multitable_view= TRUE;
}
/* make nested join structure for view tables */ /* make nested join structure for view tables */
NESTED_JOIN *nested_join; NESTED_JOIN *nested_join;
if (!(nested_join= table->nested_join= if (!(nested_join= table->nested_join=
......
...@@ -1720,8 +1720,6 @@ void st_table_list::set_ancestor() ...@@ -1720,8 +1720,6 @@ void st_table_list::set_ancestor()
*/ */
tbl->ancestor->set_ancestor(); tbl->ancestor->set_ancestor();
} }
if (tbl->multitable_view)
multitable_view= TRUE;
} while ((tbl= tbl->next_local)); } while ((tbl= tbl->next_local));
if (!multitable_view) if (!multitable_view)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment