Debian Codegraph @

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

raw
1 #-------------------------------------------------------------
2 # Tests for PERFORMANCE_SCHEMA stored programs instrumentation
3 #-------------------------------------------------------------
4
5 # Test to check the values populated in NESTING_EVENT_TYPE
6 # columns of events_statements_current/history/history_long PS tables.
7
8 --source include/not_embedded.inc
9 --source include/have_perfschema.inc
10 --source include/have_innodb.inc
11 --source include/not_msan_with_debug.inc
12
13 TRUNCATE TABLE performance_schema.events_statements_history_long;
14
15 --echo #----------------------------
16 --echo # Non-nested Stored programs.
17 --echo #----------------------------
18 --source suite/perfschema/include/program_setup.inc
19 ALTER TABLE t2 ENGINE=InnoDB;
20 --source suite/perfschema/include/program_execution.inc
21
22 SELECT EVENT_NAME, SQL_TEXT, OBJECT_NAME, NESTING_EVENT_TYPE, NESTING_EVENT_LEVEL
23 FROM performance_schema.events_statements_history_long
24 WHERE CURRENT_SCHEMA='stored_programs' AND
25 (SQL_TEXT not like '%count(*) = %' OR SQL_TEXT IS NULL)
26 ORDER BY OBJECT_NAME,NESTING_EVENT_LEVEL,SQL_TEXT;
27
28 TRUNCATE TABLE performance_schema.events_statements_history_long;
29
30 # Clean-up
31 --source suite/perfschema/include/program_cleanup.inc
32
33 --echo #------------------------
34 --echo # Nested stored programs.
35 --echo #------------------------
36 --source suite/perfschema/include/program_nested_setup.inc
37 ALTER TABLE t2 ENGINE=InnoDB;
38 --source suite/perfschema/include/program_nested_execution.inc
39
40 SELECT EVENT_NAME, SQL_TEXT, OBJECT_NAME, NESTING_EVENT_TYPE, NESTING_EVENT_LEVEL
41 FROM performance_schema.events_statements_history_long
42 WHERE CURRENT_SCHEMA='nested_sp'
43 ORDER BY OBJECT_NAME, NESTING_EVENT_LEVEL, SQL_TEXT, EVENT_NAME;
44
45 TRUNCATE TABLE performance_schema.events_statements_history_long;
46
47 # Clean-up
48 --source suite/perfschema/include/program_nested_cleanup.inc