Mysql5.7自定义函数递归报错1424 Recursive stored functions and triggers are not allowed
示例:
DELIMITER $$
CREATE FUNCTION test(countnum INT)
RETURNS INT DETERMINISTIC
BEGIN
DECLARE tempnum INT DEFAULT 0;
IF countnum > 2 THEN
RETURN ROW_COUNT();
END IF;
SET countnum = countnum+1;
SELECT test(countnum) INTO tempnum;
END $$
DELIMITER ;
SELECT test(1);
当我调用自定义函数时会抛出 Recursive stored functions and triggers are not allowed(不允许递归存储函数和触发器。)
函数是不支持递归,但是可以用存储过程递归
示例:
DELIMITER $$
CREATE PROCEDURE test(countnum INT)
end_flag:
BEGIN
DECLARE tempnum INT DEFAULT 0;
IF countnum > 2 THEN
SELECT '满足条件结束存储过程';
LEAVE end_flag;
END IF;
SET countnum = countnum+1;
CALL test(countnum);
END $$
DELIMITER ;
CALL test(1);
执行存储过程可能会抛出:
1456
Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine test
max_sp_recursion_depth :递归调用的最大深度
可以执行:SET GLOBAL max_sp_recursion_depth =层级数;
Mysql5.7自定义函数递归报错1424 Recursive stored functions and triggers are not allowed的更多相关文章
- mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
注:本文来源于< mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy r ...
- mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg
mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg ...
- php通过JavaBridge调用Java类库和不带包的自定义java类成功 但是调用带包的自定义Java类报错,该怎么解决
php通过JavaBridge调用Java类库和不带包的自定义java类成功 但是调用带包的自定义Java类报错,Class.forName("com.mysql.jdbc.Driver&q ...
- android studio 自定义路径安装报错"You are attempting to install the android SDK
android studio 自定义路径安装报错"You are attempting to install the android SDK 解决方法: 出现这个提示 主要是安装 Andro ...
- unity3d MonoDevelop引用外部自定义dll文件报错:are you missing an assembly reference?
在unity3d 编辑器 MonoDevelop 中引用外部自定义dll文件报错:are you missing an assembly reference? 因为unity还停留在.NET Fram ...
- 【GitLab】gitlab上配置webhook后,点击测试报错:Requests to the local network are not allowed
gitlab上配置webhook后,点击测试报错: Requests to the local network are not allowed 操作如下: 报错: 错误原因: gitlab 10.6 ...
- 【mysql】 load local data infield 报错 ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql> load data local infile '/Users/flint/learn/mysql/pet' into table bx_pet; 执行报错 ERROR 1148 ( ...
- Django 自定义模板标签 报错django.template.exceptions.TemplateSyntaxError: '####' is not a registered tag library. Must be one of:
我写代码遇到这个错误,但是发现程序没有写错,好像是程序有缓存,重新运行几次就好了. 自定义模板标签,可以不用写views,url直接通过自定义函数把变量传给模板. 具体实现: 1.在app下新建Pyt ...
- setInterval()调用其他函数时候报错
(function(){ function shortcut() { // 配件优化 window.topValue = 0// 上次滚动条到顶部的距离 window.interval = null; ...
随机推荐
- 关于MySQL AUDIT(审计)那点事
2017年06月02日MySQL社区版本最新版为MySQL_5.7.18,但是该版本不带AUDIT功能(MySQL Enterprise Edition自带AUDIT功能),因此需要加载plugin( ...
- View转换为Bitmap及getDrawingCache
View组件显示的内容可以通过cache机制保存为bitmap, 使用到的api有 void setDrawingCacheEnabled(boolean flag), Bitmap get ...
- vbox 挂载共享文件时可能出现的问题以及对应的解决办法
VMBox挂载共享文件时可能出现的问题以及对应的解决办法 如果出现“未能加载虚拟光盘***.iso 到虚拟电脑的错误” : 左边一栏,右键光盘,eject,再安装
- UnityError 打包到Android错误解决
- centos服务器nginx相关命令
1.找到nginx路径: ps aux | grep nginx -> /usr/local/nginx/sbin/nginx 2.nginx配置检查: /usr/local/nginx/sbi ...
- ssh无需密码登录linux服务器
使用下例中ssky-keygen和ssh-copy-id,仅需通过3个步骤的简单设置而无需输入密码就能登录远程Linux主机. ssh-keygen 创建公钥和密钥. ssh-copy-id 把本地主 ...
- POJ 3268——Silver Cow Party——————【最短路、Dijkstra、反向建图】
Silver Cow Party Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Su ...
- UVALive 4261——Trip Planning——————【dp+打印路径】
Trip Planning Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Stat ...
- JQuery基础知识==认识JQuery
jQuery API 中文文档:https://www.jquery123.com/ jQuery Mobile 菜鸟教程:http://www.runoob.com/jquerymobile/jqu ...
- Bugzilla-5.0.3 (OpenLogic CentOS 7.2)
平台: CentOS 类型: 虚拟机镜像 软件包: apache2.4.6 bugzilla5.0.3 mariadb5.5.47 perl5.16.3 apache bug tracking bug ...