About MySQL's trigger
I know it's available since version 5.1,but :
- Is it stable?
- Is it开发者_运维知识库 possible to trigger event when there is insert/update operation on specific columns instead of the whole table?
- To my experience, yes, totally
- Not exclusively, but you can add a check in the body of the trigger:
IF(OLD.col <> NEW.col, ...)
- To my experience, yes.
- Trigger functionality is very limited. You have FOR EACH ROW option but no WHEN. It is also very limited what you can do inside the trigger. If you expect the requirements to change later (i.e. the project will go on), I would not opt to do business logic in mysql triggers. If it contains some simple check or consistency update it can do a good job.
精彩评论