Bug #15344 Comments on views and triggers
Submitted: 30 Nov 2005 9:43 Modified: 30 Nov 2005 10:08
Reporter: Federico Razzoli (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Views Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Triage: Triaged: D5 (Feature request)

[30 Nov 2005 9:43] Federico Razzoli
Description:
I would like to be able to set comments for views and triggers. I don't know if comments on those objects are standard SQL, but would be useful.

How to repeat:
.
[30 Nov 2005 10:08] Valeriy Kravchuk
Thank you for a feature request. I agree that stored comments to all database objects can be useful for large and complex databases.
[2 Jul 2006 22:04] Marc Alff
For comments in triggers,
see related Bug#11230

To view the trigger statements (with the comments then),
see related Bug#18161
[7 Sep 2007 6:20] Valeriy Kravchuk
Bug #30729 was marked as a duplicate of this one.
[4 Oct 2008 10:13] Konstantin Osipov
There is really no workaround now because of Bug#5159. Once Bug#5159 is fixed, comments will be allowed at any place in view definition, which would provide a very good workaround.
Not closing as a duplicate since the suggested solution is different.
[9 Dec 2013 16:12] Miguel Solorzano
http://bugs.mysql.com/bug.php?id=71120 duplicate of this one.
[17 Feb 2017 18:12] Joshua Huber
It's really ugly and hacky, but if you must have some sort of inline documentation before this (ever) gets implemented, this below will work.  In the event someone ever needs to reverse engineer your views to see what it was for, via SHOW CREATE VIEW, they will get the blurb.

CREATE OR REPLACE VIEW foo
AS
SELECT bar, bat, biz
FROM cats c
JOIN dogs d ON (c.nickname = d.nickname)
WHERE d.has_fleas = 1
AND 'Comment' != 'This view was created to prove a point. Please implement Bug #15344 soon.';
[6 Jul 2017 22:53] Bruno Aquino Filardi Filho
Please put this feature! Anyone working on this?
[20 Jul 2017 11:15] Paolo Puddu
Allowing comments to views would prevent me having to have maintain separate documentation for explaining some of the calculated fields I am producing in the view.
I would appreciate this feature being added.
Thanks