Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error:
- #1436 - Thread stack overrun: 6892 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.
- BEGIN
- DECLARE pid, gid INT;
- DECLARE done INT DEFAULT 0;
- DECLARE pcity, gcity VARCHAR(64);
- DECLARE gcur CURSOR FOR SELECT * FROM `guests`;
- DECLARE pcur CURSOR FOR SELECT `id`, `city` FROM `people` WHERE `id` = gid;
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
- OPEN gcur;
- REPEAT
- FETCH gcur INTO gid, gcity;
- OPEN pcur;
- FETCH pcur INTO pid, pcity;
- IF gcity <> pcity THEN
- UPDATE `guests` SET `city` = pcity WHERE `id` = gid;
- END IF;
- CLOSE pcur;
- UNTIL done END REPEAT;
- CLOSE gcur;
- END
Advertisement
Add Comment
Please, Sign In to add comment