This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SET @@session.max_sp_recursion_depth = 255; | |
# CALL recalculateTree(NULL, 0, 0, @index); | |
CREATE PROCEDURE recalculateTree(IN parent INT, IN i INT, IN depth INT, OUT ri INT) | |
BEGIN | |
DECLARE done INT DEFAULT FALSE; | |
DECLARE n_id INT; | |
DECLARE n_parent_id INT; |