summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-02-14 16:29:16 +0100
committerSergei Golubchik <serg@mariadb.org>2020-03-10 19:24:23 +0100
commit70e7b5095d44f580eb0a287fb6d6c794276e75d2 (patch)
treef723c725ad14f26de2abdb019199465d2825f7b1 /sql/sql_trigger.cc
parentd5a00697023d17b38b89d7b3c4d37fa98c1dd60b (diff)
downloadmariadb-git-70e7b5095d44f580eb0a287fb6d6c794276e75d2.tar.gz
perfschema sp instrumentation related changes
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index d683bdc7055..27d89b630e3 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -35,6 +35,7 @@
#include "sp_cache.h" // sp_invalidate_cache
#include <mysys_err.h>
#include "debug_sync.h"
+#include "mysql/psi/mysql_sp.h"
/*************************************************************************/
@@ -624,7 +625,13 @@ end:
thd->lex->restore_backup_query_tables_list(&backup);
if (!result)
+ {
my_ok(thd);
+ /* Drop statistics for this stored program from performance schema. */
+ MYSQL_DROP_SP(SP_TYPE_TRIGGER,
+ thd->lex->spname->m_db.str, thd->lex->spname->m_db.length,
+ thd->lex->spname->m_name.str, thd->lex->spname->m_name.length);
+ }
DBUG_RETURN(result);
#ifdef WITH_WSREP
@@ -1554,6 +1561,10 @@ bool Table_triggers_list::check_n_load(THD *thd, const LEX_CSTRING *db,
trigger->definer= *trg_definer;
}
+ sp->m_sp_share= MYSQL_GET_SP_SHARE(SP_TYPE_TRIGGER,
+ sp->m_db.str, sp->m_db.length,
+ sp->m_name.str, sp->m_name.length);
+
#ifndef DBUG_OFF
/*
Let us check that we correctly update trigger definitions when we
@@ -1846,6 +1857,9 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, const LEX_CSTRING *db,
*/
result= 1;
}
+ /* Drop statistics for this stored program from performance schema. */
+ MYSQL_DROP_SP(SP_TYPE_TRIGGER, db->str, db->length,
+ trigger->name.str, trigger->name.length);
}
}
}