Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit a8693af

Browse files
Use the functions ps_is_instrument_default_enabled() and ps_is_instrument_default_timed() when resetting setup_instruments to the default
1 parent 7e19076 commit a8693af

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

procedures/ps_setup_reset_to_default.sql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@ BEGIN
8181
DEALLOCATE PREPARE reset_stmt;
8282

8383
SET @query = 'UPDATE performance_schema.setup_instruments
84-
SET ENABLED = ''NO'', TIMED = ''NO''
85-
WHERE NAME NOT LIKE ''wait/io/file/%''
86-
AND NAME NOT LIKE ''wait/io/table/%''
87-
AND NAME NOT LIKE ''statement/%''
88-
AND NAME NOT IN (''wait/lock/table/sql/handler'', ''idle'')';
84+
SET ENABLED = sys.ps_is_instrument_default_enabled(NAME),
85+
TIMED = sys.ps_is_instrument_default_timed(NAME)';
8986

9087
IF (in_verbose) THEN
9188
SELECT CONCAT('Resetting: setup_instruments\n', REPLACE(@query, ' ', '')) AS status;

procedures/ps_setup_reset_to_default_57.sql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,8 @@ BEGIN
8585
DEALLOCATE PREPARE reset_stmt;
8686

8787
SET @query = 'UPDATE performance_schema.setup_instruments
88-
SET ENABLED = ''NO'', TIMED = ''NO''
89-
WHERE NAME NOT LIKE ''wait/io/file/%''
90-
AND NAME NOT LIKE ''wait/io/table/%''
91-
AND NAME NOT LIKE ''statement/%''
92-
AND NAME NOT IN (''wait/lock/table/sql/handler'', ''idle'')';
88+
SET ENABLED = sys.ps_is_instrument_default_enabled(NAME),
89+
TIMED = sys.ps_is_instrument_default_timed(NAME)';
9390

9491
IF (in_verbose) THEN
9592
SELECT CONCAT('Resetting: setup_instruments\n', REPLACE(@query, ' ', '')) AS status;

0 commit comments

Comments
 (0)