Skip to content

wrong alias resolution when WITH is used #40955

Closed

Description

@den-crane
WITH toInt64(2) AS new_x SELECT new_x AS x FROM (SELECT 1 AS x) t;
┌─x─┐
│ 1 │ -- expected 2
└───┘

WITH toInt64(2) AS new_x SELECT * replace(new_x as x)  FROM (SELECT 1 AS x) t;
┌─x─┐
│ 1 │ -- expected 2
└───┘


SELECT 2 AS x FROM (SELECT 1 AS x) t;
┌─x─┐
│ 2 │
└───┘

SELECT * replace(2 as x)  FROM (SELECT 1 AS x) t;
┌─x─┐
│ 2 │
└───┘

Activity

  1. added
    unexpected behaviour
    on Sep 2, 2022
  2. changed the title [-]wrong alias resolution when WITH is used.[/-] [+]wrong alias resolution when WITH is used[/+] on Sep 2, 2022
  3. added
    comp-query-analyzer
    on Sep 6, 2022
  4. added a commit that references this issue on Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-query-analyzerunexpected behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions