A trigger is a type of a stored procedure, so a lot of SP logic applies to them.
http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html
The DEFINER clause specifies the MySQL account to be used when checking access privileges at trigger activation time.
MySQL takes the DEFINER user into account when checking trigger privileges as follows:
At CREATE TRIGGER time, the user who issues the statement must have the TRIGGER privilege.
At trigger activation time, privileges are checked against the DEFINER user. This user must have these privileges:
The TRIGGER privilege for the subject table.
The SELECT privilege for the subject table if references to table columns occur using OLD.col_name or NEW.col_name in the trigger body.
The UPDATE privilege for the subject table if table columns are targets of SET NEW.col_name = value assignments in the trigger body.
Whatever other privileges normally are required for the statements executed by the trigger.
There is also http://dev.mysql.com/doc/refman/5.5/en/stored-programs-security.html
Hi Stephane,
Why should it not have failed?
It sounds like a good outcome, because, see MySQL documentation:
http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html
It's much better that the statement fails when privileges cannot be checked properly, rather than they go random.