Skip to content

Commit 7807010

Browse files
committed
Example for tracing PSM stored routine
1 parent 8564ce5 commit 7807010

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Debug/my_debug.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
DELIMITER //
2+
3+
CREATE PROCEDURE my_debug(dbg_msg VARCHAR(1024))
4+
BEGIN
5+
IF my_debug_enabled THEN
6+
SELECT CONCAT('DEBUG: ', dbg_msg);
7+
END IF;
8+
END //
9+
10+
DELIMITER ;

Debug/my_test_debug.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DELIMITER //
2+
3+
CREATE PROCEDURE my_test_debug(IN a INTEGER, IN b INTEGER, OUT res INTEGER)
4+
BEGIN
5+
CALL my_debug(CONCAT('enter my_test_debug(', a, ', ', b, ')'));
6+
7+
SET res := a + b;
8+
9+
CALL my_debug(CONCAT('exit my_test_debug(), res = ', res));
10+
END //
11+
12+
DELIMITER ;
13+

0 commit comments

Comments
 (0)