Skip to content

Catalog Error with nested CTEs #11391

@zenazn

Description

@zenazn

What happens?

When running a nested CTE with duplicate names, DuckDB inappropriately throws Catalog Error: Table with name foo does not exist!

To Reproduce

Run the following query in the DuckDB shell

with foo as (with foo as (select 1) select * from foo) select * from foo;

I expect this to return a single row 1. I have verified that Postgres and SQLite return the expected result.

OS:

OSX, Apple Silicon

DuckDB Version:

v0.10.1

DuckDB Client:

shell

Full Name:

Carl Jackson

Affiliation:

Watershed

Have you tried this on the latest nightly build?

I have tested with a release build (and could not test with a nightly build)

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions