PersianDate4MySQL icon indicating copy to clipboard operation
PersianDate4MySQL copied to clipboard

Problem with deterministic flags

Open creativefctr opened this issue 7 years ago • 0 comments

Hi, In new versions of MySQL and MariaDB running the SQL file creates this error for each function:

#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)

When you create a stored function, you must declare either that it is deterministic or that it does not modify data. Otherwise, it may be unsafe for data recovery or replication.

By default, for a CREATE FUNCTION statement to be accepted, at least one of DETERMINISTIC, NO SQL, or READS SQL DATA must be specified explicitly. Otherwise, an error occurs:

To fix this issue add following lines After Return and Before Begin statement:

READS SQL DATA
DETERMINISTIC

For Example :

CREATE FUNCTION f2()
RETURNS CHAR(36) CHARACTER SET utf8
/*ADD HERE */
READS SQL DATA
DETERMINISTIC
BEGIN

This should be added to all functions, I modified it manually. Please update the main repo. Thanks

creativefctr avatar Oct 14 '18 15:10 creativefctr