In MySQL (particularly InnoDB) is there any way to know which tables were affected (updated / deleted rows) by CASCADE UPDATES / DELETES or regular triggers?
A:
Show the cascades and constraints:
mysql> SHOW CREATE TABLE tablename;
Show triggers:
mysql> USE dbname;
mysql> show triggers;
randy melder
2009-09-14 13:14:55
A:
As far as I know, there's no built-in solution for that. If you want to know which triggers have been fired you'll have to call your own logging functions from the triggers themselves. As for cascaded UPDATE/DELETE, they don't fire triggers so short of digging through the binlog I don't see how you can know which rows have been UPDATEd or DELETEd.
Josh Davis
2009-09-14 14:55:08
I don't care about knowing which rows were affected, **affected tables** is what I'm looking for.
Alix Axel
2009-09-14 16:09:17