Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CTE parser #1217

Merged
merged 5 commits into from
Apr 29, 2021
Merged

fix CTE parser #1217

merged 5 commits into from
Apr 29, 2021

Conversation

wjhuang2016
Copy link
Member

@wjhuang2016 wjhuang2016 commented Apr 28, 2021

Signed-off-by: wjhuang2016 huangwenjun1997@gmail.com

What problem does this PR solve?

Fix #1218
The with clause should be set before setOprStmt, not selectStmt.
For example:
with cte as (select 1) select 1 union select 2;

The with clause should be added on the SetOprStmt, not the first selectStmt.
See the added tests.

What is changed and how it works?

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
@tisonkun tisonkun added this to In progress in CTE(common table expression) Apr 28, 2021
ast/dml.go Show resolved Hide resolved
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
@wjhuang2016 wjhuang2016 removed this from In progress in CTE(common table expression) Apr 29, 2021
xiongjiwei
xiongjiwei previously approved these changes Apr 29, 2021
@ti-srebot ti-srebot added the status/LGT1 LGT1 label Apr 29, 2021
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
@ti-srebot ti-srebot removed the status/LGT1 LGT1 label Apr 29, 2021
@ti-srebot ti-srebot added the status/LGT2 LGT2 label Apr 29, 2021
@wjhuang2016 wjhuang2016 merged commit a8654fa into pingcap:master Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some CTE statement is parse wrongly
5 participants