Inconsistent warnings reported when executed within and outside the transaction
- 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 TEXT);
-- not in transaction
/* s */ INSERT t (c1) VALUES('Vpl');
/* s */ DELETE IGNORE FROM t WHERE ROUND(COT(c1)); -- [1]
-- in transaction
/* t1 */ BEGIN;
/* t1 */ INSERT t (c1) VALUES('Vpl');
/* t1 */ DELETE IGNORE FROM t WHERE ROUND(COT(c1)); -- [2]
```
### 2. What did you expect to see? (Required)
The warnings reported by the DELETE statements [1] and [2] are the same.
### 3. What did you see instead (Required)
The DELETE statements [1] and [2] report different warnings.
[1] DELETE not in a transaction:
```sql
mysql> INSERT t (c1) VALUES('Vpl');
Query OK, 1 row affected (0.01 sec)
mysql> DELETE IGNORE FROM t WHERE ROUND(COT(c1));
ERROR 1690 (22003): DOUBLE value is out of range in 'cot(0)'
mysql> SHOW WARNINGS;
+-------+------+------------------------------------------+
| Level | Code | Message |
+-------+------+------------------------------------------+
| Error | 1690 | DOUBLE value is out of range in 'cot(0)' |
+-------+------+------------------------------------------+
1 row in set (0.00 sec)
```
[2] DELETE in a transaction:
```sql
mysql> BEGIN;
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT t (c1) VALUES('Vpl');
Query OK, 1 row affected (0.02 sec)
mysql> DELETE IGNORE FROM t WHERE ROUND(COT(c1));
ERROR 1690 (22003): DOUBLE value is out of range in 'cot(0)'
mysql> SHOW WARNINGS;
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'Vpl' |
| Error | 1690 | DOUBLE value is out of range in 'cot(0)' |
+---------+------+------------------------------------------+
2 rows 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
Assessment
This issue has not been assessed yet.