Data truncation: Truncated incorrect INTEGER value
- 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 test_1 (
id INT AUTO_INCREMENT PRIMARY KEY,
test_bit BIT(10) NULL
);
INSERT INTO test_1 (id, test_bit) VALUES (1, UNHEX('0001'));
-- This works
UPDATE test_1 SET test_bit = UNHEX('0001');
-- But this not
UPDATE test_1 SET test_bit = UNHEX('0001') WHERE id = 1;
```
### 2. What did you expect to see? (Required)
Both UPDATE statements can be executed normally
### 3. What did you see instead (Required)
Error with UPDATE using WHERE: `Data truncation: Truncated incorrect INTEGER value: '`
### 4. What is your TiDB version? (Required)
I tried 2 versions:
```
Release Version: v7.1.6
Edition: Community
Git Commit Hash: f00a5848631bbf0a8b76bfea9b80f5790cb50286
Git Branch: HEAD
UTC Build Time: 2024-11-18 06:39:34
GoVersion: go1.20.14
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
```
and master branch
```
Release Version: v8.4.0-this-is-a-placeholder
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.24.4
Race Enabled: false
Check Table Before Drop: false
Store: unistore
Kernel Type: Classic
```
Contributor guide
Assessment
This issue has not been assessed yet.