You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2018/03/20 21:27:32 UTC

[1/2] trafodion git commit: [TRAFODION-3000] Fix binder issue with index maintenance on MERGE DELETE

Repository: trafodion
Updated Branches:
  refs/heads/master 3e26f8621 -> a52f46229


[TRAFODION-3000] Fix binder issue with index maintenance on MERGE DELETE


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

Branch: refs/heads/master
Commit: b4c60e151b3103d43ded0e62d9da7d9e69821e29
Parents: 21735bc
Author: Dave Birdsall <db...@apache.org>
Authored: Mon Mar 19 23:14:57 2018 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Mon Mar 19 23:14:57 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/Inlining.cpp | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b4c60e15/core/sql/optimizer/Inlining.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/Inlining.cpp b/core/sql/optimizer/Inlining.cpp
index f8d7b66..e93e33b 100644
--- a/core/sql/optimizer/Inlining.cpp
+++ b/core/sql/optimizer/Inlining.cpp
@@ -1888,7 +1888,7 @@ static RelExpr *createIMNode(BindWA *bindWA,
 			     NABoolean isIMInsert,
 			     NABoolean useInternalSyskey,
                              NABoolean isForUpdateOrMergeUpdate,
-                             NABoolean isForMerge, // mergeDelete OR mergeUpdate
+                             NABoolean mergeDeleteWithInsertOrMergeUpdate,
 			     NABoolean isEffUpsert)
 {
    
@@ -1906,7 +1906,8 @@ static RelExpr *createIMNode(BindWA *bindWA,
   // that correspond to the base table. Hence we introduce 
   // robustDelete below. This flag could also be called 
   // isIMOnAUniqueIndexForMerge
-  NABoolean robustDelete = (isForMerge && index->isUniqueIndex()) || (isEffUpsert && index->isUniqueIndex());
+  NABoolean robustDelete = (mergeDeleteWithInsertOrMergeUpdate && index->isUniqueIndex()) || 
+                           (isEffUpsert && index->isUniqueIndex());
 
   tableCorrName.setCorrName(isIMInsert ?  NEWCorr : OLDCorr);
   
@@ -2127,8 +2128,15 @@ RelExpr *GenericUpdate::createIMNodes(BindWA *bindWA,
   if (getOperatorType() == REL_UNARY_DELETE ||
       getOperatorType() == REL_UNARY_UPDATE ||
       isEffUpsert)
-    
-    indexDelete = indexOp = createIMNode(bindWA,
+    {
+      NABoolean mergeDeleteWithInsertOrMergeUpdate = isMerge();
+      if (mergeDeleteWithInsertOrMergeUpdate && 
+          (getOperatorType() == REL_UNARY_DELETE) && 
+          (!insertValues()))
+        // merge delete without an insert
+        mergeDeleteWithInsertOrMergeUpdate = FALSE;
+      
+      indexDelete = indexOp = createIMNode(bindWA,
 					 tableCorrName,
                                          indexCorrName,
 					 index,
@@ -2136,8 +2144,9 @@ RelExpr *GenericUpdate::createIMNodes(BindWA *bindWA,
 					 FALSE,
     			       		 useInternalSyskey,
                                          isForUpdateOrMergeUpdate,
-                                         isMerge(),
+                                         mergeDeleteWithInsertOrMergeUpdate,
 					 isEffUpsert);
+    }
 
   if ((getOperatorType() == REL_UNARY_UPDATE) || isEffUpsert){
     indexOp = new (bindWA->wHeap()) Union(indexDelete, indexInsert, 


[2/2] trafodion git commit: Merge [TRAFODION-3000] PR 1484 Fix IM binder issue for MERGE DELETE

Posted by db...@apache.org.
Merge [TRAFODION-3000] PR 1484 Fix IM binder issue for MERGE DELETE


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

Branch: refs/heads/master
Commit: a52f46229aedbf26f08745ce9c0151cee9486eaf
Parents: 3e26f86 b4c60e1
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Mar 20 21:26:33 2018 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Mar 20 21:26:33 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/Inlining.cpp | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------