mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user