File: show_processlist.test

package info (click to toggle)
mysql-5.5 5.5.60-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 201,012 kB
  • sloc: cpp: 648,063; ansic: 552,041; perl: 48,017; pascal: 25,099; sh: 15,065; yacc: 13,088; cs: 4,647; xml: 4,178; sql: 3,380; makefile: 1,368; lex: 639; awk: 54
file content (63 lines) | stat: -rw-r--r-- 2,684 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
###############################################################################
--echo Bug#17283409  4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS, SHOW PROCESSLIST,
--echo SHOW BINLOGS
# After the fix for bug 17283409, We allow new connections while processing
# 'SHOW PROCESSLIST' command. This test script is to prove that even though we
# allow new connections to come in, 'SHOW PROCESSLIST' will not consider them,
# hence there is no worry of 'SHOW PROCESSLIST' going into a infinite loop if
# new connections are coming in continously.
###############################################################################
--source include/have_debug_sync.inc
--source include/count_sessions.inc
--enable_connect_log
connect(connection1,localhost,root,,test,$MASTER_MYPORT,);
--connection default
SET DEBUG_SYNC='before_one_element_read_from_threads_iterator SIGNAL parked1 WAIT_FOR go';
--send SHOW PROCESSLIST
--connection connection1
echo "Wait_for parked1";
SET DEBUG_SYNC='now WAIT_FOR parked1';
connect(connection2,localhost,root,,test,$MASTER_MYPORT,);
connect(connection3,localhost,root,,test,$MASTER_MYPORT,);
SET DEBUG_SYNC='now SIGNAL go';

--connection default
# We are yet to read the first element from the iterator when connection 2 and
# connection 3 joined the system. So this will show all 4 connections
# ( default + connection 1,2,3).
--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
--reap

# Test 2: To prove that connections which joined after reading the
# first element from the thread iterator will not be entertained
SET DEBUG_SYNC='after_one_element_read_from_threads_iterator SIGNAL parked1 WAIT_FOR go';
--send SHOW PROCESSLIST

--connection connection1
echo "Wait_for parked1";
SET DEBUG_SYNC='now WAIT_FOR parked1';
connect(connection4,localhost,root,,test,$MASTER_MYPORT,);
connect(connection5,localhost,root,,test,$MASTER_MYPORT,);
SET DEBUG_SYNC='now SIGNAL go';
--connection default
# This will show 4 connections only ( default + connection 1,2,3 ).  Connections
# (connection4, connection 5) which entered after reading the first element
# from the iterator will not be processed by show processlist.
--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
--reap

#Now try the command once again.
# This will show 6 connections ( default + connection 1,2,3,4,5 )
--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
SHOW PROCESSLIST;

--echo "Cleanup"
# Reset DEBUG_SYNC
SET DEBUG_SYNC='RESET';
--disconnect connection1
--disconnect connection2
--disconnect connection3
--disconnect connection4
--disconnect connection5
--disable_connect_log
--source include/wait_until_count_sessions.inc