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