According to the MySQL Performance Blog , the new Percona servers announced yesterday (May 6) include an open source version of MySQL Audit Plugin.
The task that I want to accomplish is as follows: register the tables affected by the cascading trigger during one update run. E. g. when UPDATE MY_TABLE β¦ is executed, the {BEFORE,AFTER}_UPDATE can update other tables that may have their own triggers, etc.
I am currently using an internal solution; inside all triggers I put smth like:
IF ( SELECT count(*) FROM `information_schema`.`ROUTINES` WHERE specific_name = 'my_own_log' AND routine_schema = 'my_schema' ) > 0 THEN CALL my_own_log ('FOO_TRIGGER', 'Hi, I'm to update MY_TABLE') ; END IF ;
During the production process, my_own_log procedure is not defined for my_own_log , and since the information_schema table is well optimized, I do not give any performance penalties.
The question is whether it is possible to switch to a corporate solution (the aforementioned audit plugin) to collect information about which tables were affected by the cascading trigger. JFYI: the only similar question I found here does not contain a corresponding answer.
Thanks for any suggestions.
sql mysql triggers
mudasobwa
source share