MySQL Forums
Forum List  »  Stored Procedures

Error 1329 even with continue handler and rows returned
Posted by: Josh Higham
Date: October 31, 2012 09:36PM

This has me pretty confused. I've done a lot of searching about the error, I have the continue handler set correctly, and I've reduced the procedure down to bare bones and confirmed that it is in fact selecting data in the cursor (and then displaying it).

However, I still get the error 1329.

mysql> drop procedure if exists add_tier_weight;
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter |
mysql> create procedure add_tier_weight(IN fix_date date)
-> begin
-> declare done int default false;
-> declare fix_id int;
-> declare fix_weight float;
->
-> declare cur cursor for select ptr.player_id, battle_count
-> from player_tank_record ptr inner join tank t on ptr.tank_id = t.id
-> where ptr.insert_date = '2012-07-02' limit 0,10;
->
-> declare continue handler for not found set done = 1;
->
-> open cur;
-> read_loop: loop
-> fetch cur into fix_id, fix_weight;
-> if done then
-> close cur;
-> leave read_loop;
-> end if;
-> select fix_id, fix_weight;
-> end loop;
-> end|
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql> call add_tier_weight('2012-07-02');
+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 528 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 293 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 198 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 141 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 131 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 117 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 108 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 103 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 102 |
+------------+------------+
1 row in set (0.00 sec)

+------------+------------+
| fix_id | fix_weight |
+------------+------------+
| 1000856112 | 80 |
+------------+------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+-------+------+-----------------------------------------------------+
| Level | Code | Message |
+-------+------+-----------------------------------------------------+
| Error | 1329 | No data - zero rows fetched, selected, or processed |
+-------+------+-----------------------------------------------------+
1 row in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
Error 1329 even with continue handler and rows returned
3327
October 31, 2012 09:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.