Mysql创建函数出错

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)

posted @ 2008-03-28 18:41  uu.Net  阅读(298)  评论(0编辑  收藏  举报