This repository has been archived by the owner on Jun 7, 2021. It is now read-only.
[TRAFODION-3018] Fix issue with UPPER on an UPSHIFT column #1506
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.
The BuiltinFunction::bindNode method inserts Cast nodes with the matchChildType flag on on top of the operands of any function that can be affected by substituting another equal value. For example, OCTET_LENGTH is sensitive to this: While 'ax' = 'ax ' from a SQL point of view, the two values have different octet lengths so we want to force the data type of any substitution to whatever was there originally. The Upper::bindNode method removes the Upper node when its operand already has the Upshift attribute. The bug is, Upper::bindNode wasn't also removing the Cast inserted by BuiltinFunction::bindNode on its behalf. This lead to trouble at code generation time when an UPPER function on an upshifted column was used in an equi-join predicate on a hash join.
The fix is to change Upper::bindNode to also remove any such inserted Cast node.