zoukankan      html  css  js  c++  java
  • 自定义mysql函数时报错,[Err] 1418

      今天在我执行自定义mysql函数的SQL时发生了错误,SQL如下:

    /**
    自定义mysql函数 getChildList
    */
    delimiter //
    CREATE FUNCTION `pengwifi_wifi`.`getChildList`(rootId INT)
    RETURNS varchar(1000)

    BEGIN
    DECLARE sTemp VARCHAR(1000);
    DECLARE sTempChd VARCHAR(1000);

    SET sTemp = '$';
    SET sTempChd =cast(rootId as CHAR);

    WHILE sTempChd is not null DO
    SET sTemp = concat(sTemp,',',sTempChd);
    SELECT group_concat(id) INTO sTempChd FROM hui_class where FIND_IN_SET(parent_id,sTempChd)>0;
    END WHILE;
    RETURN sTemp;
    END
    //

    报错信息:[Err] 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)

    解决方法:set global log_bin_trust_function_creators=TRUE;

  • 相关阅读:
    Java基础知识整理
    HashMap源码解读(JDK1.7)
    书籍列表
    mysql4
    mysql3
    mysql2
    mysql1
    数据结构4
    数据结构3
    数据结构2
  • 原文地址:https://www.cnblogs.com/zhangxiaoliu/p/5786782.html
Copyright © 2011-2022 走看看