This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

DROP FUNCTION IF EXISTS `getChildDept`;
delimiter ;;
CREATE FUNCTION `getChildDept`(rootId INT)
RETURNS varchar(1000) CHARSET utf8
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(dept_id) INTO sTempChd FROM sys_dept where FIND_IN_SET(parent_id,sTempChd)>0;
END WHILE;
RETURN substring(sTemp,2);
END
;;
delimiter ;

执行如下命令
set global log_bin_trust_function_creators=TRUE;

参考链接 https://baijiahao.baidu.com/s?id=1713463958438440826&wfr=spider&for=pc

发表评论

邮箱地址不会被公开。 必填项已用*标注