Bug #25128 command line client discards comments
Submitted: 18 Dec 2006 2:27 Modified: 9 Sep 2007 1:54
Reporter: Roland Bouman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:all OS:Any (all)
Assigned to: CPU Architecture:Any
Tags: comments, MySQL

[18 Dec 2006 2:27] Roland Bouman
Description:
The mysql command line client tool discards comments before sending the command to the server.

This behaviour is very undesirable when creating stored routines (procedures, functions, triggers, events). Meaningful implementation notes inserted inside the code is lost for no good reason.

Please create an option (--retain-comments or so) to allow the entire statement (including the comments )to be sent to the server. 

The GUI tools, i.e. Query Browser and Administrator do send comments to the server, and these are then retained as the server has no problem in storing them

How to repeat:
mysql> CREATE PROCEDURE p()                                                        
    -> BEGIN       
    -> /******************
   /*> * A simple procedure
   /*> *******************/
    ->     SELECT version();
    ->     SELECT schema();
    -> END;
    -> $$

mysql> SELECT routine_definition
    -> FROM   information_schema.routines
    -> WHERE  routine_schema = schema()
    -> AND    routine_name = 'p'
    -> ;
+-------------------------------------------------------+
| routine_definition                                    |
+-------------------------------------------------------+
| BEGIN

    SELECT version();
    SELECT schema();
END | 
+-------------------------------------------------------+
1 row in set (0.01 sec)

mysql>

Suggested fix:
send comments to the server please.
[9 Sep 2007 1:54] Valeriy Kravchuk
Thank you for a reasonable feature request.