Handler Issus with MySQL

Working with MySQL 5.5.9, I ran into an issue where a cursor loop in 1 procedure was getting stopped by the INSERT … SELECT in a called procedure. The fix was not pretty but was effective: put a SET in the code to force the HANDLER back to FALSE(0) after the CALL that was setting it to TRUE(1).

CREATE PROCEDURE p_each_value( in_value INT )
BEGIN
  INSERT IGNORE INTO table1 (v1, v2)
  SELECT v1, v2 FROM table2 WHERE v3=in_value
END

CREATE PROCEDURE p_all ()
BEGIN
    DECLARE my_id INT;
    DECLARE finished INT(1) DEFAULT 0;

    DECLARE my_cursor CURSOR FOR
      SELECT v3 FROM table2;

    DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = 1;

    OPEN my_cursor;
    my_loop: LOOP
       FETCH my_cursor INTO my_id;
       IF finished THEN
         LEAVE my_loop;
       END IF;
       CALL p_each_value( my_id );
       SET finished = 0;
    END LOOP my_loop;
    CLOSE my_cursor;
END