Repository: trafodion Updated Branches: refs/heads/master b9ba67017 -> ca40e2cf7
[TRAFODION 3091] revert the change provisionally for test case issue. Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/95af8c16 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/95af8c16 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/95af8c16 Branch: refs/heads/master Commit: 95af8c1685d50b61a8793dd347a1d080dce11067 Parents: e30f17a Author: Andy Yang <yongfeng.y...@esgyn.cn> Authored: Wed Jun 6 23:45:34 2018 +0800 Committer: Andy Yang <yongfeng.y...@esgyn.cn> Committed: Wed Jun 6 23:45:34 2018 +0800 ---------------------------------------------------------------------- core/sql/optimizer/BindItemExpr.cpp | 5 ----- core/sql/optimizer/ItemExpr.cpp | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/95af8c16/core/sql/optimizer/BindItemExpr.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp index 6835c6c..6a2055f 100644 --- a/core/sql/optimizer/BindItemExpr.cpp +++ b/core/sql/optimizer/BindItemExpr.cpp @@ -8622,12 +8622,7 @@ ItemExpr *CurrentTimestampRunning::bindNode(BindWA *bindWA) ItemExpr *Parameter::bindNode(BindWA *bindWA) { if (nodeIsBound()) - { - OperatorTypeEnum opTyp = getOperatorType(); - // All user inputs are treated as outer references in the current scope. - bindWA->getCurrentScope()->addOuterRef(getValueId()); return getValueId().getItemExpr(); - } if (bindWA->getCurrentScope()->context()->inTDFunction()) { //Paramaters and outer references are not supported with rank function. http://git-wip-us.apache.org/repos/asf/trafodion/blob/95af8c16/core/sql/optimizer/ItemExpr.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp index ace5a84..920d2f4 100644 --- a/core/sql/optimizer/ItemExpr.cpp +++ b/core/sql/optimizer/ItemExpr.cpp @@ -3886,7 +3886,23 @@ ItemExpr * Parameter::copyTopNode(ItemExpr *derivedNode, CollHeap* outHeap) ItemExpr * DynamicParam::copyTopNode(ItemExpr *derivedNode, CollHeap* outHeap) { - return this; + ItemExpr *result; + + if (derivedNode == NULL) { + result = new (outHeap) DynamicParam(paramName_, indicatorName_, outHeap); + ((DynamicParam *) result)->setRowsetSize(rowsetSize_); + ((DynamicParam *) result)->setRowsetInfo(rowsetInfo_); + ((DynamicParam *) result)->setParamHeading(heading_); + ((DynamicParam *) result)->setParamTablename(tablename_); + // we remember our original dynamic parameter because we + // must use their valueid at dynamicparam::codegen time + ((DynamicParam *) result)->setOriginal(this); + } + + else + result = derivedNode; + + return Parameter::copyTopNode(result, outHeap); } const NAType * DynamicParam::pushDownType(NAType& desiredType,