pingcap / pingcap/tidb

skip locked statement reports error

Open
#71,009 2 comments 0 reactions 0 assignees View on GitHub
contribution severity/moderate sig/transaction 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)
```sql
create table t0(c0 bool unsigned zerofill );
SELECT t0.c0 FROM t0 WHERE ((((t0.c0)>(NULL)))AND(((t0.c0)<=('O')))) LIMIT 977 OFFSET 681 FOR UPDATE SKIP LOCKED;
```

### 2. What did you expect to see? (Required)

Statement executed successfully

### 3. What did you see instead (Required)
```sql
mysql> SELECT t0.c0 FROM t0 WHERE ((((t0.c0)>(NULL)))AND(((t0.c0)<=('O')))) LIMIT 977 OFFSET 681 FOR UPDATE SKIP LOCKED;
ERROR 1105 (HY000): Can't find column database184.t0._tidb_rowid in schema Column: [database184.t0.c0] PKOrUK: [] NullableUK: []
```

### 4. What is your TiDB version? (Required)
```sql
mysql> select version();
+-----------------------------------------------------+
| version() |
+-----------------------------------------------------+
| 8.0.11-TiDB-v9.0.0-beta.1.pre-640-g24903d6b24-dirty |
+-----------------------------------------------------+
1 row in set (0.00 sec)
```

Contributor guide

Open the contributing guide

Research direction

Start by running the SQL reproduction against the reported TiDB version and trace where FOR UPDATE SKIP LOCKED attempts to resolve _tidb_rowid. Compare that path with the expected successful execution and add a regression test for this query; done means it no longer reports the missing-column error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.