Bug #43376 Unable to retain single line or multi-line comments in stored procedures
Submitted: 4 Mar 2009 15:43 Modified: 4 Mar 2009 15:51
Reporter: Maria Jaul Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.51 OS:Microsoft Windows (XP)
Assigned to: CPU Architecture:Any

[4 Mar 2009 15:43] Maria Jaul
Description:
When creating a stored procedure, by either sourcing the file at the client console or cutting and pasting in the code for it at the client console, all multi-line comments and single line comments are not retained.  This is verified by doing a show create procedure on the procedure.

Why are comments not being retained?  I have posted in the forum and I received feedback that this has been seen before and that mysql does not retain comments.  However, I believe it is suppose to be so is this a bug?  Or is there a fix for it?

Example:

DELIMITER $$ 

create procedure test_comment () 
BEGIN 
/* 
** procedure name: test_comment 
** created on: March 2, 2009 
** 
*/ 

-- this is a test comment
/* this is a test comment as well */
SELECT 'this is a test to see if comments appear'; 
END$$ 

DELIMITER ; 

show create procedure test_comment; 

All that is displayed back it the procedure code and NO comment block!! 

How to repeat:
in the client console apply the below code:

DELIMITER $$ 

create procedure test_comment () 
BEGIN 
/* 
** procedure name: test_comment 
** created on: March 2, 2009 
** 
*/ 

-- this is a test comment
/* this is a test comment as well */
SELECT 'this is a test to see if comments appear'; 
END$$ 

DELIMITER ; 

show create procedure test_comment;
[4 Mar 2009 15:51] Valeriy Kravchuk
Please, upgrade your client to 5.0.54 at least (5.0.77 is already available) and use --comments option. Read http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html#option_mysql_comments. 

This is a well known problem that was solved long time ago. See bug #26215.