Incorrect Accumulation of Rows_sent, Rows_examined, and Bytes_sent in Slow Query Log for Stored Routine

Description

The Rows_sentRows_examined, and Bytes_sent fields in the slow query log are accumulating incorrectly across multiple queries executed within the same stored routine.

When executing multiple queries within a stored routine, the slow query log shows incorrect accumulation of the Rows_sentRows_examined, and Bytes_sent fields. These fields should reflect the activity of each individual query, but they are being cumulatively reported across queries executed within the same stored routine, for example

The expected Behavior:

For each query within the stored routine, the values of Rows_sentRows_examined, and Bytes_sent should only reflect the activity of that specific query. Since each query examines only one row, these fields should all report a value of 1 for each query.

Reproduce

Environment

None

Activity

Show:

Details

Assignee

Reporter

Needs QA

Yes

Affects versions

Priority

Smart Checklist

Created January 17, 2025 at 1:59 AM
Updated January 20, 2025 at 5:19 PM