# dumps the content of P_S tables # Start mysqld with "./mtr --start" then do # ../client/mysql --html -uroot -S var/tmp/mysqld.1.sock < /m/wl2360/dump_all_pfs.sql > /tmp/dump_all_pfs.html # generates some events related to tables use test; select connection_id(); drop table if exists crocodile; create table crocodile(a int); insert into crocodile values(1); use performance_schema; delimiter | ; drop procedure if exists allPS; CREATE PROCEDURE allPS() BEGIN DECLARE done INT DEFAULT 0; declare tbl_name varchar(100); DECLARE cur1 CURSOR FOR select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA="performance_schema" order by 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur1; REPEAT FETCH cur1 INTO tbl_name; IF NOT done THEN SET @str = CONCAT("SELECT 'Content of ", tbl_name, "'"); PREPARE stmt FROM @str; EXECUTE stmt; SET @str = CONCAT("SELECT * FROM ", tbl_name, " ORDER BY 1"); PREPARE stmt FROM @str; EXECUTE stmt; END IF; UNTIL done END REPEAT; CLOSE cur1; END| delimiter ;| CALL allPS();