summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 8269c16916a..4f87706be17 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -774,9 +774,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
}
if (!res && !thd->is_fatal_error)
{
- TABLE_LIST *top_view= (table->belong_to_view ?
- table->belong_to_view :
- table);
+ TABLE_LIST *top_view= table->top_table();
TABLE_LIST *view_tables= lex->query_tables;
TABLE_LIST *view_tables_tail= 0;
TABLE_LIST *tbl;
@@ -1145,8 +1143,7 @@ bool check_key_in_view(THD *thd, TABLE_LIST *view)
thd->lex->select_lex.select_limit == 0)
DBUG_RETURN(FALSE); /* it is normal table or query without LIMIT */
table= view->table;
- if (view->belong_to_view)
- view= view->belong_to_view;
+ view= view->top_table();
trans= view->field_translation;
key_info_end= (key_info= table->key_info)+ table->s->keys;