This repository was archived by the owner on Aug 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -3290,7 +3290,7 @@ Checks whether the provided connection id is instrumented within Performance Sch
32903290
32913291##### Returns
32923292
3293- ENUM('YES', 'NO')
3293+ ENUM('YES', 'NO', 'UNKNOWN' )
32943294
32953295##### Example
32963296``` SQL
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ DELIMITER $$
1919
2020CREATE DEFINER= ' root' @' localhost' FUNCTION ps_is_thread_instrumented (
2121 in_connection_id BIGINT UNSIGNED
22- ) RETURNS ENUM(' YES' , ' NO' )
22+ ) RETURNS ENUM(' YES' , ' NO' , ' UNKNOWN ' )
2323 COMMENT '
2424 Description
2525 -----------
@@ -35,7 +35,7 @@ CREATE DEFINER='root'@'localhost' FUNCTION ps_is_thread_instrumented (
3535 Returns
3636 -----------
3737
38- ENUM(\' YES\' , \' NO\' )
38+ ENUM(\' YES\' , \' NO\' , \' UNKNOWN \' )
3939
4040 Example
4141 -----------
@@ -52,13 +52,21 @@ CREATE DEFINER='root'@'localhost' FUNCTION ps_is_thread_instrumented (
5252 NOT DETERMINISTIC
5353 READS SQL DATA
5454BEGIN
55- DECLARE v_enabled ENUM(' YES' , ' NO' );
55+ DECLARE v_enabled ENUM(' YES' , ' NO' , ' UNKNOWN' );
56+
57+ IF (in_connection_id IS NULL ) THEN
58+ RETURN NULL ;
59+ END IF;
5660
5761 SELECT INSTRUMENTED INTO v_enabled
5862 FROM performance_schema .threads
5963 WHERE PROCESSLIST_ID = in_connection_id;
6064
61- RETURN v_enabled;
65+ IF (v_enabled IS NULL ) THEN
66+ RETURN ' UNKNOWN' ;
67+ ELSE
68+ RETURN v_enabled;
69+ END IF;
6270END$$
6371
6472DELIMITER ;
You can’t perform that action at this time.
0 commit comments