I am using the below function to split a string. I am getting the following error when I try to create the function on my live database:
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled.
The function doesn't actually hit the database at all. All it does is breakup a string. So if I send in '1,2,3,4' it splits them up. How do I get past this error? I am not actually modifying any tables.
DELIMITER ;;
CREATE FUNCTION `stringSplit`(
x VARCHAR(255),
delim VARCHAR(12),
pos INT) RETURNS varchar(255) CHARSET latin1
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, ',', pos),
LENGTH(SUBSTRING_INDEX(x, delim, pos -1)) + 1), delim, '') ;;
DELIMITER ;
****** Update ******
I am getting the following error code.
ERROR 1419 (HY000): You do not have the SUPER privilege and binary logging is enabled
I think it is correct by adding 'DETERMINISTIC' before the return statement. I think this is a different issue dealing with privileges.