pingcap / pingcap/tidb

Wrong inner join result

Open
#60,217 3 comments 0 reactions 0 assignees View on GitHub
sig/planner type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

### 1. Minimal reproduce step (Required)
```
CREATE TABLE t1(c1 DOUBLE , c2 BOOL);

INSERT INTO t1 VALUES (0.5, false);
INSERT INTO t1 VALUES (0.5, false);

SELECT *
FROM t1
inner join t1 as t0 ON ((t1.c2) <= (CAST(t1.c1 AS DATE)));

```

### 2. What did you expect to see? (Required)
In MySQL 8.0
```

empty

```

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

0.5, 0, 0.5, 0
0.5, 0, 0.5, 0
0.5, 0, 0.5, 0
0.5, 0, 0.5, 0

```

### 4. What is your TiDB version? (Required)
```
Release Version: v9.0.0-beta.1.pre-389-g21f9bb7b7a
Edition: Community
Git Commit Hash: 21f9bb7b7a7478d825c4dee4fbf2ce913e3e7cf1
Git Branch: HEAD
UTC Build Time: 2025-03-11 09:37:34
GoVersion: go1.23.7
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```

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.