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; ...
随机推荐
- spring /* 和 /** 的 区别。
例如 /** 拦截 /index/1 和 /index /* 代表 /index/1 而 /index 则不会被拦截
- P1984 [SDOI2008]烧水问题(具体证明)
传送门 我见过的第二恶心的题,第一是糖果传递... 以下是一堆具体的证明,自己想的,可能考虑不周,不想看也可以直接看结论 首先有一个很显然的贪心,烧开的水要尽量把热量传递出去 所以有一个比较显然的方法 ...
- 02-----body签中相关标签
大纲 字体标签: h1~h6.<font>.<u>.<b>.<strong><em>.<sup>.<sub> 排版标 ...
- 10g duplicate and 11g dupliacte db for standby
###################10g Creating a Physical Standby Database OASSTBY Make sure database is in archive ...
- HDU 5792 L - World is Exploding 。容斥原理 + 树状数组 + 离散化
题目,要求找出有多少对这样的东西,四个数,并且满足num[a]<num[b] &&num[c]>num[d] 要做这题,首先要懂得用树状数组,我设,下面的小于和大于都是严格 ...
- linux 编程笔记1 crusher for linux
1.反显示字符crusher #include <stdio.h> int main (int argc, char *argv[]) { printf("\033[7m mor ...
- IDEA使用汇总
1. 常用配置 File --> Settings (Ctrl + Alt + S) 1).提示不区分大小写: Editor-->Genereal-->Code Completion ...
- ElasticSearch:华为云搜索CSS 之POC操作记录
2019/03/06 09:00 ES文档官方:https://support.huaweicloud.com/usermanual-es/es_01_0024.html 华为云区域:华北北京1 ES ...
- springboot 学习笔记(九)
springboot整合activemq,实现broker集群部署(cluster) 1.为实现jms高并发操作,需要对activemq进行集群部署,broker cluster就是activemq自 ...
- 构建第一个Spring Boot2.0应用之项目创建(一)
1.开发环境 IDE: JAVA环境: Tomcat: 2.使用Idea生成spring boot项目 以下是使用Idea生成基本的spring boot的步骤. (1)创建工程第一步 (2)创建工 ...