diff options
| author | Alexander Nozdrin <alexander.nozdrin@oracle.com> | 2011-03-10 11:07:57 +0300 |
|---|---|---|
| committer | Alexander Nozdrin <alexander.nozdrin@oracle.com> | 2011-03-10 11:07:57 +0300 |
| commit | 5653a71d3ec08e64098b430fcd7def790e249fa3 (patch) | |
| tree | 5fa3a4d25f85e9fca1dd6180886d6e2bd4399afb /sql/sql_trigger.cc | |
| parent | 0b7e6f81afe24f4734b3d8ce5d85411609f8d3a0 (diff) | |
| download | mariadb-git-5653a71d3ec08e64098b430fcd7def790e249fa3.tar.gz | |
Patch for Bug#11765684 (58674: SP-cache does not detect changes in
pre-locking list caused by triggers).
The thing is that CREATE TRIGGER / DROP TRIGGER may actually
change pre-locking list of (some) stored routines.
The SP-cache does not detect such changes. Thus if sp_head-instance
is cached in SP-cache, subsequent executions of the cached
sp_head will use inaccurate pre-locking list.
The patch is to invalidate SP-cache on CREATE TRIGGER / DROP TRIGGER.
Diffstat (limited to 'sql/sql_trigger.cc')
| -rw-r--r-- | sql/sql_trigger.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index e986f6d7e92..4908fce5950 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -30,6 +30,7 @@ #include "sql_db.h" // get_default_db_collation #include "sql_acl.h" // *_ACL, is_acl_user #include "sql_handler.h" // mysql_ha_rm_tables +#include "sp_cache.h" // sp_invalidate_cache /*************************************************************************/ @@ -517,6 +518,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) */ thd->locked_tables_list.reopen_tables(thd); + /* + Invalidate SP-cache. That's needed because triggers may change list of + pre-locking tables. + */ + sp_cache_invalidate(); + end: if (!result) { |
