[MDEV-10060] Extra parentheses around CTE cause a syntax error Created: 2016-05-12 Updated: 2017-02-09 Resolved: 2017-02-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE, Parser |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Igor Babaev |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | 10.2-rc, CTE | ||
| Issue Links: |
|
||||
| Description |
|
I'm not quite sure what SQL standard thinks about it, but it looks somewhat inconsistent. Both of these work:
But here the second one does not work:
Another example. Both of these work:
But here the second one does not work:
|
| Comments |
| Comment by Elena Stepanova [ 2016-09-07 ] | ||||||||||||
|
Both variants work in PostgreSQL. | ||||||||||||
| Comment by Igor Babaev [ 2017-02-09 ] | ||||||||||||
|
The SQL Standard says;
So the following is not valid:
while this is ok
| ||||||||||||
| Comment by Igor Babaev [ 2017-02-09 ] | ||||||||||||
|
See my explanation in the comments |