You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by hz...@apache.org on 2018/05/31 14:11:17 UTC
[1/2] trafodion git commit: [TRAFODION 3091] Unnamed Dynamic
parameter doesn't work in WITH statement
Repository: trafodion
Updated Branches:
refs/heads/master ed0daf50f -> 8dbf5dffc
[TRAFODION 3091] Unnamed Dynamic parameter doesn't work in WITH statement
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/e30f17a5
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/e30f17a5
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/e30f17a5
Branch: refs/heads/master
Commit: e30f17a5f6aee0ca5aa49868d8cef255d3414e72
Parents: 609d7a4
Author: Andy Yang <yo...@esgyn.cn>
Authored: Thu May 31 00:16:19 2018 +0800
Committer: Andy Yang <yo...@esgyn.cn>
Committed: Thu May 31 00:16:19 2018 +0800
----------------------------------------------------------------------
core/sql/optimizer/BindItemExpr.cpp | 5 +++++
core/sql/optimizer/ItemExpr.cpp | 18 +-----------------
2 files changed, 6 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafodion/blob/e30f17a5/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index 6a2055f..6835c6c 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -8622,7 +8622,12 @@ 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/e30f17a5/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index 920d2f4..ace5a84 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -3886,23 +3886,7 @@ ItemExpr * Parameter::copyTopNode(ItemExpr *derivedNode, CollHeap* outHeap)
ItemExpr * DynamicParam::copyTopNode(ItemExpr *derivedNode, CollHeap* outHeap)
{
- 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);
+ return this;
}
const NAType * DynamicParam::pushDownType(NAType& desiredType,
[2/2] trafodion git commit: Merge [TRAFODION 3091] Unnamed Dynamic parameter doesn't work in WITH state… PR-1585
Posted by hz...@apache.org.
Merge [TRAFODION 3091] Unnamed Dynamic parameter doesn't work in WITH state… PR-1585
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/8dbf5dff
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/8dbf5dff
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/8dbf5dff
Branch: refs/heads/master
Commit: 8dbf5dffcb5a7d591ed6bd3d1123c6df1b6ad30a
Parents: ed0daf5 e30f17a
Author: Hans Zeller <hz...@apache.org>
Authored: Thu May 31 14:10:23 2018 +0000
Committer: Hans Zeller <hz...@apache.org>
Committed: Thu May 31 14:10:23 2018 +0000
----------------------------------------------------------------------
core/sql/optimizer/BindItemExpr.cpp | 5 +++++
core/sql/optimizer/ItemExpr.cpp | 18 +-----------------
2 files changed, 6 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafodion/blob/8dbf5dff/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------