I want to create a function that basically returns a random string. I don't know what characteristics to assign in this situation. I'm also in an environment that uses binary logging.
Here's a simplified version of my function:
CREATE FUNCTION `MYRAND`() RETURNS char(10) NOT DETERMINISTIC
RETURN CONCAT('rand_', FLOOR(RAND() * 10000));
I get this error when creating the function in my environment.
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)
Possible characteristics:
NOT DETERMINISTIC- used because this function returns random valuesREADS/MODIFIES SQL DATA- Function does not read data from tablesNO SQL- I am calling other SQL functions (RAND) so I'm not sure if I should be specifying this or not...
Any advice on how to properly define this function when binary logging is enabled would be appreciated.
NO SQLwould be correct.RAND()is not an "SQL function". - Paul SpiegelNOT DETERMINISTIC, or does that only pertain to data access/modification? - mark