I
I
Ivan Melnikov2018-05-24 09:54:20
MySQL
Ivan Melnikov, 2018-05-24 09:54:20

When trying to create a user-defined function in MySQL 8.0, error 1418 occurs. On the MySQL 5.6 server, it is created without problems. Why?

Error text: ERROR: Error 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
) characteristics. But after this error, I wrote NOT DETERMINISTIC, so my function is not deterministic. It is also written in SQL (the default) and is not a READS SQL DATA, since it writes or modifies records. So, I registered NOT DETERMINISTIC and nothing has changed ... How can I overcome this error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2018-05-24
@immelnikoff

Actually, the answer to your question lies in the text of the error.
You are using binary logs, which contain only the sequence of queries being executed. Since your function is non-deterministic, it may return different values ​​each time it is called from the same state, so MySQL cannot guarantee accurate replication and/or recovery of data from the binary log.
https://dev.mysql.com/doc/refman/5.7/en/stored-pro...

I
iljaGolubev, 2018-05-24
@iljaGolubev

try adding log_bin_trust_function_creators = 1;
reed this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question