title: Mysql-Events: How get rid of Errors like No Data-zero rows fetched?
body: <p>I just try to kill mysql jobs using event scheduler.
  Unfortunately the event scheduler fills up my log file with error messages:
  <strong>No Data - zero rows fetched</strong></p>
  
  <p>But I am catching the No data exception. </p>
  
  <p>Why event still throws an error?</p>
  
  <pre><code>CREATE PROCEDURE `kill_run_aways`( IN runtime INT(7), IN username VARCHAR(32) )
  BEGIN
          DECLARE done INT DEFAULT 0;
          DECLARE connid INT UNSIGNED;
          DECLARE cur1 CURSOR FOR SELECT ID FROM information_schema.PROCESSLIST 
              WHERE  COMMAND ='Query'
              AND TIME &gt;= runtime AND USER = username;
  
          DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
          DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
  
          OPEN cur1;
  
          REPEAT
                  FETCH cur1 INTO connid;
                  IF NOT done THEN
                      select * from information_schema.PROCESSLIST where connid=ID;
                      KILL connid;
                  END IF;
          UNTIL done END REPEAT;
          CLOSE cur1;
    END;
  </code></pre>
  
  <p>Thanks Arman.</p>