Skip to content

SELECT * FROM (SELECT 1, 1, 1) unexpected result #36973

Closed

Description

@InquisitorGray

Clickhouse version 22.5.1.458

https://gh-api.clickhouse.tech/play?user=play

Correct behavior

SELECT 1, 1, 1;
-- expected 1, 1, 1
-- returned 1, 1, 1

Unexpected behavior

SELECT * FROM (SELECT 1, 1, 1);
-- expected 1, 1, 1
-- returned 1

Looks like the check for MULTIPLE_EXPRESSIONS_FOR_ALIAS is bypassed

Activity

  1. added
    unexpected behaviour
    on May 6, 2022
  2. alexey-milovidov commented on May 6, 2022

    @alexey-milovidov
    Member
  3. InquisitorGray commented on May 10, 2022

    @InquisitorGray
    Author

    I have some doubts about OK-behavior returning single 1.
    The same query in Postgres (SQL Lite as well) returns expected 1, 1, 1 in the above mentioned db-fiddle.
    I guess, both behaviors can not be correct at the same time.

    The exception would be correct, though.

  4. self-assigned this
    on Sep 10, 2022
  5. alexey-milovidov commented on Apr 2, 2023

    @alexey-milovidov
    Member

    Works perfectly with Analyzer:

    SELECT * FROM (SELECT 1, 1, 1) SETTINGS allow_experimental_analyzer = 1;
    

    Waiting while Analyzer will be enabled by default.

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

    minorunexpected behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions