看到mysql的触发器,随手写了一个:
mysql> create trigger t_ai_test
-> after insert on test
-> for each row
-> begin
-> update test set name='test_1';
-> end;$
Query OK, 0 rows affected (0.00 sec)
OK 没问题!
mysql>
insert into test values(2,'test');$
ERROR 1442 (HY000): Can't update
table 'test' in stored function/trigger because it is already used
by statement which invoked this stored function/trigge
执行插入就报这个错。
查官网是这么回答的:
Old question, but in case anyone
finds this: MySQL triggers can't manipulate the table they are
assigned to. All other major DBMS support this feature so hopefully
MySQL will add this support soon.
answered Feb 22 '10 at
21:16
“MySQL
will add this support
最后
以上就是明理音响最近收集整理的关于mysql1442错误_ERROR 1442 (HY000):because it is already used by statement which invoked this stored fun...的全部内容,更多相关mysql1442错误_ERROR 1442 (HY000):because it is already used by statement which invoked this stored fun内容请搜索靠谱客的其他文章。
发表评论 取消回复