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/06/22 00:21:24 UTC

[1/5] trafodion git commit: [TRAFODION-2901] Self-reference Holloween problem fix

Repository: trafodion
Updated Branches:
  refs/heads/master 0a2ed369d -> c0a125ed3


[TRAFODION-2901] Self-reference Holloween problem fix


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/c8c5bce5
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/c8c5bce5
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/c8c5bce5

Branch: refs/heads/master
Commit: c8c5bce5baf23c131aa622c6ca6672daa0eb2318
Parents: b04bfda
Author: Guhaiyan <ha...@esgyn.cn>
Authored: Mon May 28 01:40:27 2018 +0000
Committer: Guhaiyan <ha...@esgyn.cn>
Committed: Mon May 28 01:40:27 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelExpr.cpp | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c8c5bce5/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp
index ea4495a..edad4dd 100644
--- a/core/sql/optimizer/RelExpr.cpp
+++ b/core/sql/optimizer/RelExpr.cpp
@@ -13331,6 +13331,10 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
     localExprs += *setOfValuesReqdByParent ;
   localExprs += exprsInDerivedClasses_;
 
+  ValueIdSet original_output;
+  if (avoidHalloween() && child(0) && child(0)->getGroupAttr())
+    original_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
+
   // ---------------------------------------------------------------------
   // Check which expressions can be evaluated by my child.
   // Modify the Group Attributes of those children who inherit some of
@@ -13341,6 +13345,33 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
 				newExternalInputs,
 				predicatesOnParent,
 				&localExprs);
+
+  if (avoidHalloween() && child(0) && child(0)->getGroupAttr())
+    {
+      ValueIdSet cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
+      if (cur_output.isEmpty())
+        {
+          ValueId exprId;
+          ValueId atLeastOne;
+
+          for (exprId = original_output.init();
+               original_output.next(exprId);
+               original_output.advance(exprId))
+            {
+              atLeastOne = exprId;
+              if (!(exprId.getItemExpr()->doesExprEvaluateToConstant(FALSE, TRUE)))
+                {
+                  child(0)->getGroupAttr()->addCharacteristicOutputs(exprId);
+                  break;
+                }
+            }
+         cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
+         if (cur_output.isEmpty())
+           {
+             child(0)->getGroupAttr()->addCharacteristicOutputs(atLeastOne);
+           }
+        }
+    }	
 }
 
 /*


[4/5] trafodion git commit: [TRAFODION-2901] add explanation

Posted by hz...@apache.org.
[TRAFODION-2901] add explanation


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/b9334761
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/b9334761
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/b9334761

Branch: refs/heads/master
Commit: b933476147dbc2eb699c9eb7be56950c4697459a
Parents: c5ef360
Author: Guhaiyan <ha...@esgyn.cn>
Authored: Wed Jun 20 02:32:11 2018 +0000
Committer: Guhaiyan <ha...@esgyn.cn>
Committed: Wed Jun 20 02:32:11 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelExpr.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b9334761/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp
index 14b841c..d203ec1 100644
--- a/core/sql/optimizer/RelExpr.cpp
+++ b/core/sql/optimizer/RelExpr.cpp
@@ -13342,12 +13342,17 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
 				predicatesOnParent,
 				&localExprs);
 
+/*to fix jira 18-20180111-2901  
+ *For query " insert into to t1 select seqnum(seq1, next) from t1;", there is no SORT as left child of TSJ, and it 
+ *is a self-referencing updates Halloween problem. In NestedJoin::genWriteOpLeftChildSortReq(), child(0)
+ *producing no outputs for this query, which means that there is no column to sort on. So we solve this by 
+ *having the source for Halloween insert produce at least one output column always.
+ * */
   if (avoidHalloween() && child(0) &&
       child(0)->getOperatorType() == REL_SCAN &&
       child(0)->getGroupAttr())
     {
-      ValueIdSet cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
-      if (cur_output.isEmpty())
+      if (child(0)->getGroupAttr()->getCharacteristicOutputs().isEmpty())
         {
           ValueId exprId;
           ValueId atLeastOne;
@@ -13364,8 +13369,7 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
                   break;
                 }
             }
