diff options
author | unknown <dlenev@mockturtle.local> | 2007-01-24 19:26:06 +0300 |
---|---|---|
committer | unknown <dlenev@mockturtle.local> | 2007-01-24 19:26:06 +0300 |
commit | 491ef6af00efd228690a5f8131e6ecc98185705c (patch) | |
tree | c076d2c719675ee2705ea0bf80abdae4d389738a /sql/sql_view.cc | |
parent | e57ef96a08b7339a9e6a546fd8a603d98a6aa072 (diff) | |
parent | 07b6b2f8764c18766c11065f5ac8eea367f60c2c (diff) | |
download | mariadb-git-491ef6af00efd228690a5f8131e6ecc98185705c.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mockturtle.local:/home/dlenev/src/mysql-5.1-merge
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/ps.test:
Auto merged
sql/sql_view.cc:
Auto merged
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 55f6fc04442..a57d21ba7b2 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1144,13 +1144,17 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, /* Prepare a security context to check underlying objects of the view */ - Security_context *save_security_ctx= thd->security_ctx; if (!(table->view_sctx= (Security_context *) thd->stmt_arena->alloc(sizeof(Security_context)))) goto err; /* Assign the context to the tables referenced in the view */ - for (tbl= view_tables; tbl; tbl= tbl->next_global) - tbl->security_ctx= table->view_sctx; + if (view_tables) + { + DBUG_ASSERT(view_tables_tail); + for (tbl= view_tables; tbl != view_tables_tail->next_global; + tbl= tbl->next_global) + tbl->security_ctx= table->view_sctx; + } /* assign security context to SELECT name resolution contexts of view */ for(SELECT_LEX *sl= lex->all_selects_list; sl; |