kindquiet素食勤俭敬老孝慈

学习mysql 5 权威指南

mysql 5.1.39,建立一个存储过程

BEGIN

IF ISNULL(s) THEN

RETURN ‘’;

ELSEIF n15 THEN

RETURN LEFT(s, n);

ELSE

IF CHAR_LENGTH(s) = n THEN

RETURN s;

ELSE

RETURN CONCAT(LEFT(s, n-10), ‘ … ‘, RIGHT(s, 5));

END IF;

END IF;

END

ERROR 1418 (HY000): 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)

解决:

mysql set global log_bin_trust_routine_creators=1;