pingcap / pingcap/tidb

incorrect result when comparing int with an overflow string

Open
#47,955 2 comments 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
affects-6.5 affects-7.1 affects-7.5 component/expression severity/moderate sig/execution sig/planner 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)

```
> create table t(a bigint unsigned);
> insert into t values(18446744073709551615);
> select * from t where a="18446744073709551616";
```

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

In mysql8.0, it returns empty data set.

```
mysql> select * from t where a="18446744073709551616";
Empty set (0.00 sec)
```

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

In tidb:

```
mysql> select * from t where a="18446744073709551616";
+----------------------+
| a |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
```

### 4. What is your TiDB version? (Required)

master, I'm not sure whether other previous versions have this issue.

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.