Bug #25128 command line client discards comments
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.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
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.