pingcap / pingcap/tidb

Data truncation: Truncated incorrect INTEGER value

Open
#62,574 3 comments 0 reactions 0 assignees View on GitHub
may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major sig/execution 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 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

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.