--echo ## --echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST. --echo ## --echo ## Test cases: --echo ## 1. Execute the new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist --echo ## 2. Execute the legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist --echo ## 3. Verify that performance_schema_show_processlist = ON executes the new implementation --echo ## 4. Verify that performance_schema_show_processlist = OFF executes the legacy code path --echo ## --echo ## Results must be manually verified. --source include/no_protocol.inc --source include/have_debug.inc --source include/have_debug_sync.inc --source include/not_embedded.inc --echo --echo ### Setup ### --echo select @@global.performance_schema_show_processlist into @save_processlist; --echo create user user1@localhost, user2@localhost, user3@localhost, user4@localhost; --echo grant ALL on *.* to user1@localhost; grant ALL on *.* to user2@localhost; grant ALL on *.* to user3@localhost; grant ALL on *.* to user4@localhost; --echo flush privileges; --echo use test; create table test.t1 (s1 int, s2 int, s3 int, s4 int); --echo --echo # Switch to (con0, localhost, root, , ) connect (con0, localhost, root, , ); --echo insert into test.t1 values(1, 1, 1, 1); insert into test.t1 values(2, 2, 2, 2); insert into test.t1 values(3, 3, 3, 3); insert into test.t1 values(4, 4, 4, 4); --echo --echo # Lock test.t1, insert/update/deletes will block lock tables t1 read; --echo --echo # Connect (con1, localhost, user1, , ) connect (con1, localhost, user1, , ); --send insert into test.t1 values (0, 0, 0, 0) --echo --echo # Connect (con2, localhost, user2, , ) connect (con2, localhost, user2, , ); # Create a query > 100 characters --send update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999; --echo --echo # Connect (con3, localhost, user3, , ) connect (con3, localhost, user3, , ); --send delete from test.t1 where s1 = 3 --echo --echo # Connect (con4, localhost, user4, , ) connect (con4, localhost, user4, , ); --send insert into test.t1 values (4, 4, 4, 4) --echo --echo # Connection default --connection default --echo --echo # Wait for queries to appear in the processlist table let $wait_condition = select count(*) >= 4 from information_schema.processlist where state like '%metadata%'; --source include/wait_condition.inc --echo --echo --echo ### Execute new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist --echo let $pfs_spl = on; --source ../include/processlist_set.inc --source ../include/processlist_load.inc --echo --echo --echo ### Execute legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist --echo let $pfs_spl = off; --source ../include/processlist_set.inc --source ../include/processlist_load.inc --echo --echo --echo ### Verify feature code path --echo --echo # Enable SHOW PROCESSLIST via the Performance Schema let $pfs_spl = on; --source ../include/processlist_set.inc --echo --echo # Connection default, send SHOW PROCESSLIST --connection default SET DEBUG_SYNC='pfs_show_processlist_performance_schema SIGNAL pfs_processlist_pfs WAIT_FOR continue'; --send SHOW FULL PROCESSLIST --echo --echo # Connection con0 --connection con0 SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_pfs'; SET DEBUG_SYNC='now SIGNAL continue'; --echo --echo # Connection default, reap --connection default --replace_column 1 3 5 6