Debian Codegraph @

mysql-test/suite/perfschema/r/statement_program_lost_inst.result

raw
1 show databases;
2 Database
3 information_schema
4 mtr
5 mysql
6 performance_schema
7 sys
8 test
9 select count(*) from performance_schema.performance_timers;
10 count(*)
11 5
12 select count(*) from performance_schema.setup_consumers;
13 count(*)
14 16
15 select count(*) > 4 from performance_schema.setup_instruments;
16 count(*) > 4
17 1
18 select * from performance_schema.accounts;
19 select * from performance_schema.cond_instances;
20 select * from performance_schema.events_stages_current;
21 select * from performance_schema.events_stages_history;
22 select * from performance_schema.events_stages_history_long;
23 select * from performance_schema.events_stages_summary_by_account_by_event_name;
24 select * from performance_schema.events_stages_summary_by_host_by_event_name;
25 select * from performance_schema.events_stages_summary_by_thread_by_event_name;
26 select * from performance_schema.events_stages_summary_by_user_by_event_name;
27 select * from performance_schema.events_stages_summary_global_by_event_name;
28 select * from performance_schema.events_statements_current;
29 select * from performance_schema.events_statements_histogram_by_digest;
30 select * from performance_schema.events_statements_histogram_global;
31 select * from performance_schema.events_statements_history;
32 select * from performance_schema.events_statements_history_long;
33 select * from performance_schema.events_statements_summary_by_account_by_event_name;
34 select * from performance_schema.events_statements_summary_by_digest;
35 select * from performance_schema.events_statements_summary_by_host_by_event_name;
36 select * from performance_schema.events_statements_summary_by_thread_by_event_name;
37 select * from performance_schema.events_statements_summary_by_user_by_event_name;
38 select * from performance_schema.events_statements_summary_global_by_event_name;
39 select * from performance_schema.events_transactions_current;
40 select * from performance_schema.events_transactions_history;
41 select * from performance_schema.events_transactions_history_long;
42 select * from performance_schema.events_transactions_summary_by_account_by_event_name;
43 select * from performance_schema.events_transactions_summary_by_host_by_event_name;
44 select * from performance_schema.events_transactions_summary_by_thread_by_event_name;
45 select * from performance_schema.events_transactions_summary_by_user_by_event_name;
46 select * from performance_schema.events_transactions_summary_global_by_event_name;
47 select * from performance_schema.events_waits_current;
48 select * from performance_schema.events_waits_history;
49 select * from performance_schema.events_waits_history_long;
50 select * from performance_schema.events_waits_summary_by_account_by_event_name;
51 select * from performance_schema.events_waits_summary_by_host_by_event_name;
52 select * from performance_schema.events_waits_summary_by_instance;
53 select * from performance_schema.events_waits_summary_by_thread_by_event_name;
54 select * from performance_schema.events_waits_summary_by_user_by_event_name;
55 select * from performance_schema.events_waits_summary_global_by_event_name;
56 select * from performance_schema.memory_summary_by_account_by_event_name;
57 select * from performance_schema.memory_summary_by_host_by_event_name;
58 select * from performance_schema.memory_summary_by_thread_by_event_name;
59 select * from performance_schema.memory_summary_by_user_by_event_name;
60 select * from performance_schema.memory_summary_global_by_event_name;
61 select * from performance_schema.events_errors_summary_by_account_by_error;
62 select * from performance_schema.events_errors_summary_by_host_by_error;
63 select * from performance_schema.events_errors_summary_by_thread_by_error;
64 select * from performance_schema.events_errors_summary_by_user_by_error;
65 select * from performance_schema.events_errors_summary_global_by_error;
66 select * from performance_schema.file_instances;
67 select * from performance_schema.file_summary_by_event_name;
68 select * from performance_schema.file_summary_by_instance;
69 select * from performance_schema.host_cache;
70 select * from performance_schema.hosts;
71 select * from performance_schema.memory_summary_by_account_by_event_name;
72 select * from performance_schema.memory_summary_by_host_by_event_name;
73 select * from performance_schema.memory_summary_by_thread_by_event_name;
74 select * from performance_schema.memory_summary_by_user_by_event_name;
75 select * from performance_schema.memory_summary_global_by_event_name;
76 select * from performance_schema.metadata_locks;
77 select * from performance_schema.mutex_instances;
78 select * from performance_schema.objects_summary_global_by_type;
79 select * from performance_schema.performance_timers;
80 select * from performance_schema.rwlock_instances;
81 select * from performance_schema.data_locks;
82 select * from performance_schema.data_lock_waits;
83 select * from performance_schema.session_account_connect_attrs;
84 select * from performance_schema.session_connect_attrs;
85 select * from performance_schema.setup_actors;
86 select * from performance_schema.setup_consumers;
87 select * from performance_schema.setup_instruments;
88 select * from performance_schema.setup_objects;
89 select * from performance_schema.setup_threads;
90 select * from performance_schema.socket_instances;
91 select * from performance_schema.socket_summary_by_instance;
92 select * from performance_schema.socket_summary_by_event_name;
93 select * from performance_schema.table_handles;
94 select * from performance_schema.table_io_waits_summary_by_index_usage;
95 select * from performance_schema.table_io_waits_summary_by_table;
96 select * from performance_schema.table_lock_waits_summary_by_table;
97 select * from performance_schema.threads;
98 select * from performance_schema.users;
99 select * from performance_schema.replication_connection_configuration;
100 select * from performance_schema.replication_connection_status;
101 select * from performance_schema.replication_applier_configuration;
102 select * from performance_schema.replication_applier_status;
103 select * from performance_schema.replication_applier_status_by_coordinator;
104 select * from performance_schema.replication_applier_status_by_worker;
105 select * from performance_schema.global_status;
106 select * from performance_schema.status_by_thread;
107 select * from performance_schema.status_by_user;
108 select * from performance_schema.status_by_host;
109 select * from performance_schema.status_by_account;
110 select * from performance_schema.session_status;
111 select * from performance_schema.global_variables;
112 select * from performance_schema.variables_by_thread;
113 select * from performance_schema.session_variables;
114 show engine PERFORMANCE_SCHEMA status;
115 show global status like "performance_schema%";
116 show global variables like "performance_schema_max_program_instances";
117 Variable_name Value
118 performance_schema_max_program_instances 7
119 show global variables like "performance_schema_max_statement_stack";
120 Variable_name Value
121 performance_schema_max_statement_stack 2
122 #####################
123 # Setup
124 #####################
125 # SET-UP
126 CREATE DATABASE nested_sp;
127 USE nested_sp;
128 CREATE TABLE t1(
129 id CHAR(16) NOT NULL DEFAULT '',
130 data INT NOT NULL
131 );
132 CREATE TABLE t2(
133 n INT UNSIGNED NOT NULL,
134 f BIGINT UNSIGNED
135 );
136 ############################
137 # Creating Stored Programs #
138 ############################
139 CREATE PROCEDURE c1(x INT)
140 CALL c2("c", x)|
141 CREATE PROCEDURE c2(s CHAR(16), x INT)
142 CALL c3(x, s)|
143 CREATE PROCEDURE c3(x INT, s CHAR(16))
144 CALL c4("level", x, s)|
145 CREATE PROCEDURE c4(l CHAR(8), x INT, s CHAR(16))
146 INSERT INTO t1 VALUES (concat(l,s), x)|
147 CREATE PROCEDURE iotest(x1 CHAR(16), x2 CHAR(16), y INT)
148 BEGIN
149 CALL inc2(x2, y);
150 INSERT INTO t1 VALUES (x1, y);
151 END|
152 CREATE PROCEDURE inc2(x CHAR(16), y INT)
153 BEGIN
154 CALL inc(y);
155 INSERT INTO t1 VALUES (x, y);
156 END|
157 CREATE PROCEDURE inc(inout io INT)
158 SET io = io + 1|
159 CREATE FUNCTION mul(x INT, y INT) RETURNS INT
160 RETURN x*y|
161 CREATE FUNCTION inc(i INT) RETURNS INT
162 RETURN i+1|
163 CREATE FUNCTION fac(n INT UNSIGNED) RETURNS BIGINT UNSIGNED
164 BEGIN
165 DECLARE f BIGINT UNSIGNED DEFAULT 1;
166 WHILE n > 1 DO
167 SET f = f * n;
168 SET n = n - 1;
169 END WHILE;
170 RETURN f;
171 END|
172 CREATE FUNCTION fun(i INT, u INT UNSIGNED) RETURNS DOUBLE
173 RETURN mul(inc(i), fac(u))|
174 CREATE PROCEDURE ifac(n INT UNSIGNED)
175 BEGIN
176 DECLARE i BIGINT UNSIGNED DEFAULT 1;
177 IF n > 20 THEN
178 SET n = 20; # bigint overflow otherwise
179 END IF;
180 WHILE i <= n DO
181 BEGIN
182 INSERT INTO t2 VALUES (i, fac(i));
183 SET i = i + 1;
184 END;
185 END WHILE;
186 END|
187 CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW
188 CALL ifac(10)|
189 TRUNCATE performance_schema.events_statements_summary_by_program;
190 SELECT OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA FROM
191 performance_schema.events_statements_summary_by_program
192 WHERE OBJECT_SCHEMA='nested_sp' ORDER BY OBJECT_NAME;
193 OBJECT_TYPE OBJECT_NAME OBJECT_SCHEMA
194 Flush status;
195 show global status like "%performance_schema_program_lost%";
196 Variable_name Value
197 Performance_schema_program_lost 0
198 show global status like "%performance_schema_nested_statement_lost%";
199 Variable_name Value
200 Performance_schema_nested_statement_lost 0
201 #####################
202 # Executing Queries
203 #####################
204 #####################
205 # Executing queries #
206 #####################
207 CALL c1(42);
208 SELECT * FROM t1;
209 id data
210 levelc 42
211 DELETE FROM t1;
212 CALL iotest("io1", "io2", 1);
213 SELECT * FROM t1 ORDER BY data DESC;
214 id data
215 io2 2
216 io1 1
217 DELETE FROM t1;
218 SELECT fun(6,10);
219 fun(6,10)
220 25401600
221 INSERT INTO t1 VALUES (20,13);
222 SELECT * FROM t2;
223 n f
224 1 1
225 2 2
226 3 6
227 4 24
228 5 120
229 6 720
230 7 5040
231 8 40320
232 9 362880
233 10 3628800
234 1 1
235 2 2
236 3 6
237 4 24
238 5 120
239 6 720
240 7 5040
241 8 40320
242 9 362880
243 10 3628800
244 1 1
245 2 2
246 3 6
247 4 24
248 5 120
249 6 720
250 7 5040
251 8 40320
252 9 362880
253 10 3628800
254 1 1
255 2 2
256 3 6
257 4 24
258 5 120
259 6 720
260 7 5040
261 8 40320
262 9 362880
263 10 3628800
264 ###########################################
265 # Quering PS statement summary table #
266 ###########################################
267 SELECT OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
268 FROM performance_schema.events_statements_summary_by_program
269 WHERE OBJECT_SCHEMA='nested_sp' ORDER BY OBJECT_NAME;
270 OBJECT_TYPE OBJECT_NAME OBJECT_SCHEMA
271 PROCEDURE c1 nested_sp
272 PROCEDURE c2 nested_sp
273 PROCEDURE c3 nested_sp
274 PROCEDURE c4 nested_sp
275 FUNCTION fac nested_sp
276 PROCEDURE ifac nested_sp
277 TRIGGER trg nested_sp
278 show global status like "%performance_schema_program_lost%";
279 Variable_name Value
280 Performance_schema_program_lost 6
281 show global status like "%performance_schema_nested_statement_lost%";
282 Variable_name Value
283 Performance_schema_nested_statement_lost 1062
284 #####################
285 # Cleanup
286 #####################
287 DROP PROCEDURE c4;
288 DROP PROCEDURE c3;
289 DROP PROCEDURE c2;
290 DROP PROCEDURE c1;
291 DROP PROCEDURE inc;
292 DROP PROCEDURE inc2;
293 DROP PROCEDURE iotest;
294 DROP FUNCTION mul;
295 DROP FUNCTION inc;
296 DROP FUNCTION fac;
297 DROP FUNCTION fun;
298 DROP PROCEDURE ifac;
299 DROP TRIGGER trg;
300 DROP TABLE t1,t2;
301 DROP DATABASE nested_sp;
302 # Restore default settings
303 # restart: