when testing the statement that creates the function locally, there is no error. In production, 1418 error is reported, as shown in the following figure
(picture from network)
searched https://blog.csdn.net/yown/ar. and http://blog.sina.com.cn/s/blo., I probably understood the reason
and decided to add the declaration of function type, but I still have some questions about how to choose the value. Here are three common functions. How to choose the function type, thank you!
CREATE FUNCTION currval(v_seq_name VARCHAR(50)) RETURNS int(11)
READS SQL DATA
BEGIN
DECLARE val INTEGER;
SET val = 0;
SELECT current_val INTO val FROM sequence WHERE seq_name = v_seq_name;
RETURN val;
END;
CREATE FUNCTION nextval(v_seq_name VARCHAR(50)) RETURNS int(11)
-- DETERMINISTIC
DETERMINISTIC
BEGIN
UPDATE sequence
SET current_val = current_val + increment_val
WHERE seq_name = v_seq_name;
RETURN currval (v_seq_name);
END;
CREATE FUNCTION split_str(
x VARCHAR (1000),
delim VARCHAR (10),
pos INT
) RETURNS varchar(1000)
NO SQL
RETURN REPLACE (
SUBSTRING(
SUBSTRING_INDEX(x, delim, pos),
LENGTH(
SUBSTRING_INDEX(x, delim, pos - 1)
) + 1
),
delim,
""
);