summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-02-13 08:35:14 -0200
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-02-13 08:35:14 -0200
commit07c30f911e86b34f004f15b26771a4b20a513b15 (patch)
treeff0312e29ff55b850e224fbc33104bdb65a315ed /sql/sql_view.cc
parentd6ab925c5e10acc72cddbaf910d9aa4bee305c82 (diff)
downloadmariadb-git-07c30f911e86b34f004f15b26771a4b20a513b15.tar.gz
Bug#50624: crash in check_table_access during call procedure
This bug is just one facet of stored routines not being able to detect changes in meta-data (WL#4179). This particular problem can be triggered within a single session due to the improper management of the pre-locking list if the view is expanded after the pre-locking list is calculated. Since the overall solution for the meta-data detection issue is planned for a later release, for now a workaround is used to fix this particular aspect that only involves a single session. The workaround is to flush the thread-local stored routine cache every time a view is created or modified, causing locally cached routines to be re-evaluated upon invocation. mysql-test/r/sp-bugs.result: Add test case result for Bug#50624. mysql-test/t/sp-bugs.test: Add test case for Bug#50624. sql/sp_cache.cc: Update function description. sql/sql_view.cc: Invalidate the SP cache if a view is being created or modified.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index c6d412112c2..c66990c54c6 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -400,17 +400,14 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
DBUG_ASSERT(!lex->proc_list.first && !lex->result &&
!lex->param_list.elements);
- if (mode != VIEW_CREATE_NEW)
+ if (mode == VIEW_ALTER && fill_defined_view_parts(thd, view))
{
- if (mode == VIEW_ALTER &&
- fill_defined_view_parts(thd, view))
- {
- res= TRUE;
- goto err;
- }
- sp_cache_invalidate();
+ res= TRUE;
+ goto err;
}
+ sp_cache_invalidate();
+
if (!lex->definer)
{
/*