Make RelationalExpression#equalsWithoutChildren() compare the result values where necessary#4185
Open
RobertBrunel wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
To Do: Can we make the sanity-check unconditional? |
40c8825 to
333bc75
Compare
equalsWithoutChildren() in plan nodes to also compare the result types where necessaryRelationalExpression#equalsWithoutChildren() compare the result types where necessary
333bc75 to
be94860
Compare
RelationalExpression#equalsWithoutChildren() compare the result types where necessaryRelationalExpression#equalsWithoutChildren() compare the result values where necessary
…t values where necessary This change adds `semanticEqualsForResults(…)` comparisons to any `RelationalExpression#equalsWithoutChildren()` implementations that were missing it. Without this comparison, the Cascades memoizer will unify plans that differ (_only_) in their result value or type, which is incorrect. See Issue FoundationDB#4184 for details. This change does not adjust the `hashCodeWithoutChildren()` methods likewise, as this is not strictly necessary. Leaving these methods untouched avoids needless plan changes (since the hashes are used as a tie-breaker in the cost model). The potentially incorrect memoization prior to this change can trigger a sanity-check in `Reference.insertUnchecked()`, if enabled. Note though that in production the sanity-checks are disabled, so a violation would have gone undetected there. Testing: * Existing test coverage. * Add missing `equals…()` coverage for `RecordQueryDeletePlan`. Fixes FoundationDB#4184.
be94860 to
7435863
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 change adds
semanticEqualsForResults(…)comparisons to anyRelationalExpression#equalsWithoutChildren()implementations that were missing it. Without this comparison, the Cascades memoizer will unify plans that differ (only) in their result value or type, which is incorrect. See Issue #4184 for details.This change does not adjust the
hashCodeWithoutChildren()methods likewise, as this is not strictly necessary. Leaving these methods untouched avoids needless plan changes (since the hashes are used as a tie-breaker in the cost model).The potentially incorrect memoization prior to this change can trigger a sanity-check in
Reference.insertUnchecked(), if enabled. Note though that in production the sanity-checks are disabled, so a violation would have gone undetected there.Testing:
equals…()coverage forRecordQueryDeletePlan.Fixes #4184.