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

Commit 770e1da

Browse files
committed
Fix the loop timing within dump_thread_stack()
1 parent cd0a912 commit 770e1da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

procedures/dump_thread_stack.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ BEGIN
190190
SELECT CONCAT('Data collection starting for THREAD_ID = ', in_thread_id) AS 'Info';
191191

192192
SET v_min_event_id = 0,
193-
v_start = UNIX_TIMESTAMP(NOW(2)),
193+
v_start = UNIX_TIMESTAMP(),
194194
in_interval = IFNULL(in_interval, 1.00),
195195
in_max_runtime = IFNULL(in_max_runtime, 60.00);
196196

@@ -210,8 +210,8 @@ BEGIN
210210
END LOOP;
211211
CLOSE c_stack;
212212

213-
DO SLEEP(in_interval);
214-
SET v_runtime = (UNIX_TIMESTAMP(NOW(2)) - v_start);
213+
SELECT SLEEP(in_interval) INTO @sleep;
214+
SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start);
215215
END WHILE;
216216

217217
/* Reset the settings for the performance schema */

0 commit comments

Comments
 (0)