[MDEV-14680] Possible parser mistake - VERSIONING is allowed as identifier Created: 2017-12-16 Updated: 2017-12-27 Resolved: 2017-12-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser, Versioned Tables |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.3.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The following erroneous statement
naturally ends with a syntax error, however the hint about the error location is not helpful:
WITH <something> clause is accepted here because we can have a CTE in the CREATE statement
and versioning is accepted as a CTE name (or as any other identifier, for that matter):
The standard says VERSIONING is a reserved word, so I'm not sure it should be allowed as an identifier. |
| Comments |
| Comment by Sergei Golubchik [ 2017-12-17 ] | |
|
What behavior is expected?
also gets ...right syntax to use near 'partition by system_time interval 1 day (partition p0 versioning, partition pn a' You're right, versioning is allowed as an identifier, because it doesn't introduce ambiguities into the grammar, as far as I know. Or does it? If you have an example where it does, we might need to make versioning reserved. | |
| Comment by Elena Stepanova [ 2017-12-17 ] | |
|
I don't have an example for ambiguity, not yet anyway. The behavior caught me by surprise, because the initial statement (create table t (..) with versioning partition ...), was not intentional, I honestly missed system there and then was very confused because the parser complained about PARTITION, which seemed to be in a valid place, it took me a while to realize where the actual problem was. If it complained right syntax to use near 'versioning ...', it would have been much easier (which would have happened if versioning was not allowed as an identifier). That said, I realize that this confusion is not enough reason for extra restrictions, so as long as it's intentional behavior, I'm closing it as not a bug. If we do end up with ambiguity in the final syntax, I'll re-open it. |