mysql在创建function函数时会报错

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图

create function sumage(age int) returns char(16)
begin
if age>=70 and age<=80 then return '老人';
elseif age>=40 and age<70 then return '中年人';
elseif age>=20 and age<40 then return '年轻人';
elseif age>=1 and age<20 then return '小孩';
end if;
end

运行结果及报错内容

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)

我的解答思路和尝试过的方法

经过百度,将 log_bin_trust_function_creators 打开就可以运行成功

我想要达到的结果

但是我不明白为什么,在mysql创建function要打开 bin——log

它控制是否可以信任存储函数创建者,不会创建写入二进制日志引起不安全事件的存储函数。
说白了就是你这个函数是否安全,出事了mysql不管,你自己负责