MySQL: recursion in stored procedures
Recursion in MySQL stored procedures is allowed but disabled by default.
So if you are using recursion and getting error like ‘Recursive limit 0 was exceeded for routine TestMyRecursion’, just enable recursion by setting the max_sp_recursion_depth server system variable to a value greater than zero:
SET @@SESSION.max_sp_recursion_depth = 100; CALL TestMyRecursion(); SET @@SESSION.max_sp_recursion_depth = 0; |