Debian Codegraph @

mysql-test/suite/perfschema/t/statement_program_lost_inst.test

raw
1 #-------------------------------------------------------------
2 # Tests for PERFORMANCE_SCHEMA stored programs instrumentation
3 #-------------------------------------------------------------
4
5 #
6 # Test case to show the behaviour of stored program instrumentation
7 # when values of the system variables performance_schema_max_program_instances &
8 # performance_schema_max_statement_stack are less than the statistics collected.
9 # The status of the lost instrumentation is shown through the status variables
10 # performance_schema_program_lost & performance_schema_nested_statement_lost
11 #
12
13 # Restarting the server at the begining of the test.
14 # This is to avoid the instrumentation of extra SPs called by MTR
15 # These additional stored programs which will be added might cause
16 # result content mismatch failure.
17
18 --source include/not_embedded.inc
19 --source include/have_perfschema.inc
20
21 let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
22 --write_line wait $restart_file
23 --shutdown_server
24 --source include/wait_until_disconnected.inc
25 --write_line "restart:--performance_schema_max_program_instances=7 --performance_schema_max_statement_stack=2 --thread_stack=1048576" $restart_file
26 --enable_reconnect
27 --source include/wait_until_connected_again.inc
28
29 --source ../include/start_server_common.inc
30
31 # Values of variables server variables
32 show global variables like "performance_schema_max_program_instances";
33 show global variables like "performance_schema_max_statement_stack";
34
35 --echo #####################
36 --echo # Setup
37 --echo #####################
38 --source suite/perfschema/include/program_nested_setup.inc
39
40 # Truncate summary table
41 TRUNCATE performance_schema.events_statements_summary_by_program;
42 SELECT OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA FROM
43 performance_schema.events_statements_summary_by_program
44 WHERE OBJECT_SCHEMA='nested_sp' ORDER BY OBJECT_NAME;
45 # Flush status now
46 Flush status;
47 show global status like "%performance_schema_program_lost%";
48 show global status like "%performance_schema_nested_statement_lost%";
49
50 --echo #####################
51 --echo # Executing Queries
52 --echo #####################
53 --source suite/perfschema/include/program_nested_execution.inc
54
55 --echo ###########################################
56 --echo # Quering PS statement summary table #
57 --echo ###########################################
58
59 SELECT OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA
60 FROM performance_schema.events_statements_summary_by_program
61 WHERE OBJECT_SCHEMA='nested_sp' ORDER BY OBJECT_NAME;
62
63 # Now check the lost status
64 show global status like "%performance_schema_program_lost%";
65 show global status like "%performance_schema_nested_statement_lost%";
66
67 --echo #####################
68 --echo # Cleanup
69 --echo #####################
70 --source suite/perfschema/include/program_nested_cleanup.inc
71
72