forums › forums › SQLyog › Using SQLyog › Comment Sections In Stored Procs
Tagged: comment, stored procedure
- This topic is empty.
-
AuthorPosts
-
-
April 19, 2016 at 2:42 am #13526
-
April 20, 2016 at 12:18 pm #35703Kartik GroverSpectator
Hi
This is reproducible at our end. We are considering the implementation aspects for fixing this. Thanks in advance for your patience.
Regards
-
April 20, 2016 at 12:57 pm #35704Kartik GroverSpectator
Hi
Please tell if commenting out using ‘#’ saves the Stored Procedure or not?
-
April 20, 2016 at 10:15 pm #35705maxhugenParticipant
Yes, using ‘#’ in a Stored Proc is saved.
-
April 21, 2016 at 7:44 am #35706Kartik GroverSpectator
I don’t think so that even putting a “#” would save the changes. Please check that there are two cases here that are possible. One is that you add comments to the SP and then close only the tab of SP and second is closing SQLyog altogether and opening again.
As you would know that the comments fall into metadata of a stored procedure, views, etc. MySQL does not save comments for the SP or views for that matter. You can check the information_schema for the data. The mysql documentation explains that here http://dev.mysql.com/doc/refman/5.0/en/views-table.html or running the query:
SHOW CREATE PROCEDURE
; does not contain comments anywhere.
So in the first case where you close the SP tab without saving it in a .sql file there is no way server will remember the changes.
But in the second case where you close SQLyog the changes that you made to any editing tab, may it be SP or query editing the changes that you made will be saved due to Session restore that SQLyog offers. Please note here that SQLyog is saving whatever there is on the editor tab, not the server. So we cannot do much in this case.
-
April 22, 2016 at 12:34 am #35707maxhugenParticipant
MySQL does store comments for Stored Procs. I checked information_schema > ROUTINES, and the comments appear in the ROUTINE_DEFINITION column. They also appear using SHOW CREATE PROCEDURE
. I tried altering a Stored Proc using “#, “– ” and “/* … */”, they all saved OK.
However, I have tried again using Ctrl+Shift+C, and this time the section I commented was saved when I ran the ALTER Stored Proc, so I believe it was my error when I first tried it.
Topic closed, I think.
Thanks.
-
April 22, 2016 at 6:47 am #35708Kartik GroverSpectator
Hi
Sorry there is a small correction. As you said MySQL does store the comments but only that lie inside the routine definition. If you have tried to comment anything outside the Routine definition, that is not being saved.
Regards
-
-
AuthorPosts
- You must be logged in to reply to this topic.