Repository: trafodion Updated Branches: refs/heads/master 274d0d884 -> d009f2fd7
[TRAFODION 3047] Cannot get right result using prepare statement with dynamic parameters Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/db68b6f5 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/db68b6f5 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/db68b6f5 Branch: refs/heads/master Commit: db68b6f5c050874aa8ab86f10eae482f08c6cfc5 Parents: 60d717b Author: Andy Yang <[email protected]> Authored: Fri Apr 27 11:19:37 2018 +0800 Committer: Andy Yang <[email protected]> Committed: Fri Apr 27 11:19:37 2018 +0800 ---------------------------------------------------------------------- core/sql/optimizer/RelExpr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/db68b6f5/core/sql/optimizer/RelExpr.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp index 0a86788..ea4495a 100644 --- a/core/sql/optimizer/RelExpr.cpp +++ b/core/sql/optimizer/RelExpr.cpp @@ -7880,11 +7880,17 @@ NABoolean GroupByAgg::tryToPullUpPredicatesInPreCodeGen( else pulledPredicates += tempPulledPreds; + // just remove pulled up predicates from char. input + ValueIdSet newInputs(getGroupAttr()->getCharacteristicInputs()); + myLocalExpr += selectionPred(); + myLocalExpr -= tempPulledPreds; + myLocalExpr.weedOutUnreferenced(newInputs); + // adjust char. inputs - this is not exactly // good style, just overwriting the char. inputs, but // hopefully we'll get away with it at this stage in // the processing - getGroupAttr()->setCharacteristicInputs(myNewInputs); + getGroupAttr()->setCharacteristicInputs(newInputs); } // note that we removed these predicates from our node, it's the
