Mysql创建函数出错

自闭症网瘾萝莉.ら 提交于 2019-12-27 05:03:29

mysql> delimiter //
mysql> create function testfunction(id int)returns int
-> begin
-> declare tt int;
-> set tt=0;
-> select sum(total) into tt from selectinto1 b where b.id=id;
-> update selectinto2 a set a.summ=tt where a.id=id;
-> return 1;
-> end ;
-> //
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)


解决方案:
mysql> set global log_bin_trust_function_creators=1;
Query OK, 0 rows affected (0.00 sec)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!