Bug #33494 mysqldump fails to comment out DELIMITER statement in mysql 4
Submitted: 24 Dec 2007 0:45 Modified: 24 Dec 2007 14:20
Reporter: Jim Lyons Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version:5.0.54 OS:Any
Assigned to: CPU Architecture:Any

[24 Dec 2007 0:45] Jim Lyons
I believe I just stumbled across a bug in mysqldump.  When a table that
had a trigger was dumped, all of the trigger procedure was commented
out with code like /*!50003 ... TRIGGER */.

However, the DELIMITER statement as *NOT* commented out, so when I ran
the dump file on a MySQL 4.1.14 machine it died.  When I  changed the
line to:
/*!50003 DELIMITER ;; */
and similarly for the line that reset the delimiter it worked fine.

How to repeat:
create a trigger in mysql 5 and run mysqldump on the table with the trigger.  The output *should* have something like /*!50003 DELIMITER ;; */ to be sure the DELIMITER statement is not execute for versions below 5.  However, mysqldump does not put in the comments, leaving simply the line: 
This causes the restore to fail if restoring to a database in a downlevel of mysql.

Suggested fix:
put in appropriate comment tags
[24 Dec 2007 14:20] Valeriy Kravchuk
Indeed, mysqldump even of 5.0.54 does not comment out DELIMITER command. This may become a problem for older versions of mysql command line client. So, I think, this is a reasonable feature request.

There should be no problem if you use mysql from version 5.0.x to work with older versions of MySQL server.