MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
connection_load.inc
1 # Tests for the performance schema
2 
3 # =======================================
4 # HELPER include/connection_load.inc
5 # =======================================
6 
7 call dump_all();
8 
9 connect (con1a, localhost, user1, , );
10 select "user1 in con1a" as status;
11 call dump_all();
12 
13 connect (con1b, localhost, user1, , );
14 select "user1 in con1b" as status;
15 call dump_all();
16 
17 connect (con1c, localhost, user1, , );
18 select "user1 in con1c" as status;
19 call dump_all();
20 
21 connect (con2a, localhost, user2, , );
22 select "user2 in con2a" as status;
23 call dump_all();
24 
25 connect (con2b, localhost, user2, , );
26 select "user2 in con2b" as status;
27 call dump_all();
28 
29 connect (con2c, localhost, user2, , );
30 select "user2 in con2c" as status;
31 call dump_all();
32 
33 connect (con3a, localhost, user3, , );
34 select "user3 in con3a" as status;
35 call dump_all();
36 
37 connect (con3b, localhost, user3, , );
38 select "user3 in con3b" as status;
39 call dump_all();
40 
41 connect (con3c, localhost, user3, , );
42 select "user3 in con3c" as status;
43 call dump_all();
44 
45 --connection default
46 
47 --disconnect con1a
48 
49 # Wait for the disconnect to complete
50 let $wait_condition=
51  select count(*) = 8 from performance_schema.threads
52  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
53 --source include/wait_condition.inc
54 
55 select "con1a disconnected" as status;
56 call dump_all();
57 
58 --disconnect con2a
59 
60 # Wait for the disconnect to complete
61 let $wait_condition=
62  select count(*) = 7 from performance_schema.threads
63  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
64 --source include/wait_condition.inc
65 
66 select "con2a disconnected" as status;
67 call dump_all();
68 
69 --disconnect con3a
70 
71 # Wait for the disconnect to complete
72 let $wait_condition=
73  select count(*) = 6 from performance_schema.threads
74  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
75 --source include/wait_condition.inc
76 
77 select "con3a disconnected" as status;
78 call dump_all();
79 
80 truncate table performance_schema.accounts;
81 call dump_all();
82 truncate table performance_schema.users;
83 call dump_all();
84 truncate table performance_schema.hosts;
85 call dump_all();
86 
87 connect (con4a, localhost, user4, , );
88 select "user4 in con4a" as status;
89 call dump_all();
90 
91 connect (con4b, localhost, user4, , );
92 select "user4 in con4b" as status;
93 call dump_all();
94 
95 connect (con4c, localhost, user4, , );
96 select "user4 in con4c" as status;
97 call dump_all();
98 
99 --connection default
100 
101 --disconnect con1b
102 
103 # Wait for the disconnect to complete
104 let $wait_condition=
105  select count(*) = 8 from performance_schema.threads
106  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
107 --source include/wait_condition.inc
108 
109 select "con1b disconnected" as status;
110 call dump_all();
111 
112 --disconnect con2b
113 
114 # Wait for the disconnect to complete
115 let $wait_condition=
116  select count(*) = 7 from performance_schema.threads
117  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
118 --source include/wait_condition.inc
119 
120 select "con2b disconnected" as status;
121 call dump_all();
122 
123 --disconnect con3b
124 
125 # Wait for the disconnect to complete
126 let $wait_condition=
127  select count(*) = 6 from performance_schema.threads
128  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
129 --source include/wait_condition.inc
130 
131 select "con3b disconnected" as status;
132 call dump_all();
133 
134 --disconnect con1c
135 
136 # Wait for the disconnect to complete
137 let $wait_condition=
138  select count(*) = 5 from performance_schema.threads
139  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
140 --source include/wait_condition.inc
141 
142 select "con1c disconnected" as status;
143 call dump_all();
144 
145 --disconnect con2c
146 
147 # Wait for the disconnect to complete
148 let $wait_condition=
149  select count(*) = 4 from performance_schema.threads
150  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
151 --source include/wait_condition.inc
152 
153 select "con2c disconnected" as status;
154 call dump_all();
155 
156 --disconnect con3c
157 
158 # Wait for the disconnect to complete
159 let $wait_condition=
160  select count(*) = 3 from performance_schema.threads
161  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
162 --source include/wait_condition.inc
163 
164 select "con3c disconnected" as status;
165 call dump_all();
166 
167 truncate table performance_schema.accounts;
168 call dump_all();
169 truncate table performance_schema.users;
170 call dump_all();
171 truncate table performance_schema.hosts;
172 call dump_all();
173 
174 connect (con5a, localhost, user5, , );
175 select "user5 in con5a" as status;
176 call dump_all();
177 
178 connect (con5b, localhost, user5, , );
179 select "user5 in con5b" as status;
180 call dump_all();
181 
182 connect (con5c, localhost, user5, , );
183 select "user5 in con5c" as status;
184 call dump_all();
185 
186 --connection default
187 
188 --disconnect con4a
189 
190 # Wait for the disconnect to complete
191 let $wait_condition=
192  select count(*) = 5 from performance_schema.threads
193  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
194 --source include/wait_condition.inc
195 
196 --disconnect con4b
197 
198 # Wait for the disconnect to complete
199 let $wait_condition=
200  select count(*) = 4 from performance_schema.threads
201  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
202 --source include/wait_condition.inc
203 
204 --disconnect con4c
205 
206 # Wait for the disconnect to complete
207 let $wait_condition=
208  select count(*) = 3 from performance_schema.threads
209  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
210 --source include/wait_condition.inc
211 
212 --disconnect con5a
213 
214 # Wait for the disconnect to complete
215 let $wait_condition=
216  select count(*) = 2 from performance_schema.threads
217  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
218 --source include/wait_condition.inc
219 
220 --disconnect con5b
221 
222 # Wait for the disconnect to complete
223 let $wait_condition=
224  select count(*) = 1 from performance_schema.threads
225  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
226 --source include/wait_condition.inc
227 
228 --disconnect con5c
229 
230 # Wait for the disconnect to complete
231 let $wait_condition=
232  select count(*) = 0 from performance_schema.threads
233  where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
234 --source include/wait_condition.inc
235 
236 select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
237 call dump_all();
238 
239 truncate table performance_schema.hosts;
240 call dump_all();
241 truncate table performance_schema.users;
242 call dump_all();
243 truncate table performance_schema.accounts;
244 call dump_all();
245