pingcap / pingcap/tidb

The blocked statement did not report any warning after being released

Open
#64,401 1 comment 0 reactions 0 assignees View on GitHub
contribution 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
/* init */ DROP TABLE IF EXISTS t;
/* init */ CREATE TABLE t (c1 VARCHAR(7), c2 INT);
/* init */ INSERT INTO t(c1, c2) VALUES ('B', 2);

-- blocked in transaction
/* t1 */ BEGIN;
/* t1 */ UPDATE t SET c1 = 'G', c2 = -1;
/* t2 */ BEGIN;
/* t2 */ DELETE IGNORE FROM t WHERE ((~ '0aTHt')); --blocked -- [1]
/* t1 */ COMMIT; -- t2 unblocked
/* t2 */ COMMIT;

-- not blocked in transaction
/* t */ BEGIN;
/* t */ DELETE IGNORE FROM t WHERE ((~ '0aTHt')); -- [2]
/* t */ COMMIT;

-- not int transaction
/* s */ DELETE IGNORE FROM t WHERE ((~ '0aTHt')); -- [3]
```

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

The execution behaviors of the DELETE statements [1], [2] and [3] are the same.

### 3. What did you see instead (Required)

The DELETE statement [1] does not report warning, while DELETE statements [2] and [3] report a warning.

[1] blocked DELETE in transaction
```sql
mysql> DELETE IGNORE FROM t WHERE ((~ '0aTHt'));
Query OK, 1 row affected (5.24 sec)
```
[2] not blocked DELETE in transaction
```sql
mysql> BEGIN;
Query OK, 0 rows affected (0.00 sec)

mysql> DELETE IGNORE FROM t WHERE ((~ '0aTHt'));
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> SHOW WARNINGS;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '0aTHt' |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)
```
[3] DELETE not in transaction
```sql
mysql> DELETE IGNORE FROM t WHERE ((~ '0aTHt'));
Query OK, 1 row affected, 1 warning (0.02 sec)

mysql> SHOW WARNINGS;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '0aTHt' |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)
```

### 4. What is your TiDB version? (Required)
```sql
Release Version: v8.5.3
Edition: Community
Git Commit Hash: dc2548aac79a712265e831cff2a3a896bc0a5a38
Git Branch: HEAD
UTC Build Time: 2025-07-31 13:54:43
GoVersion: go1.23.8
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```

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.