Bug #18499 mysql can't load a file created by mysql_dump in certain conditions
Submitted: 24 Mar 2006 19:57 Modified: 27 Apr 2006 16:26
Reporter: Jrme Despatis (Candidate Quality Contributor) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.18 OS:Linux (Linux Debian testing)
Assigned to: CPU Architecture:Any

[24 Mar 2006 19:57] Jrme Despatis
Description:
I've created a trigger like this:

CREATE TRIGGER `AI_actualites_utime` AFTER INSERT ON `actualites` FOR EACH ROW REPLACE INTO `update_times` VALUES ('actualites', NOW());

(in order to emulate a last modification date for a innodb as mysql doesn't support yes this feature, see http://bugs.mysql.com/bug.php?id=2681)

i dump the sql with mysql_dump, the file contains:
DELIMITER ;;
/*!50003 CREATE TRIGGER `AI_actualites_utime` AFTER INSERT ON `actualites` FOR EACH ROW REPLACE INTO `update_times` VALUES ('actualites', NOW()); */;;

then after, i load it again, but mysql says:
ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REPLACE INTO `update_times` VALUES ('actualites', NOW()); */' at line 1

How to repeat:
indicated above

Suggested fix:
now if i modify the script .sql
for example:
i modify the line:

/*!50003 CREATE TRIGGER `AI_actualites_utime` AFTER INSERT ON `actualites` FOR EACH ROW REPLACE INTO `update_times` VALUES ('actualites', NOW()); */;;

into

CREATE TRIGGER `AI_actualites_utime` AFTER INSERT ON `actualites` FOR EACH ROW REPLACE INTO `update_times` VALUES ('actualites', NOW()); ;;

it works !!
[24 Mar 2006 20:02] Jrme Despatis
Another thing interesting

if i change the line in the script .sql : 
/*!50003 CREATE TRIGGER `AI_actualites_utime` AFTER INSERT ON `actualites` FOR EACH ROW REPLACE INTO `update_times` VALUES ('actualites', NOW()); */;;

into 

/*!50003 CREATE TRIGGER `AI_actualites_utime` AFTER INSERT ON `actualites` FOR EACH ROW BEGIN REPLACE INTO `update_times` VALUES ('actualites', NOW()); END; */;;

it works

The bug is in the mysql parser
Or if not, maybe my query to create a trigger is bad, but in that case, mysqld should have forbidden it

Hope this helps
[27 Mar 2006 16:26] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version of MySQL server, 5.0.19, and inform about the results.
[27 Apr 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".