trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/2] incubator-trafodion git commit: [TRAFODION-2822] Make [first n] views non-updatable; prevent bad MERGE plans
Date Wed, 06 Dec 2017 03:39:00 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 318f48725 -> a07222ff3


[TRAFODION-2822] Make [first n] views non-updatable; prevent bad MERGE plans


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

Branch: refs/heads/master
Commit: 1ec20dd82299321dda02981964288fd0a93e092a
Parents: 6d2213d
Author: Dave Birdsall <dbirdsall@apache.org>
Authored: Wed Nov 29 17:43:49 2017 +0000
Committer: Dave Birdsall <dbirdsall@apache.org>
Committed: Wed Nov 29 17:43:49 2017 +0000

----------------------------------------------------------------------
 core/sql/optimizer/NormRelExpr.cpp |  5 -----
 core/sql/optimizer/RelExpr.cpp     | 12 ++++++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1ec20dd8/core/sql/optimizer/NormRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NormRelExpr.cpp b/core/sql/optimizer/NormRelExpr.cpp
index bf8d687..6a4dc4f 100644
--- a/core/sql/optimizer/NormRelExpr.cpp
+++ b/core/sql/optimizer/NormRelExpr.cpp
@@ -6995,11 +6995,6 @@ NABoolean RelRoot::isUpdatableBasic(NABoolean isView,
   // QSTUFF
 
     {
-      // if child is a FirstN node, skip it.
-      if ((child(0)->castToRelExpr()->getOperatorType() == REL_FIRST_N) &&
-	  (child(0)->child(0)))
-	scan = (Scan *)child(0)->child(0)->castToRelExpr();
-      else
 	scan = (Scan *)child(0)->castToRelExpr();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1ec20dd8/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp
index 4f2f295..3ae230d 100644
--- a/core/sql/optimizer/RelExpr.cpp
+++ b/core/sql/optimizer/RelExpr.cpp
@@ -13535,6 +13535,12 @@ MergeUpdate::MergeUpdate(const CorrName &name,
   setCacheableNode(CmpMain::BIND);
   
   setIsMergeUpdate(TRUE);
+
+  // if there is a WHERE NOT MATCHED INSERT action, then the scan
+  // has to take place in the merge node at run time, so we have
+  // to suppress the TSJ transformation on this node
+  if (insertValues)
+    setNoFlow(TRUE);
 }
 
 MergeUpdate::~MergeUpdate() {}
@@ -13629,6 +13635,12 @@ MergeDelete::MergeDelete(const CorrName &name,
   setCacheableNode(CmpMain::BIND);
   
   setIsMergeDelete(TRUE);
+
+  // if there is a WHERE NOT MATCHED INSERT action, then the scan
+  // has to take place in the merge node at run time, so we have
+  // to suppress the TSJ transformation on this node
+  if (insertValues)
+    setNoFlow(TRUE);
 }
 
 MergeDelete::~MergeDelete() {}


Mime
View raw message