首页 > 数据库技术 > 详细

自定义mysql函数时报错,[Err] 1418 - This function has none of DETERMINISTIC......

时间:2016-08-19 11:17:00      阅读:711      评论:0      收藏:0      [点我收藏+]

  今天在我执行自定义mysql函数的SQL时发生了错误,SQL如下:

/**
自定义mysql函数 getChildList
*/
delimiter //
CREATE FUNCTION `pengwifi_wifi`.`getChildList`(rootId INT)
RETURNS varchar(1000)

BEGIN
DECLARE sTemp VARCHAR(1000);
DECLARE sTempChd VARCHAR(1000);

SET sTemp = ‘$‘;
SET sTempChd =cast(rootId as CHAR);

WHILE sTempChd is not null DO
SET sTemp = concat(sTemp,‘,‘,sTempChd);
SELECT group_concat(id) INTO sTempChd FROM hui_class where FIND_IN_SET(parent_id,sTempChd)>0;
END WHILE;
RETURN sTemp;
END
//

 

报错信息:[Err] 1418 - 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)

解决方法:set global log_bin_trust_function_creators=TRUE;

 

自定义mysql函数时报错,[Err] 1418 - This function has none of DETERMINISTIC......

原文:http://www.cnblogs.com/zhangxiaoliu/p/5786782.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!