1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for bug #11555 "Stored procedures: current SP tables locking make

impossible view security".

We should not expose names of tables which are explicitly or implicitly (via
routine or trigger) used by view even if we find that they are missing.
So during building of list of prelocked tables for statement we track which
routines (and therefore tables for these routines) are used from views. We
mark elements of LEX::routines set which correspond to routines used in views
by setting Sroutine_hash_entry::belong_to_view member to point to TABLE_LIST
object for topmost view which uses routine. We propagate this mark to all
routines which are used by this routine and which we add to this set. We also
mark tables used by such routine which we add to the list of tables for
prelocking as belonging to this view.
This commit is contained in:
dlenev@mysql.com
2005-12-07 12:27:17 +03:00
parent c779c2c809
commit 06b895c096
10 changed files with 173 additions and 46 deletions

View File

@ -2117,8 +2117,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
{
if (!query_tables_last_own)
query_tables_last_own= thd->lex->query_tables_last;
sp_cache_routines_and_add_tables_for_triggers(thd, thd->lex,
tables->table->triggers);
sp_cache_routines_and_add_tables_for_triggers(thd, thd->lex, tables);
}
free_root(&new_frm_mem, MYF(MY_KEEP_PREALLOC));
}
@ -2139,7 +2138,7 @@ process_view_routines:
/* We have at least one table in TL here. */
if (!query_tables_last_own)
query_tables_last_own= thd->lex->query_tables_last;
sp_cache_routines_and_add_tables_for_view(thd, thd->lex, tables->view);
sp_cache_routines_and_add_tables_for_view(thd, thd->lex, tables);
}
}
thd->proc_info=0;