The following error is returned when trying to use a MySQL 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)
I couple of days ago I started using replication..? Don't know if this could have an incluence on it?! But I know one thing - it has worked :)
If I try to override (add the function again) the same error occurs..
The function
DELIMITER $$
DROP FUNCTION IF EXISTS `stock_in_stock_ids` $$
CREATE DEFINER=`dynaccount`@`localhost` FUNCTION `stock_in_stock_ids`(_running_total_limit INT, _product_id INT, _group_id INT) RETURNS TEXT
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE _running_count INT default 0;
DECLARE _id INT;
DECLARE _count INT;
DECLARE _ids TEXT DEFAULT NULL;
DECLARE _cur CURSOR FOR SELECT id, count FROM stock WHERE group_id=_group_id && type=2 && product_id=_product_id ORDER BY time DESC, id DESC;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN _cur;
read_loop: LOOP
FETCH _cur INTO _id, _count;
IF done THEN
SET _ids = '0';
LEAVE read_loop;
END IF;
SET _running_count = _running_count + _count;
SET _ids = CONCAT_WS(',', _ids, _id);
IF _running_count >= _running_total_limit THEN
LEAVE read_loop;
END IF;
END LOOP read_loop;
CLOSE _cur;
RETURN _ids;
END $$
DELIMITER ;