[MDEV-26916] Clarify / Update Reserved Word List Created: 2021-10-27 Updated: 2021-12-20 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | N/A |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Kevin Kirsche | Assignee: | Ian Gilfillan |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Good morning, Sorry for not creating a more substantial issue, but I hope this will be sufficient. In relationship to the following issue, we were working on updating the list of reserved words but it seems as though the website documentation specifically regarding the oracle mode keywords is incorrect, incomplete, or at the very least confusing. https://github.com/sqlalchemy/sqlalchemy/issues/7167#issuecomment-952266131 I have replicated the behavior zzzeek shows in his comment. Per https://mariadb.com/kb/en/reserved-words/ The word system is not a reserved word in ORACLE MODE as the documentation uses "<= 10.3.6" meaning only versions that are less than 10.3.6 have this word as reserved. As a result, the following should not trigger an error, but does.
Details:
As such, I believe that https://mariadb.com/kb/en/reserved-words/ is incorrect. |
| Comments |
| Comment by Ian Gilfillan [ 2021-11-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is not actually a reserved word. The problem comes from the parser, in this context only, expecting the word "VERSIONING" to follow, as per https://mariadb.com/kb/en/system-versioned-tables. For clarity however, I'll add a note on the reserved words page. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ian Gilfillan [ 2021-11-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
serg should SYSTEM actually be added as a reserved word? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-11-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A keyword can be reserved or not reserved depending on the context. We have many different lists that apply in various contexts. Obvisouly, we cannot put all that in the manual. So the question is, what should the "reserved word list" in the manual contain. Every keyword that is reserved in at least one context? Keywords that are reserved in specific context, like in CREATE/ALTER? Something else? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ian Gilfillan [ 2021-11-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Everything that a user may need to know, so everything that needs to be quoted in some context, is a good goal. You say we "obviously" can't put that all in the manual. Why not? How deep does the list of contexts go? And secondly, is the inconsistency in a case like SYSTEM desirable? If a user can create a table with a field named SYSTEM, but cannot ALTER a table to add this field, wouldn't it be better to simply mark it as a reserved word that needs quoting in all cases, to avoid confusion? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-11-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The logic was "only require a user to quote a keyword in the context where a parser cannot figure it out otherwise". And this rabbit hole goes pretty deep. Here're the list of rule names from the parser:
Some of the rules a directly used in the grammar, others only help to define other rules. Any given keyword is likely to be present in many of these lists. A "completely reserved" keyword is not present in any of them, otherwise it's reserved in some contexts and not reserved in others. |