1 drop procedure if exists fix_all_vectors
;
2 drop function if exists get_fix_vector
;
4 /* compute correct vector for node */
5 create function get_fix_vector (node
INT) returns varchar(80)
7 declare np
,mynode
,safe
int;
8 declare vector
varchar(80);
10 set safe
=100; /* loop detection, max tree depth*/
14 select node_parent
into np
from nodes
where node_id
= mynode
;
15 select concat(lpad(mynode
,8,'00000000'),vector
) into vector
;
18 UNTIL np
= NULL or np
= 0 or safe
= 0 or np
= node
28 /* fix vector for all the nodes*/
29 create procedure fix_all_vectors ()
31 update nodes
set node_vector
=get_fix_vector(node_id
);
This page took 0.480343 seconds and 4 git commands to generate.