错误如图:
1418 - This function has none of DETERIMINISTIC, NO SQL, or READS SOL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log bin trust function creators variable)
解决办法一:
在声明返回值类型后加入如下代码:
DETERMINISTIC
CONTAINS SQL
READS SQL DATA
CREATE DEFINER = CURRENT_USER FUNCTION `wlA2`()
RETURNS DOUBLE
DETERMINISTIC
CONTAINS SQL
READS SQL DATA
BEGIN
DECLARE fs DOUBLE;
SELECT zdf INTO fs
FROM `sn`;
RETURN fs;
END;
解决办法二:先执行一下代码再进行保存存储函数
SET GLOBAL log_bin_trust_function_creators = 1;