diff options
author | unknown <kroki/tomash@moonlight.home> | 2007-01-18 12:57:34 +0300 |
---|---|---|
committer | unknown <kroki/tomash@moonlight.home> | 2007-01-18 12:57:34 +0300 |
commit | 60758fb17dd00941893bac874b956aef6f1d12be (patch) | |
tree | d335a6a50851fd4bedcfeb740641e473b87b5bb5 /sql/sql_view.cc | |
parent | 5d92d2d7cf4ba64bdd9eed8d843221a4a476915d (diff) | |
parent | 0541dcad3bd09dc616298d7cc18c5a8c9d1e7458 (diff) | |
download | mariadb-git-60758fb17dd00941893bac874b956aef6f1d12be.tar.gz |
Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug24404
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug24404
sql/sql_view.cc:
Auto merged
mysql-test/r/view_grant.result:
Manual merge.
mysql-test/t/view_grant.test:
Manual merge.
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 a699a801e2b..f8ae90e98fb 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1146,13 +1146,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; |