pingcap / pingcap/tidb

Unexpected error `Unknown table ''` on CTE

Open
#44,673 1 comment 0 reactions 1 assignee Claimed by @winoros View on GitHub
affects-5.4 affects-6.1 affects-6.5 affects-7.1 affects-7.5 affects-8.1 affects-8.5 fuzz/sqlancer may-affects-5.1 may-affects-5.2 may-affects-5.3 severity/major 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)

The following CTE query triggers an unexpected error `Unknown table ''`
```
WITH t1(c0) AS ((VALUES ROW(1))) SELECT * FROM t1;
```

It can run in MySQL https://www.db-fiddle.com/f/9p9SV6byegE8DbXcVAQTah/0

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

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

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

```
Release Version: v7.2.0-alpha-421-gabd9ff5ca6\nEdition: Community\nGit Commit Hash: abd9ff5ca6fe866224f243c931844f050fb4952c\nGit Branch: master\nUTC Build Time: 2023-06-14 08:57:42\nGoVersion: go1.20.3\nRace Enabled: false\nCheck Table Before Drop: false\nStore: unistore
```

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.