Repository navigation
Description
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/expression/cte.sql
[ROW NUMBER]: 146
[SQL STATEMENT]: SELECT (WITH qn AS (SELECT t2.aa as a FROM t1),
qn2 AS (SELECT 3a AS b FROM qn)
SELECT * from qn2 LIMIT 1)
FROM t1 as t2;
[EXPECT RESULT]:
(WITH qn AS (SELECT t2.aa as a FROM t1),
qn2 AS (SELECT 3a AS b FROM qn)
SELECT * from qn2 LIMIT 1)
null
null
null
[ACTUAL RESULT]:
correlated column in CTE is not yet supported
[ERROR]
[SCRIPT FILE]: cases/expression/cte.sql
[ROW NUMBER]: 238
[SQL STATEMENT]: with qn as (SELECT s1 FROM t2)
select s1, s1 = ANY (select * from qn) from t1;
[EXPECT RESULT]:
s1 s1 = ANY (select * from qn)
a1 1
a2 1
a3 0
[ACTUAL RESULT]:
non-scalar subquery in SELECT clause will be supported in future version.
[ERROR]
[SCRIPT FILE]: cases/expression/cte.sql
[ROW NUMBER]: 242
[SQL STATEMENT]: with qn as (SELECT s1 FROM t2)
select s1, s1 = ANY (select * from qn) from t1;
[EXPECT RESULT]:
s1 s1 = ANY (select * from qn)
a1 1
a2 1
a3 0
[ACTUAL RESULT]:
non-scalar subquery in SELECT clause will be supported in future version.
[ERROR]
[SCRIPT FILE]: cases/expression/cte.sql
[ROW NUMBER]: 281
[SQL STATEMENT]: with qn as (select * from t2 where t2.b=t3.a)
select * from t3 where exists (select * from qn);
[EXPECT RESULT]:
Unknown column 't3.a' in 'where clause'
[ACTUAL RESULT]:
correlated column in CTE is not yet supported
[ERROR]
[SCRIPT FILE]: cases/expression/cte.sql
[ROW NUMBER]: 283
[SQL STATEMENT]: with qn as (select * from t2 where t2.b=t3.a)
select * from t3 where not exists (select * from qn);
[EXPECT RESULT]:
Unknown column 't3.a' in 'where clause'
[ACTUAL RESULT]:
correlated column in CTE is not yet supported
Expected Behavior
No response
Steps to Reproduce
No response
Additional information
No response
Activity
aunjgr commentedon Jun 24, 2022
CTEs and literal subqueries are handled through different code path. Please create two separate issues.
domingozhang commentedon Jul 1, 2022
correlated column is not in filter part of CTE. It can be not supported.
[-][Bug]: correlated column in CTE and non-scalar subquery in SELECT clause not supported[/-][+][Bug]: correlated column in CTE not supported[/+]aunjgr commentedon Jul 21, 2022
Non-scalar subquery in SELECT clause falls within the scope of #3312, and will be resolved by the same modification.
Retag some matrixorigin#3304 cases
Retag some #3304 cases (#4149)
sukki37 commentedon Oct 29, 2022
@aunjgr any updates?
aressu1985 commentedon Nov 8, 2022
fixed: e23e00f
mysql> -- @bvt:issue#3304
mysql> with qn as (select * from t2 where t2.b=t3.a)
-> select * from t3 where exists (select * from qn);
ERROR 20301 (HY000): invalid input: missing FROM-clause entry for table 't3'
mysql>
mysql> with qn as (select * from t2 where t2.b=t3.a)
-> select * from t3 where not exists (select * from qn)
-> ;
ERROR 20301 (HY000): invalid input: missing FROM-clause entry for table 't3'
mysql>
Retag some matrixorigin#3304 cases (matrixorigin#4149)