Bug #15110 mysqldump --triggers: does not include DEFINER clause
Submitted: 21 Nov 2005 20:53 Modified: 20 Jan 2006 1:36
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.0.17BK OS:Linux (Linux)
Assigned to: Alexander Nozdrin CPU Architecture:Any

[21 Nov 2005 20:53] Paul DuBois
Description:
MySQL 5.0.17 adds a DEFINER clause to CREATE TRIGGER
grammar.  But mysqldump --triggers omits that clause
from dumped trigger definitions.

How to repeat:
Execute these statements:

DROP TABLE IF EXISTS account;
CREATE TABLE account (acct_num INT, amount DECIMAL(10,2));
CREATE DEFINER = CURRENT_USER TRIGGER ins_sum BEFORE INSERT ON account
FOR EACH ROW SET @sum = @sum + NEW.amount;

Then run mysqldump --triggers.  The output looks like this:

/*!50003 CREATE TRIGGER `ins_sum` BEFORE INSERT ON `account` FOR EACH ROW SET @sum = @sum + NEW.amount */;;

No DEFINER clause there.

By the way, when fixing this, watch out for the comment-version
mismatch between when CREATE TRIGGER was implemented
(5.0.3) ahd when DEFINER was implemented (5.0.17). See
Bug#14871 for a problem like this that has occurred for views.
[10 Jan 2006 23:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/879
[10 Jan 2006 23:16] Alexander Nozdrin
Fixed in 5.0 tree. Currently tagged 5.0.18.
[13 Jan 2006 16:31] Alexander Nozdrin
Merged into 5.1. Currently tagged 5.1.5.
[20 Jan 2006 1:36] Paul DuBois
Noted in 5.0.18, 5.1.5 changelogs.

          The output of <command>mysqldump --triggers</command> did not
          contain the <literal>DEFINER</literal> clause in dumped
          trigger definitions. (Bug #15110)