1418: Function has none of DETERMINISTIC, NO SQL, or READS SQL DATA (binary logging enabled)
MySQLWhat does it mean?
A stored function was being created, but binary logging is enabled and the function is not declared with any of the determinism/data access characteristics. MySQL rejects such a function because it is ambiguous from a replication safety standpoint.
Why does it happen?
The function was defined without the DETERMINISTIC, NO SQL or READS SQL DATA characteristics while log_bin is ON and log_bin_trust_function_creators=OFF. Without these characteristics, MySQL cannot be sure the function produces the same result on the replica.
How to fix it
Declare the function's behavior with the correct characteristics: add DETERMINISTIC if it is truly deterministic, NO SQL if it does not access data, READS SQL DATA if it only reads. If you are sure the functions are safe, you can set log_bin_trust_function_creators=1 as a central policy; however, declaring the characteristic correctly is the safest approach. Make sure the characteristic matches the function's actual behavior.