Commit 41cafb0
committed
Fix FROM-first SELECT syntax with WITH clause and nested subqueries
Handle two cases that were not working:
1. WITH clause followed by FROM-first syntax: `WITH 1 as n FROM t SELECT n`
2. Nested FROM-first syntax in subqueries: `FROM (FROM t SELECT *) SELECT x`
In parseSelect(), check for FROM token after WITH clause and parse the
table expression before expecting SELECT. In parseTableExpression(),
add FROM token check to recognize FROM-first subqueries.
Fixes 3 statements in 02417_from_select_syntax.1 parent c5f3dca commit 41cafb0
File tree
2 files changed
+14
-6
lines changed- parser
- testdata/02417_from_select_syntax
2 files changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
809 | | - | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
810 | 819 | | |
811 | 820 | | |
812 | 821 | | |
| |||
1408 | 1417 | | |
1409 | 1418 | | |
1410 | 1419 | | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1411 | 1424 | | |
1412 | 1425 | | |
1413 | 1426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 2 | | |
0 commit comments