summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema/include/connection_load.inc
blob: 16fc136f842ddd808ca698931d153762e867af62 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# Tests for the performance schema

# =======================================
# HELPER include/connection_load.inc
# =======================================

call dump_all();

connect (con1a, localhost, user1, , );
select "user1 in con1a" as status;
call dump_all();

connect (con1b, localhost, user1, , );
select "user1 in con1b" as status;
call dump_all();

connect (con1c, localhost, user1, , );
select "user1 in con1c" as status;
call dump_all();

connect (con2a, localhost, user2, , );
select "user2 in con2a" as status;
call dump_all();

connect (con2b, localhost, user2, , );
select "user2 in con2b" as status;
call dump_all();

connect (con2c, localhost, user2, , );
select "user2 in con2c" as status;
call dump_all();

connect (con3a, localhost, user3, , );
select "user3 in con3a" as status;
call dump_all();

connect (con3b, localhost, user3, , );
select "user3 in con3b" as status;
call dump_all();

connect (con3c, localhost, user3, , );
select "user3 in con3c" as status;
call dump_all();

--connection default

--disconnect con1a

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 8 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con1a disconnected" as status;
call dump_all();

--disconnect con2a

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 7 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con2a disconnected" as status;
call dump_all();

--disconnect con3a

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 6 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con3a disconnected" as status;
call dump_all();

truncate table performance_schema.accounts;
call dump_all();
truncate table performance_schema.users;
call dump_all();
truncate table performance_schema.hosts;
call dump_all();

connect (con4a, localhost, user4, , );
select "user4 in con4a" as status;
call dump_all();

connect (con4b, localhost, user4, , );
select "user4 in con4b" as status;
call dump_all();

connect (con4c, localhost, user4, , );
select "user4 in con4c" as status;
call dump_all();

--connection default

--disconnect con1b

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 8 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con1b disconnected" as status;
call dump_all();

--disconnect con2b

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 7 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con2b disconnected" as status;
call dump_all();

--disconnect con3b

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 6 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con3b disconnected" as status;
call dump_all();

--disconnect con1c

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 5 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con1c disconnected" as status;
call dump_all();

--disconnect con2c

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 4 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con2c disconnected" as status;
call dump_all();

--disconnect con3c

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 3 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con3c disconnected" as status;
call dump_all();

truncate table performance_schema.accounts;
call dump_all();
truncate table performance_schema.users;
call dump_all();
truncate table performance_schema.hosts;
call dump_all();

connect (con5a, localhost, user5, , );
select "user5 in con5a" as status;
call dump_all();

connect (con5b, localhost, user5, , );
select "user5 in con5b" as status;
call dump_all();

connect (con5c, localhost, user5, , );
select "user5 in con5c" as status;
call dump_all();

--connection default

--disconnect con4a
--disconnect con4b
--disconnect con4c
--disconnect con5a
--disconnect con5b
--disconnect con5c

# Wait for the disconnect to complete
let $wait_condition=
  select count(*) = 0 from performance_schema.threads
  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc

select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
call dump_all();

truncate table performance_schema.hosts;
call dump_all();
truncate table performance_schema.users;
call dump_all();
truncate table performance_schema.accounts;
call dump_all();