Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
with cte as (select 1) select 1 union with cte as (select 1) select * from cte;
with cte as (select 1) (select 1);
with cte as (select 1) (select 1 union select 1);
select * from (with cte as (select 1) select 1 union select 2) qn;
select * from t where 1 > (with cte as (select 2) select * from cte);
( with cte(n) as ( select 1 ) select n+1 from cte union select n+2 from cte) union select 1;
( with cte(n) as ( select 1 ) select n+1 from cte) union select 1;
( with cte(n) as ( select 1 ) (select n+1 from cte)) union select 1;
Bug Report
Please answer these questions before submitting your issue. Thanks!
What did you do? If possible, provide a recipe for reproducing the error.
What did you expect to see?
The same as MySQL
What did you see instead? Inconsistent with MySQL
What version of TiDB SQL Parser are you using?
master