Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
12.2
-
None
-
Can result in unexpected behaviour
Description
Query_time for SP statements always display cululating time. Looks wrong. They should display query time for individial statements.
This script demonstrates:
DELIMITER $$
|
CREATE OR REPLACE PROCEDURE p1() |
BEGIN
|
SELECT SLEEP(0.02); |
SELECT SLEEP(0.02); |
SELECT SLEEP(0.02); |
SELECT SLEEP(0.02); |
END; |
$$
|
DELIMITER ;
|
 |
SET GLOBAL slow_query_log=ON; |
SET SESSION authorization root@localhost; |
SET SESSION log_slow_verbosity='explain'; |
SET log_slow_disabled_statements=admin; |
SET long_query_time=0.01; |
USE test; |
CALL p1();
|
# User@Host: root[root] @ localhost []
|
# Thread_id: 3 Schema: test QC_hit: No
|
# Query_time: 0.020463 Lock_time: 0.000074 Rows_sent: 1 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 68
|
# Stored_routine: test.p1
|
SET timestamp=1768979152;
|
SELECT SLEEP(0.02);
|
# User@Host: root[root] @ localhost []
|
# Thread_id: 3 Schema: test QC_hit: No
|
# Query_time: 0.040597 Lock_time: 0.000074 Rows_sent: 1 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 68
|
# Stored_routine: test.p1
|
SET timestamp=1768979152;
|
SELECT SLEEP(0.02);
|
# User@Host: root[root] @ localhost []
|
# Thread_id: 3 Schema: test QC_hit: No
|
# Query_time: 0.060789 Lock_time: 0.000074 Rows_sent: 1 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 68
|
# Stored_routine: test.p1
|
SET timestamp=1768979152;
|
SELECT SLEEP(0.02);
|
# User@Host: root[root] @ localhost []
|
# Thread_id: 3 Schema: test QC_hit: No
|
# Query_time: 0.080985 Lock_time: 0.000074 Rows_sent: 1 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 68
|
# Stored_routine: test.p1
|
SET timestamp=1768979152;
|
SELECT SLEEP(0.02);
|
# User@Host: root[root] @ localhost []
|
# Thread_id: 3 Schema: test QC_hit: No
|
# Query_time: 0.081103 Lock_time: 0.000074 Rows_sent: 4 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 283
|
SET timestamp=1768979152;
|
CALL p1();
|
Attachments
Issue Links
- relates to
-
MDEV-33830 Support for cursors on prepared statements
-
- Approved
-
-
MDEV-38611 Procedure statements do not write Explain entries to the slow log
-
- Open
-
-
MDEV-38612 Cursor OPEN statements do not write to the slow log
-
- Open
-