DELIMITER $$
CREATE PROCEDURE curdemo()
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE b, c INT;
DECLARE cur1 CURSOR FOR SELECT empid FROM test.mytable;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cur1;
read_loop: LOOP
FETCH cur1 INTO b;
IF done THEN
LEAVE read_loop;
END IF;
INSERT INTO test.test_log VALUES (b,'test');
CLOSE cur1;
END $$
编译此代码时出现 1064 错误,有人可以帮我找到错误吗