-         cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
-         if (cur_output.isEmpty())
+         if (child(0)->getGroupAttr()->getCharacteristicOutputs().isEmpty())
            {
              child(0)->getGroupAttr()->addCharacteristicOutputs(atLeastOne);
            }


[5/5] trafodion git commit: Merge [TRAFODION-2901] Self-reference Holloween problem fix PR-1581

Posted by hz...@apache.org.
Merge [TRAFODION-2901] Self-reference Holloween problem fix PR-1581


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/c0a125ed
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/c0a125ed
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/c0a125ed

Branch: refs/heads/master
Commit: c0a125ed3616a03c0951373a24ae8a1912cd9c6a
Parents: 0a2ed36 b933476
Author: Hans Zeller <hz...@apache.org>
Authored: Fri Jun 22 00:20:53 2018 +0000
Committer: Hans Zeller <hz...@apache.org>
Committed: Fri Jun 22 00:20:53 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelExpr.cpp | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c0a125ed/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------


[2/5] trafodion git commit: [TRAFODION-2901] take one in column list as source for output

Posted by hz...@apache.org.
[TRAFODION-2901] take one in column list as source for output


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/00378f9b
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/00378f9b
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/00378f9b

Branch: refs/heads/master
Commit: 00378f9bdc18f649cc3314e445a1e2ee5810eceb
Parents: c8c5bce
Author: Guhaiyan <ha...@esgyn.cn>
Authored: Fri Jun 1 01:43:21 2018 +0000
Committer: Guhaiyan <ha...@esgyn.cn>
Committed: Fri Jun 1 01:43:21 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelExpr.cpp | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/00378f9b/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp
index edad4dd..7f881d8 100644
--- a/core/sql/optimizer/RelExpr.cpp
+++ b/core/sql/optimizer/RelExpr.cpp
@@ -13331,10 +13331,6 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
     localExprs += *setOfValuesReqdByParent ;
   localExprs += exprsInDerivedClasses_;
 
-  ValueIdSet original_output;
-  if (avoidHalloween() && child(0) && child(0)->getGroupAttr())
-    original_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
-
   // ---------------------------------------------------------------------
   // Check which expressions can be evaluated by my child.
   // Modify the Group Attributes of those children who inherit some of
@@ -13354,9 +13350,10 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
           ValueId exprId;
           ValueId atLeastOne;
 
-          for (exprId = original_output.init();
-               original_output.next(exprId);
-               original_output.advance(exprId))
+          ValueIdSet output_source = child(0)->getTableDescForExpr()->getColumnList();
+          for (exprId = output_source.init();
+               output_source.next(exprId);
+               output_source.advance(exprId))
             {
               atLeastOne = exprId;
               if (!(exprId.getItemExpr()->doesExprEvaluateToConstant(FALSE, TRUE)))


[3/5] trafodion git commit: [TRAFODION-2901] fix core dump

Posted by hz...@apache.org.
[TRAFODION-2901] fix core dump


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/c5ef3604
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/c5ef3604
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/c5ef3604

Branch: refs/heads/master
Commit: c5ef36040b155a310e98739803ce43bcc6e01d57
Parents: 00378f9
Author: Guhaiyan <ha...@esgyn.cn>
Authored: Mon Jun 4 02:50:34 2018 +0000
Committer: Guhaiyan <ha...@esgyn.cn>
Committed: Mon Jun 4 02:50:34 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelExpr.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c5ef3604/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp
index 7f881d8..14b841c 100644
--- a/core/sql/optimizer/RelExpr.cpp
+++ b/core/sql/optimizer/RelExpr.cpp
@@ -13342,7 +13342,9 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
 				predicatesOnParent,
 				&localExprs);
 
-  if (avoidHalloween() && child(0) && child(0)->getGroupAttr())
+  if (avoidHalloween() && child(0) &&
+      child(0)->getOperatorType() == REL_SCAN &&
+      child(0)->getGroupAttr())
     {
       ValueIdSet cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
       if (cur_output.isEmpty())