pingcap / pingcap/tidb

join with view produces 'interface conversion' with a small change on join condition

Open
#60,489 0 comments 3 reactions 1 assignee Claimed by @hawkingrei View on GitHub
severity/moderate sig/planner type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

The second query only remove 'not' from the join condition in comparison with the first query, but it meets some internal error.

### 1. Minimal reproduce step (Required)

```sql
CREATE TABLE t0(c0 CHAR);
CREATE VIEW v0(c0) AS SELECT NULL;

SELECT *
FROM v0
JOIN t0 ON ((v0.c0) <=> (t0.c0))
WHERE ((COALESCE(v0.c0, INET6_ATON(v0.c0))));
-- [HY000][1105] interface conversion: expression. Expression is *expression. ScalarFunction, not *expression. Column
```

### 2. What did you expect to see? (Required)
I expect the second query to produce result normally.

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

The second query produces:
```sql
-- [HY000][1105] interface conversion: expression. Expression is *expression. ScalarFunction, not *expression. Column
```
### 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.