Skip to content
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

Merged
merged 1 commit into from Apr 9, 2018

Conversation

DaveBirdsall
Copy link
Contributor

@DaveBirdsall DaveBirdsall commented Apr 4, 2018

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.

@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2540/

@Traf-Jenkins
Copy link

@zellerh
Copy link
Contributor

zellerh commented Apr 5, 2018

+1
I'm glad you found a great fix for this problem!

@asfgit asfgit merged commit 1d248e1 into apache:master Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants