pingcap / pingcap/tidb

A statement with multiple `ComStmtFetch` is inaccurate with the `Query_time` of slow query log

Open
#33,780 0 comments 0 reactions 0 assignees View on GitHub
severity/moderate sig/sql-infra type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

If an execute statement has multiple `ComStmtFetch` operations.

### 2. What did you expect to see? (Required)
The execution time of the "execute command" and "all fetch commands" should be logged.

### 3. What did you see instead (Required)
Each "fetch command" resets `Session.startTime`.
The "slow query log" records the time of the last fetch command execution time.

### 4. What is your TiDB version? (Required)

```
Release Version: v6.1.0-alpha-97-gb35b30bbd-dirty
Edition: Community
Git Commit Hash: b35b30bbd59cb9f0a199deba71e2ea15e1ad1d19
Git Branch: master
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.