Handle null variable input with nullable=false#30330
Merged
Conversation
Default values are currently being handled in two places, the graph transformation where a synthetic default expression is created if there was no input expression, and in the evaluator when a reference to the variable is evaluated. Unfortunately neither of these covers the case where a non-nullable variable default needs to be checked within a validation statement Rather than try and fix the overall variable handling here, which runs the risk of encountering more unexpected behavior, we are going to fixup this one case to ensure a null value doesn't continue to slip into validation. A more extensive refactoring of variable handling has been completed in v1.2, and this code will only be relevant for the v1.1 branch.
apparentlymart
approved these changes
Jan 11, 2022
Contributor
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
v1.1 targeted fix for #30307. The variable handling has been overhauled in v1.2 already, but we want to head off any possible incorrect use of null variables slipping into validation when
nullable=falsein the variable configuration. The given test is already fixed in v1.2 by #29959.Default values are currently being handled in two places, the graph
transformation where a synthetic default expression is created if there
was no input expression, and in the evaluator when a reference to the
variable is evaluated. Unfortunately neither of these covers the case
where a non-nullable variable default needs to be checked within a
validation statement
Rather than try and fix the overall variable handling here, which runs
the risk of encountering more unexpected behavior, we are going to fixup
this one case to ensure a null value doesn't continue to slip into
validation. A more extensive refactoring of variable handling has been
completed in v1.2, and this code will only be relevant for the v1.1
branch.
Fixes #30307