Bug #30470 Trigger documentation not up to date
Submitted: 17 Aug 2007 11:28 Modified: 29 Nov 2007 18:29
Reporter: Roland Bouman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[17 Aug 2007 11:28] Roland Bouman
Description:
http://dev.mysql.com/doc/refman/5.0/en/faqs-triggers.html

27.5.7:  Where are triggers stored?

" Triggers are currently stored in .TRG  files, with one such file one per table. In other words, a trigger belongs to a table."

Note that this differs from the wording used in the chapters, where triggers are "associated" with a table. To me, the "belong" and "associated" terms seem pretty vague - what is meant exactly? 

"In the future, we plan to change this so that trigger information will be included in the .FRM file that defines the structure of the table. We also plan to make triggers database-level objects — rather than table-level objects as they are now — to bring them into compliance with the SQL standard. "

Triggers are "database level objects" - they are uniquely identified withing a schema using the trigger name. In earlier versions they were identified by name within  a table. This is properly documented in the chapter.

Another thing is that the trigger chapter never mentions that triggers are dropped when the table is dropped (That is, a DROP table statement will implicitly DROP any associated triggers - whereas TRUNCATE will not)

How to repeat:
na

Suggested fix:
na
[17 Aug 2007 12:18] MySQL Verification Team
Thank you for the bug report.
[29 Nov 2007 18:29] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

- The part about a trigger belonging to a table is unnecessary here, so I removed it.
- The part about the namespace is irrelevant to storage in a .TRG file, and the "what me might do in the future" is by no means certain, so I removed that, too.
- I mentioned that if you drop a table, its triggers are dropped in the DROP TRIGGER and "how to use triggers" sections in the triggers chapter.