| 1 |
# Tests for sys schema |
| 2 |
# Verify the sys.ps_is_consumer_enabled() function perfoms as expected |
| 3 |
|
| 4 |
# Should be disabled by default |
| 5 |
UPDATE performance_schema.setup_consumers SET enabled = 'NO' WHERE name = 'events_stages_history'; |
| 6 |
SELECT sys.ps_is_consumer_enabled('events_stages_history'); |
| 7 |
|
| 8 |
# Should be enabled by default |
| 9 |
SELECT sys.ps_is_consumer_enabled('global_instrumentation'); |
| 10 |
|
| 11 |
# An error if bad name: |
| 12 |
--error ER_STD_INVALID_ARGUMENT |
| 13 |
SELECT sys.ps_is_consumer_enabled('events_stages_histONg'); |
| 14 |
|
| 15 |
# |
| 16 |
# Check that hierarchy is properly reflected |
| 17 |
# |
| 18 |
|
| 19 |
UPDATE performance_schema.setup_consumers SET enabled = 'NO' WHERE name = 'events_stages_current'; |
| 20 |
UPDATE performance_schema.setup_consumers SET enabled = 'YES' WHERE name = 'events_stages_history'; |
| 21 |
|
| 22 |
# Should still be disabled, as events_stages_current not enabled |
| 23 |
SELECT sys.ps_is_consumer_enabled('events_stages_history'); |
| 24 |
|
| 25 |
UPDATE performance_schema.setup_consumers SET enabled = 'YES' WHERE name = 'events_stages_current'; |
| 26 |
|
| 27 |
# Now it should be enabled |
| 28 |
SELECT sys.ps_is_consumer_enabled('events_stages_history'); |
| 29 |
|
| 30 |
# Toggling global_instrumentation should disable all other consumers |
| 31 |
UPDATE performance_schema.setup_consumers SET enabled = 'NO' WHERE name = 'global_instrumentation'; |
| 32 |
|
| 33 |
SELECT sys.ps_is_consumer_enabled('thread_instrumentation'); |
| 34 |
SELECT sys.ps_is_consumer_enabled('statements_digest'); |
| 35 |
SELECT sys.ps_is_consumer_enabled('events_stages_current'); |
| 36 |
SELECT sys.ps_is_consumer_enabled('events_stages_history'); |
| 37 |
SELECT sys.ps_is_consumer_enabled('events_stages_history_long'); |
| 38 |
SELECT sys.ps_is_consumer_enabled('events_statements_current'); |
| 39 |
SELECT sys.ps_is_consumer_enabled('events_statements_history'); |
| 40 |
SELECT sys.ps_is_consumer_enabled('events_statements_history_long'); |
| 41 |
|
| 42 |
--source ../include/ps_setup_consumers_cleanup.inc |