Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
10.2
-
None
Description
testcase
create table t1 (i int); |
insert into t1 values (1),(2),(3); |
(select * from t1); #this works |
(with cte as (select * from t1) select * from cte); #but this returns syntax error |
with cte as (select * from t1) (select * from cte UNION select * from t1); |
with cte as (select * from t1) (select * from cte UNION select * from t1) LIMIT 1; |
MariaDB [test]> create table t1 (i int);
|
Query OK, 0 rows affected (0.166 sec)
|
|
MariaDB [test]> insert into t1 values (1),(2),(3);
|
Query OK, 3 rows affected (0.025 sec)
|
Records: 3 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> (select * from t1);
|
+------+
|
| i |
|
+------+
|
| 1 |
|
| 2 |
|
| 3 |
|
+------+
|
3 rows in set (0.000 sec)
|
|
MariaDB [test]> (with cte as (select * from t1) select * from cte);
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'with cte as (select * from t1) select * from cte)' at line 1
|
MariaDB [test]> with cte as (select * from t1) (select * from cte UNION select * from t1);
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION select * from t1)' at line 1
|
MariaDB [test]> with cte as (select * from t1) (select * from cte UNION select * from t1) LIMIT 1;
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION select * from t1) LIMIT 1' at line 1
|