Update reserved words list, add more join support #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the list of reserved words that cannot be used unquoted as identifiers. The list was generated using a C program that iterates over the full set of keywords in SQLite and attempts to do
CREATE TABLE t(<keyword> INTEGER);for each one, tracking which keywords fail. Many words that were previously in thereservedMappassed this test and have been removed.Removing items from that list prompted a bit of yak shaving:
alias_identrule has been split intoalias_ident_explicit(i.e. usingAS) andalias_ident_implicit(not usingAS, e.g.SELECT * FROM foo bar WHERE bar.val = 1).invalidImplicitAliasMapis added (generated using the same C program) to track which keywords cannot be used as implicit aliases. There's a lot of overlap withreserveredMap, but there are items exclusive to both lists.join_oprule didn't implement them, but now they were broken entirely, so I went ahead and implemented them + other missing joins.alter_table_stmtrule now only supports one table name (which is correct for SQLite), as the previous rule was not compatible with the alias rule updates. That rule usedtable_ref_listwhich supports aliases for table names, which caused the parser to interpret things likeRENAMEas table aliases. Aliases are not valid inALTER TABLEstatements.