Skip to content

[Bug]:Non-scalar subquery in non-root expressions are not supported #3309

Closed

Description

@aressu1985

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):0.5.0
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 86
[SQL STATEMENT]: SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2);
[EXPECT RESULT]:
column "a" must appear in the GROUP BY clause or be used in an aggregate function
[ACTUAL RESULT]:
subquery must return only one column

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 124
[SQL STATEMENT]: select * from t1 where not (s1 < any (select s1 from t1));
[EXPECT RESULT]:
s1
2
[ACTUAL RESULT]:
"ANY" subquery as non-root expression not yet supported

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 141
[SQL STATEMENT]: select (select * from t1) = (select 1,2);
[EXPECT RESULT]:
(select * from t1) = (select 1,2)
null
[ACTUAL RESULT]:
subquery must return only one column

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 142
[SQL STATEMENT]: select (select 1,2) = (select * from t1);
[EXPECT RESULT]:
(select 1,2) = (select * from t1)
null
[ACTUAL RESULT]:
subquery must return only one column

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 144
[SQL STATEMENT]: select (1,2) = ANY (select * from t1);
[EXPECT RESULT]:
(1,2) = ANY (select * from t1)
0
[ACTUAL RESULT]:
subquery must return only one column

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 145
[SQL STATEMENT]: select (1,2) != ALL (select * from t1);
[EXPECT RESULT]:
(1,2) != ALL (select * from t1)
1
[ACTUAL RESULT]:
subquery must return only one column

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 145
[SQL STATEMENT]: select (1,2) != ALL (select * from t1);
[EXPECT RESULT]:
(1,2) != ALL (select * from t1)
1
[ACTUAL RESULT]:
subquery must return only one column

[ERROR]
[SCRIPT FILE]: cases/subquery/subquery-with-any.sql
[ROW NUMBER]: 252
[SQL STATEMENT]: SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a);
[EXPECT RESULT]:
a b
BBB 4
CCC 7
AAA 8
[ACTUAL RESULT]:
subquery must return only one column

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

Activity

  1. added
    kind/bug
    bvt
    on Jun 23, 2022
  2. added this to the v0.5.0 milestone on Jun 23, 2022
  3. modified the milestones: v0.5.0, v0.6.0 on Jun 24, 2022
  4. aunjgr commented on Jun 24, 2022

    @aunjgr
    Contributor

    [ERROR]
    [SCRIPT FILE]: cases/subquery/subquery-with-any.sql
    [ROW NUMBER]: 124
    [SQL STATEMENT]: select * from t1 where not (s1 < any (select s1 from t1));
    [EXPECT RESULT]:
    s1
    2
    [ACTUAL RESULT]:
    "ANY" subquery as non-root expression not yet supported

    This one is a separate issue. It's indeed a duplicate of #3312

    All others are duplicate of #3308

  5. changed the title [-][Bug]: return error "subquery must return only one column" for a normal "any" query[/-] [+][Bug]:Non-scalar subquery in non-root expressions are not supported[/+] on Jun 24, 2022
  6. assigned and unassigned on Jun 24, 2022
  7. reopened this on Jun 24, 2022
  8. 7 remaining items

  9. added a commit that references this issue on Jul 3, 2022
  10. assigned and unassigned on Jul 5, 2022
  11. aunjgr commented on Jul 5, 2022

    @aunjgr
    Contributor

    The cases have been retagged to #3308 and #3312.

  12. added
    severity/s1
    on Jul 16, 2022
  13. aunjgr commented on Jul 21, 2022

    @aunjgr
    Contributor

    @aressu1985 All cases had been retagged to #3308 and #3312. Pls close this issue.

  14. tianyahui-python commented on Oct 29, 2022

    @tianyahui-python
    Contributor

    @aressu1985 can close issue.

  15. aressu1985 commented on Oct 29, 2022

    @aressu1985
    ContributorAuthor

    fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bvtkind/bugseverity/s1triage/accepted

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions