return syntax error when order by or limit before union in mysql mode
This commit is contained in:
@ -1820,7 +1820,7 @@ select c,d from cte2;
|
||||
+------+------+
|
||||
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS (select c1, c2 + 1 as c3 from t1 order by c2 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select c1, c2 + 1 as c3 from t1 order by c2) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c,d from cte2;
|
||||
+------+------+
|
||||
| c | d |
|
||||
@ -1828,12 +1828,12 @@ select c,d from cte2;
|
||||
+------+------+
|
||||
|
||||
explain basic with RECURSIVE
|
||||
cte2(c,d) AS (select * from t1 left join t2 on t1.c1=t2.c1 order by t1.c1 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select * from t1 left join t2 on t1.c1=t2.c1 order by t1.c1) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c1 from cte2;
|
||||
ERROR HY000: View's SELECT and view's field list have different column counts
|
||||
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS (select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c from cte2;
|
||||
+------+
|
||||
| c |
|
||||
|
||||
@ -1197,7 +1197,7 @@ select c,d from cte2;
|
||||
|
||||
## 带有order
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS ( select c1, c2 + 1 as c3 from t1 order by c2 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ( (select c1, c2 + 1 as c3 from t1 order by c2) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c,d from cte2;
|
||||
+------+------+
|
||||
| c | d |
|
||||
@ -1352,7 +1352,7 @@ select c,d from cte2;
|
||||
+------+------+
|
||||
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS (select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c from cte2;
|
||||
+------+
|
||||
| c |
|
||||
|
||||
@ -1150,16 +1150,16 @@ select c,d from cte2;
|
||||
|
||||
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS (select c1, c2 + 1 as c3 from t1 order by c2 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select c1, c2 + 1 as c3 from t1 order by c2) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c,d from cte2;
|
||||
|
||||
--error 1353
|
||||
explain basic with RECURSIVE
|
||||
cte2(c,d) AS (select * from t1 left join t2 on t1.c1=t2.c1 order by t1.c1 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select * from t1 left join t2 on t1.c1=t2.c1 order by t1.c1) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c1 from cte2;
|
||||
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS (select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c from cte2;
|
||||
|
||||
|
||||
|
||||
@ -290,11 +290,11 @@ select c,d from cte2;
|
||||
|
||||
## 带有order
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS ( select c1, c2 + 1 as c3 from t1 order by c2 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ( (select c1, c2 + 1 as c3 from t1 order by c2) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c,d from cte2;
|
||||
|
||||
with RECURSIVE
|
||||
cte2(c,d) AS (select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1 union all select c+1, d+1 from cte2 where c < 30)
|
||||
cte2(c,d) AS ((select t1.c1, t2.c2 from t1 left join t2 on t1.c1=t2.c1 order by t1.c1) union all select c+1, d+1 from cte2 where c < 30)
|
||||
select c from cte2;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user