pingcap / pingcap/tidb

ULLONG_MAX inserted into a BIT(64) column could not be retrieved

Open
#65,955 2 comments 1 reaction 0 assignees View on GitHub
contribution 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
mysql> DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE t1 (a bit(64), primary key (a));
Query OK, 0 rows affected (0.02 sec)

mysql> INSERT INTO t1 values (b'1111111111111111111111111111111111111111111111111111111111111111');
Query OK, 1 row affected (0.00 sec)

mysql> SELECT hex(a) FROM t1 WHERE a = b'1111111111111111111111111111111111111111111111111111111111111111';
Empty set (0.00 sec)
```

### 2. What did you expect to see? (Required)
The query should return `FFFFFFFFFFFFFFFF`, which is the ULLONG_MAX value in hexadecimal format.

### 3. What did you see instead (Required)
Empty set (0.00 sec)

### 4. What is your TiDB version? (Required)
```SQL
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v9.0.0-beta.2.pre-1160-g85389ef374
Edition: Community
Git Commit Hash: 85389ef3740fcc5058a5660e4382e2f1e80c0f28
Git Branch: master
UTC Build Time: 2026-02-02 03:19:11
GoVersion: go1.25.6
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.