Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System table with keywords [CORE6482] #6713

Closed
firebird-automations opened this issue Feb 5, 2021 · 11 comments · Fixed by #310
Closed

System table with keywords [CORE6482] #6713

firebird-automations opened this issue Feb 5, 2021 · 11 comments · Fixed by #310

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Maxim Kuzmin (cybermax)

Votes: 3

List of keywords (reserved and non-reserved) changed in major/minor version, including release version.
To determine whether a word is a keyword and it reserved, need to have a dictionary of such words, and update it for each version of the server.
You should also remember that some words will become reserved in the future (LOCALTIME, SQLSTATE, INSERTING/DELETING/UPDATING).
Therefore we need a table of words with the flag "Reserved" and "Reserved in the future".

Commits: dd2fcfe

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

I see one problem with this, a tabe structure and what it contain.
If it present only info about reserved words in currend FB version than it will be simple. But if it should show historical chanes it should have repeated all words for all FB versions as e.g some word is reserved in FB2.5 but it is not a reserved word in FB3.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I'd say this table should be virtual and enlist only keywords for the current engine version.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

> I'd say this table should be virtual

Does you consider to use RDB$TYPES ?

> and enlist only keywords for the current engine version.

and [non-]reserved status, please

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Maxim, FYI - since interbase times we have API call:
int API_ROUTINE KEYWORD_stringIsAToken(const char* in_str)
which returns non-zero if in_str is reserved word.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Vlad,

v3 sub releases had a new keyword (LOCALTIME).

Use of RDB$TYPES may be problematic under this circumstance.

I prefer virtual table.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Alex, being a client API, it's certainly not good enough.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Adriano,

I'm not insist on RDB$TYPES, just want to make sure we take this into account and make a smart decision.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Alex,

API function doesn't get list of keywords from the actual engine, i.e. it depends on fbclient version and could be far from reality.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I consider RDB$TYPES (or any other persistent table) problematic. Imagine an ODS13.1 engine accessing an ODS13.0 database. RDB$ table will show keywords from the prior engine version, while the newer engine may support new keywords. This is why I have suggested a virtual table instead.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Pull request created: https://github.com/FirebirdSQL/firebird/pull/310/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants