pingcap / pingcap/tidb

EXPLAIN for SELECT ... FOR UPDATE does not use PointGet/BatchPointGet in txn with TiFlash replica

Open
#69,858 2 comments 0 reactions 1 assignee Claimed by @qw4990 View on GitHub
severity/moderate sig/planner 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)
Run the following cases in TCMS plan 8221782:
- TWTXNBatchPointGetPK
- TWTXNPointGetPK

The failure happens in `EXPLAIN ... FOR UPDATE` inside a transaction:
- `explain select a, b from t where a = 1 and b in (2,3) for update`
- `explain select a, b from t where a = 1 and b = 2 for update`

### 2. What did you expect to see? (Required)
For `SELECT ... FOR UPDATE` statements that satisfy the point get / batch point get conditions, the
planner should choose `PointGet` / `BatchPointGet`, or clearly return a reason if that is not supported.

### 3. What did you see instead (Required)
- `batch point get should either error or use point get / batch point get`
- `point get should either error or use point get / batch point get`

This affects planner selection in TiFlash read-for-write / txn scenarios, causing cases that should use
point get / batch point get to fail.

### 4. What is your TiDB version? (Required)
[2026/07/14 07:18:48.795 +00:00] [INFO] [printer.go:77] ["Welcome to TiDB."] [keyspaceName=10273857404366864107] ["Release Version"=CLOUD.202603.6-8-gc89f0c7fad] [Edition=Enterprise] ["Git Commit Hash"=c89f0c7fad8e976bdbb9923454247489e2344e5b] ["Git Branch"=HEAD] ["UTC Build Time"="2026-07-14 04:38:24"] [GoVersion=go1.25.10] ["Race Enabled"=false] ["Check Table Before Drop"=false] ["TiDB Component Version"=v26.3.6-8-gc89f0c7fad] ["Deploy Mode"=premium] ["Kernel Type"="Next Generation"] ["Enterprise Extension Commit Hash"=dc633aae52eb11b4e3549e3a7ef5b0ed14e159b1]

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.