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

Make INSERTING/UPDATING/DELETING reserved words to fix ambiguity with boolean expresions [CORE4791] #1919

Closed
firebird-automations opened this issue May 15, 2015 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

Boolean expressions was created with this bad ambiguity:

----------
For compatibility reasons, the names INSERTING, UPDATING and DELETING (which aren't keywords)
work (like in 2.5 and previous) as boolean expressions and work as values (column or
variable) in non-booleans expressions. For example, in:
SELECT INSERTING, NOT INSERTING FROM TEST WHERE INSERTING AND INSERTING IS TRUE
the INSERTING's are respectively recognized as value, keyword, keyword and value.
----------

Now, making these words reserved removes the boolean expression problem, so that:

- Non trigger-usage (column, variable, parameter name) of these words must be quoted
- Database restored preserve the functionality until the code is manually changed

Compatibility note:

- Who uses them in triggers outside of boolean expressions, will have a code meaning a different thing, as the previous usage as column/variable/parameter name will be transformed to a boolean expression related to the trigger action. Double quoting them in this context makes the code work as before.

Commits: ba03a8c FirebirdSQL/fbt-repository@e66b0fd

====== Test Details ======

"Database restored preserve the functionality until the code is manually changed " -- not tested yet.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

description: Boolean expressions was created with this bad ambiguity:

For compatibility reasons, the names INSERTING, UPDATING and DELETING (which aren't keywords)
work (like in 2.5 and previous) as boolean expressions and work as values (column or
variable) in non-booleans expressions. For example, in:
SELECT INSERTING, NOT INSERTING FROM TEST WHERE INSERTING AND INSERTING IS TRUE
the INSERTING's are respectively recognized as value, keyword, keyword and value.

Now, making these words reserved removes the boolean expression problem, so that:

- Non trigger-usage (column, variable, parameter name) of these words must be quoted
- Database restored preserve the functionality until the code is manually changed

Compatibility note:

- Who uses them in triggers outside of boolean expressions, will have a code meaning a different thing, as the previous usage as column/variable/parameter name will be transformed to a boolean expression related to the trigger action. Double quoting them in this context makes the code work as before.

=>

Boolean expressions was created with this bad ambiguity:

----------
For compatibility reasons, the names INSERTING, UPDATING and DELETING (which aren't keywords)
work (like in 2.5 and previous) as boolean expressions and work as values (column or
variable) in non-booleans expressions. For example, in:
SELECT INSERTING, NOT INSERTING FROM TEST WHERE INSERTING AND INSERTING IS TRUE
the INSERTING's are respectively recognized as value, keyword, keyword and value.
----------

Now, making these words reserved removes the boolean expression problem, so that:

- Non trigger-usage (column, variable, parameter name) of these words must be quoted
- Database restored preserve the functionality until the code is manually changed

Compatibility note:

- Who uses them in triggers outside of boolean expressions, will have a code meaning a different thing, as the previous usage as column/variable/parameter name will be transformed to a boolean expression related to the trigger action. Double quoting them in this context makes the code work as before.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done with caveats

Test Details: "Database restored preserve the functionality until the code is manually changed " -- not tested yet.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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