Working with Views, Stored Procedures and Triggers

ID #1172

Nested C-style comments fail with MySQL 5.1 and higher

 

Nested comments written like /* external /* internal comment */ comment */ fail to execute with MySQL 5.1 and higher.  It works before that.

 That is a problem with 'stored programs' and Views. When dumping a Stored Procedure for instance SQLyog will (like 'mysqldump' and most other up-to-date programs) generate syntax like

DELIMITER $$

/*!50003 CREATE  PROCEDURE ´sp1´()
BEGIN
  /* a comment */
END */$$

DELIMITER ;

.. and you see the sequence /*! .. /* .. */ .. */ what fails to restore in 5.1+ (but works before).

MySQL has confirmed this to be a server bug.  At the time of writing this a patch is queued but not available yet.

Related MySQl bug reports: http://bugs.mysql.com/bug.php?id=39559 and http://bugs.mysql.com/bug.php?id=44189 and http://bugs.mysql.com/bug.php?id=30631

As SQLyog will use the same comment construction internally in 'copy database' it also affects here.

Workaround: We can only advice to use "-- comment" or "#comment" but not "/*comment*/" inside stored programs and Views.

 

Categories for this entry

Tags: -

Related entries:

Last update: 2009-04-14 04:45
Author: Peter Laursen
Revision: 1.0

Digg it! Print this record Send FAQ to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