Hello there.
First of all I must say that I am a newbie when it comes to MySQL Database.

Here is my problem in the STORED PROCEDURE kill_run_aways.
Code:
ERROR 1109: Unknown table 'processlist' in information_schema
But if I try:
Code:
mysql> SHOW FULL PROCESSLIST;
+----+------+----------------+--------------------+---------+------+-------+-----------------------+
| Id | User | Host           | db                 | Command | Time | State | Info                  |
+----+------+----------------+--------------------+---------+------+-------+-----------------------+
| 40 | root | localhost:4049 | db_xxx_clone       | Sleep   |  198 |       | NULL                  |
| 41 | root | localhost:4050 | db_xxx_clone       | Sleep   |  198 |       | NULL                  |
| 42 | root | localhost:4074 | NULL               | Sleep   |  503 |       | NULL                  |
| 43 | root | localhost:4075 | db_xxx_clone       | Sleep   |  491 |       | NULL                  |
| 44 | root | localhost:4076 | db_xxx_clone       | Sleep   |  467 |       | NULL                  |
| 46 | root | localhost:4101 | information_schema | Sleep   |  400 |       | NULL                  |
| 47 | root | localhost:4102 | information_schema | Sleep   |  373 |       | NULL                  |
| 49 | root | localhost:4192 | information_schema | Query   |    0 | NULL  | SHOW FULL PROCESSLIST |
+----+------+----------------+--------------------+---------+------+-------+-----------------------+
8 rows in set

mysql>
If you have link for similar task, please give it me.
Can you explain any one or any sample code related this.

Your help would be very appreciated.
thanks for your time and hints.

Thanks in advance,
Chevy.


Code:
SQL Statement:

CREATE PROCEDURE `db_xxx_clone`.`kill_run_aways` (IN runtime TINYINT UNSIGNED)

        LANGUAGE SQL

        NOT DETERMINISTIC

        BEGIN

        DECLARE done INT DEFAULT 0;

        DECLARE connid INT UNSIGNED;

        DECLARE cur1 CURSOR FOR SELECT ID FROM information_schema.PROCESSLIST 

            WHERE CONCAT ("'", USER, "'@'", SUBSTRING_INDEX(HOST,':',1), "'") IN 

                ( SELECT `USER_PRIVILEGES`.`GRANTEE` AS `GRANTEE` FROM `information_schema`.`USER_PRIVILEGES` 

                    WHERE NOT(`USER_PRIVILEGES`.`GRANTEE` IN 

                        (SELECT GRANTEE FROM `information_schema`.`USER_PRIVILEGES` 

                            WHERE `USER_PRIVILEGES`.`PRIVILEGE_TYPE` = 'SUPER' GROUP BY `USER_PRIVILEGES`.`GRANTEE`))) 

            AND COMMAND ='Query'

            AND TIME >= runtime;



        DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;



        OPEN cur1;



        REPEAT

                FETCH cur1 INTO connid;

                IF NOT done THEN

                        KILL connid;

                END IF;

        UNTIL done END REPEAT;

        CLOSE cur1;

        END