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

Commit c646d3c

Browse files
committed
Standardize the naming of IN parameters for analyze_statement_digest()
1 parent 0363b06 commit c646d3c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

procedures/analyze_statement_digest.sql

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Procedure: analyze_statement_digest()
33
*
44
* Parameters
5-
* digest_in: The statement digest identifier you would like to analyze
6-
* runtime: The number of seconds to run analysis for (defaults to a minute)
7-
* interval_in: The interval (in seconds, may be fractional) at which to try
8-
* and take snapshots (defaults to a second)
9-
* start_fresh: Whether to TRUNCATE the events_statements_history_long and
10-
* events_stages_history_long tables before starting (default false)
11-
* auto_enable: Whether to automatically turn on required consumers (default false)
5+
* in_digest: The statement digest identifier you would like to analyze
6+
* in_runtime: The number of seconds to run analysis for (defaults to a minute)
7+
* in_interval: The interval (in seconds, may be fractional) at which to try
8+
* and take snapshots (defaults to a second)
9+
* in_start_fresh: Whether to TRUNCATE the events_statements_history_long and
10+
* events_stages_history_long tables before starting (default false)
11+
* in_auto_enable: Whether to automatically turn on required consumers (default false)
1212
*
1313
* mysql> call analyze_statement_digest('891ec6860f98ba46d89dd20b0c03652c', 10, 0.1, true, true);
1414
* +--------------------+
@@ -110,9 +110,9 @@ DROP PROCEDURE IF EXISTS analyze_statement_digest;
110110

111111
DELIMITER $$
112112

113-
CREATE PROCEDURE analyze_statement_digest(IN digest_in VARCHAR(32), IN runtime INT,
114-
IN interval_in DECIMAL(2,2), IN start_fresh BOOLEAN, IN auto_enable BOOLEAN)
115-
COMMENT 'Parameters: digest_in (varchar(32)), runtime (int), interval_in (decimal(2,2)), start_fresh (boolean), auto_enable (boolean)'
113+
CREATE PROCEDURE analyze_statement_digest(IN in_digest VARCHAR(32), IN in_runtime INT,
114+
IN in_interval DECIMAL(2,2), IN in_start_fresh BOOLEAN, IN in_auto_enable BOOLEAN)
115+
COMMENT 'Parameters: in_digest (varchar(32)), in_runtime (int), in_interval (decimal(2,2)), in_start_fresh (boolean), in_auto_enable (boolean)'
116116
SQL SECURITY INVOKER
117117
BEGIN
118118

@@ -152,33 +152,33 @@ BEGIN
152152
PRIMARY KEY (event_id)
153153
);
154154

155-
SET v_start_fresh = start_fresh;
155+
SET v_start_fresh = in_start_fresh;
156156
IF v_start_fresh THEN
157157
TRUNCATE TABLE performance_schema.events_statements_history_long;
158158
TRUNCATE TABLE performance_schema.events_stages_history_long;
159159
END IF;
160160

161-
SET v_auto_enable = auto_enable;
161+
SET v_auto_enable = in_auto_enable;
162162
IF v_auto_enable THEN
163163
CALL ps_helper.save_current_config();
164164
END IF;
165165

166-
WHILE v_runtime < runtime DO
166+
WHILE v_runtime < in_runtime DO
167167
SELECT UNIX_TIMESTAMP() INTO v_start;
168168

169169
INSERT IGNORE INTO stmt_trace
170170
SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno,
171171
rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used
172172
FROM performance_schema.events_statements_history_long
173-
WHERE digest = digest_in;
173+
WHERE digest = in_digest;
174174

175175
INSERT IGNORE INTO stmt_stages
176176
SELECT stages.event_id, stmt_trace.event_id,
177177
stages.event_name, stages.timer_wait
178178
FROM performance_schema.events_stages_history_long AS stages
179179
JOIN stmt_trace ON stages.nesting_event_id = stmt_trace.event_id;
180180

181-
SELECT SLEEP(interval_in) INTO @sleep;
181+
SELECT SLEEP(in_interval) INTO @sleep;
182182
SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start);
183183
END WHILE;
184184

0 commit comments

Comments
 (0)