这是否意味着如果我使用 MySQL < 5.0.10,我无法从触发器更新另一个表
Note Before MySQL 5.0.10, triggers cannot contain direct references to tables by name. Beginning with MySQL 5.0.10, you can write triggers such as the one named testref shown in this example...
最佳答案
这是正确的。 This FAQ以更明确的方式陈述这一事实:
Before MySQL 5.0.10, a trigger cannot modify other tables
请注意the following limitation仍然存在于 v5.5 和 v5.6 中:
A trigger (...) is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger.
关于MySQL 文档澄清;触发器访问另一个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11143689/