GitHub user DaveBirdsall opened a pull request: https://github.com/apache/trafodion/pull/1506
[TRAFODION-3018] Fix issue with UPPER on an UPSHIFT column 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 suppress substituting one for another. 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. You can merge this pull request into a Git repository by running: $ git pull https://github.com/DaveBirdsall/trafodion Trafodion3018 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/trafodion/pull/1506.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1506 ---- commit 1d248e116f17819de24a2dd14c732238432ce379 Author: Dave Birdsall <dbirdsall@...> Date: 2018-04-04T23:08:52Z [TRAFODION-3018] Fix issue with UPPER on an UPSHIFT column ---- ---