[MDEV-11878] Shift/reduce conflict in window_spec clause: OVER (rows ...) Created: 2017-01-23 Updated: 2017-02-02 Resolved: 2017-02-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-ga | ||
| Issue Links: |
|
||||||||
| Description |
|
The window_spec clause in sql_yacc.yy has a shift/reduce conflict. In a query like this:
It's not clear what rows stands for. It can be ident in opt_window_ref:
or the ROWS keyword in window_frame_units:
The conflict happens because ROWS is a non-reserved keyword in MariaDB. Possible solutions:
|
| Comments |
| Comment by Igor Babaev [ 2017-01-31 ] |
|
Alexander, |
| Comment by Alexander Barkov [ 2017-01-31 ] |
|
Igor, I don't know why ROWS is not reserved. It has been non-reserved in MySQL/MariaDB for years. Perhaps it did not cause any conflicts earlier. PRECEDING must be a non-reserved keyword. See ROWS is a reserved keyword in the SQL standard. I don't mind to make it reserved in MariaDB. But usually we try not to introduce new reserved keywords, unless it's absolutely necessary. |
| Comment by Igor Babaev [ 2017-01-31 ] |
|
This conflict causes the problems of |
| Comment by Igor Babaev [ 2017-02-02 ] |
|
This problem was resolved by the patch for the bug mdev-9976. |