when exporting routine create sql query seems to be incorrect
generated code is
[localhost] DELIMITER // CREATE DEFINER=`user`@`%` PROCEDURE `timespopulate`(IN `startdate` DATETIME, IN `num` INT) BEGIN DECLARE ctr INT DEFAULT 0; WHILE ctr < num DO BEGIN INSERT INTO dates (`date`) VALUES ( DATE_ADD( startdate, INTERVAL ctr day) ); SET ctr = ctr + 1; END; END WHILE; END// DELIMITER ;
/* [localhost] SQL Error (1064): 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 'DELIMITER // CREATE DEFINER=`user`@`%` PROCEDURE `timespopulate`(IN `startdate' at line 1 */
Error while export 2
Code modification/commit
from ansgar.becker,
14 years ago,
revision 4.0.0.2988
Fix injection of database name for direct SQL export to database. Also, do not surround procedure+function creation with DELIMITERs when exporting to database or server. See http://www.heidisql.com/forum.php?t=4803
Please login to leave a reply, or register at first.