Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 0fbf499d9 -> 495ab96aa


[TRAFODION-2277] Remove obsolete entry-sequenced code from compiler


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

Branch: refs/heads/master
Commit: 15971f3d1b4de27ecd04dd06b8534c49c7fc7123
Parents: 54abce6
Author: Dave Birdsall <birdsall@edev07.esgyn.local>
Authored: Wed Oct 12 15:42:40 2016 +0000
Committer: Dave Birdsall <birdsall@edev07.esgyn.local>
Committed: Wed Oct 12 15:42:40 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt       |  4 ++--
 core/sql/executor/dfs2fe.h         |  4 +---
 core/sql/optimizer/BindRelExpr.cpp | 34 ++-------------------------------
 core/sql/optimizer/ImplRule.cpp    |  4 ----
 core/sql/optimizer/Inlining.cpp    | 19 ------------------
 core/sql/optimizer/NAFileSet.cpp   |  8 --------
 core/sql/optimizer/NAFileSet.h     |  4 ----
 core/sql/optimizer/RelExpr.cpp     |  5 +----
 8 files changed, 6 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 1f60e80..1f97f46 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -1040,7 +1040,7 @@ $1~String1 --------------------------------
 3407 42000 99999 BEGINNER MAJOR DBADMIN Duplicate TABLE SIZE clauses were 
specified.
 3408 ZZZZZ 99999 BEGINNER MAJOR DBADMIN --- unused in this stream  ---
 3409 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Declaring a cursor on an embedded 
INSERT statement is not yet supported.
-3410 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Users cannot specify a value for 
SYSKEY column on an entry-sequenced table $1~TableName.
+3410 ZZZZZ 99999 BEGINNER MAJOR DBADMIN -- unused --
 3411 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Expressions are not allowed as 
IDENTITY column values. Specify DEFAULT or supply a valid numeric value.
 3412 ZZZZZ 99999 BEGINNER MAJOR DBADMIN IDENTITY column $0~ColumnName must be 
the primary key or must have a unique index on it.
 3413 ZZZZZ 99999 BEGINNER MAJOR DBADMIN The NOT NULL constraint on IDENTITY 
column $0~ColumnName must be NOT DROPPABLE.
@@ -1084,7 +1084,7 @@ $1~String1 --------------------------------
 4015 42000 99999 BEGINNER MAJOR DBADMIN Aggregate functions are placed 
incorrectly: $0~string0.
 4016 42000 99999 BEGINNER MAJOR DBADMIN The number of derived columns 
($0~int0) must equal the degree of the derived table ($1~int1).
 4017 42000 99999 BEGINNER MAJOR DBADMIN Derived column name $0~ColumnName was 
specified more than once.
-4018 42000 99999 BEGINNER MAJOR DBADMIN Rows cannot be deleted from an 
entry-sequenced table.
+4018 42000 99999 BEGINNER MAJOR DBADMIN -- unused --
 4019 42000 99999 BEGINNER MAJOR DBADMIN The select list of a subquery in a 
select list must be scalar (degree of one).
 4020 42000 99999 BEGINNER MAJOR DBADMIN Arithmetic operations on row value 
constructors are not allowed.
 4021 42000 99999 BEGINNER MAJOR DBADMIN The select list contains a nongrouping 
non-aggregated column, $0~ColumnName.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/executor/dfs2fe.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/dfs2fe.h b/core/sql/executor/dfs2fe.h
index 9bb6768..74cdade 100644
--- a/core/sql/executor/dfs2fe.h
+++ b/core/sql/executor/dfs2fe.h
@@ -59,9 +59,7 @@ enum ExeDfs2feEnum
                                            // THE SUPPLIED RECORD IS TOO LONG.
                                            // ALSO RETURNED BY THE DISCPROCESS 
WHEN
                                            // IT ENCOUNTERS A BAD FIELD IN A 
STORED
-                                           // RECORD, OR IF AN ENTRY-SEQUENCED
-                                           // RECORD UPDATE IS ATTEMPTED WHICH
-                                           // CHANGES THE LENGTH OF A VARCHAR 
FIELD.
+                                           // RECORD.
                                            //------------------------------
    , FEBADRECDESC            = dfs2fe_base +  1032        // THE RECORD 
DESCRIPTION IS
                                            // INCONSISTENT.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp 
b/core/sql/optimizer/BindRelExpr.cpp
index 0bb24da..1243181 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -7506,7 +7506,6 @@ RelExpr *Scan::bindNode(BindWA *bindWA)
 
     // Second we make sure the the underlying base table is key sequenced
     // in case of embedded d/u and streams
-    // -- for as long as we don't support entry sequenced tables
     if (boundView->getLeftmostScanNode()) {
       // this is not a "create view V(a) as values(3)" kind of a view
       const NATable * baseTable =
@@ -7757,7 +7756,6 @@ RelExpr *Scan::bindNode(BindWA *bindWA)
   // QSTUFF
   // Second we make sure the the underlying base table is key sequenced in case
   // of embedded d/u and streams
-  // -- for as long as we don't support entry sequenced tables
   if (getGroupAttr()->isStream()){
 
     if (!naTable->getClusteringIndex()->isKeySequenced() ||
@@ -9614,9 +9612,7 @@ RelExpr *Insert::bindNode(BindWA *bindWA)
   }
 
   // Compute total number of columns. Note that there may be some unused
-  // entries in newRecExprArray(), in the following cases:
-  // - An SQL/MP entry sequenced table, entry 0 will not be used as
-  //   the syskey (col 0) is not stored in that type of table
+  // entries in newRecExprArray(), in the following case:
   // - For computed columns that are not stored on disk
   totalColCount = userColListPtr->entries() + sysColList.entries();
   newRecExprArray().resize(totalColCount);
@@ -10004,8 +10000,7 @@ RelExpr *Insert::bindNode(BindWA *bindWA)
       
       // if we need to add the default value, we don't have a new rec expr yet
       if (NOT newRecExprArray().used(i)) {
-        // check for SQL/MP entry sequenced tables omitted above
-
+       
         const char* defaultValueStr = NULL;
         ItemExpr *  defaultValueExpr = NULL;
         NABoolean needToDeallocateColDefaultValueStr = FALSE;
@@ -11094,16 +11089,6 @@ RelExpr *Delete::bindNode(BindWA *bindWA)
     checkConstraints().clear();
   }
 
-  if (getTableDesc()->getClusteringIndex()->getNAFileSet()->isEntrySequenced())
-    {
-      // 4018 DELETE query cannot be used against an Entry-Seq table.
-      *CmpCommon::diags() << DgSqlCode(-4018) <<
-        DgTableName(getTableDesc()->getNATable()->getTableName().
-                      getQualifiedNameAsAnsiString());
-      bindWA->setErrStatus();
-      return this;
-    }
-
   if (NOT getTableDesc()->getVerticalPartitions().isEmpty())
     {
       // 4029 DELETE query cannot be used on a vertically partitioned table.
@@ -12047,21 +12032,6 @@ RelExpr *GenericUpdate::bindNode(BindWA *bindWA)
      bindWA->setErrStatus();
      return NULL;
   }
-
-  // By setting the CQD OVERRIDE_SYSKEY to 'ON', the users
-  // are allowed to specify a SYSKEY value on an INSERT.
-  // We achieve this by treating a system column as a user column.
-  // This support is only provided for key sequenced files
-  // for MX and MP tables.
-  if (getOperatorType() == REL_UNARY_INSERT &&
-      naTable->hasSystemColumnUsedAsUserColumn() &&
-      naTable->getClusteringIndex()->isEntrySequenced())
-    {
-      *CmpCommon::diags() << DgSqlCode(-3410) 
-                          << 
DgTableName(naTable->getTableName().getQualifiedNameAsString());
-      bindWA->setErrStatus();
-      return this;
-    }
   
   Int32 beforeRefcount = naTable->getReferenceCount();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/optimizer/ImplRule.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ImplRule.cpp b/core/sql/optimizer/ImplRule.cpp
index 374f0be..dca6b8e 100644
--- a/core/sql/optimizer/ImplRule.cpp
+++ b/core/sql/optimizer/ImplRule.cpp
@@ -2569,8 +2569,6 @@ RelExpr * HiveInsertRule::nextSubstitute(RelExpr * before,
                    CIdesc);
 
       // insert is always a row-at-a-time operator
-      // This will for now disable inserts into partitioned, entry-sequenced
-      // tables.
       //CMPASSERT(skey->isUnique());
     }
 
@@ -2663,8 +2661,6 @@ RelExpr * HbaseInsertRule::nextSubstitute(RelExpr * 
before,
                    CIdesc);
 
       // insert is always a row-at-a-time operator
-      // This will for now disable inserts into partitioned, entry-sequenced
-      // tables.
       //CMPASSERT(skey->isUnique());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/optimizer/Inlining.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/Inlining.cpp b/core/sql/optimizer/Inlining.cpp
index 99f03cd..ceebc02 100644
--- a/core/sql/optimizer/Inlining.cpp
+++ b/core/sql/optimizer/Inlining.cpp
@@ -1325,25 +1325,6 @@ void GenericUpdate::fixTentativeRETDesc(BindWA *bindWA, 
CollHeap *heap)
         BiArith(ITM_PLUS, incrementExpr, new (heap)
          JulianTimestamp(new (heap) InternalTimestamp));
 
-      // If this is an entry sequenced table, than the SYSKEY is an INT 
-      // instead of a LARGEINT. So when we manufacture a "fake syskey"
-      // for INSERT operators, we must cast it to INT.
-      NAColumn *syskeyColumn = 
-       getTableDesc()->getNATable()->getNAColumnArray().getColumn("SYSKEY");
-      if ( (syskeyColumn != NULL) && 
-          (syskeyColumn->getType()->getNominalSize() == 4) )
-      {
-       // The logical way to convert a LARGEINT to an INT is by using
-       // Cast or Convert. However, they both cause the following 
-       // error during execution:
-       // *** ERROR[8411] A numeric overflow occurred during an 
-       //                 arithmetic computation or data conversion.
-       // So I am using Modulus. It's not the most efficient way
-       // to do it, but it works.
-       fakeSyskey = new (heap) 
-         Modulus(fakeSyskey, new (heap) ConstValue(INT_MAX));
-      }
-
       fakeSyskey->bindNode(bindWA);
 
       // Make NEW@.SYSKEY point to the timestamp expression.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/optimizer/NAFileSet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NAFileSet.cpp b/core/sql/optimizer/NAFileSet.cpp
index 3f2b699..72fb562 100644
--- a/core/sql/optimizer/NAFileSet.cpp
+++ b/core/sql/optimizer/NAFileSet.cpp
@@ -206,10 +206,6 @@ Int32 NAFileSet::getSysKeyPosition() const
 
 NABoolean NAFileSet::hasSyskey() const
 {
-  // entry-sequenced files always have a (32 bit) syskey
-  if (isEntrySequenced())
-    return TRUE;
-
   // check the NAColumn class of the key column
   // ++MV - 7/3/01 bug fix
 
@@ -233,10 +229,6 @@ NABoolean NAFileSet::hasSyskey() const
 
 NABoolean NAFileSet::hasOnlySyskey() const
 {
-  // entry-sequenced files always have a (32 bit) syskey
-  if (isEntrySequenced())
-    return TRUE;
-
   // Syskey is the only clustering key
   return ((indexKeyColumns_.entries() == 1) &&
           (indexKeyColumns_[0]->isSyskeyColumn()));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/optimizer/NAFileSet.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NAFileSet.h b/core/sql/optimizer/NAFileSet.h
index 92b1c3c..6143af1 100644
--- a/core/sql/optimizer/NAFileSet.h
+++ b/core/sql/optimizer/NAFileSet.h
@@ -60,7 +60,6 @@ class HbaseCreateOption;
 // -----------------------------------------------------------------------
 // An enumerated type that describes how data is organized in EVERY
 // file that belongs to this file set.
-// An entry sequenced file is analogous to a FIFO list of records.
 // A key sequenced file is implemented by a B+ tree.
 // A hash file contains records whose key columns compute to the 
 // same hash value when the hash function that is used for 
@@ -68,7 +67,6 @@ class HbaseCreateOption;
 // -----------------------------------------------------------------------
 enum FileOrganizationEnum 
 {
-  ENTRY_SEQUENCED_FILE,
   KEY_SEQUENCED_FILE,
   HASH_FILE
 };
@@ -203,8 +201,6 @@ public:
   // ---------------------------------------------------------------------
   NABoolean isKeySequenced() const  
                      { return (fileOrganization_ == KEY_SEQUENCED_FILE); }
-  NABoolean isEntrySequenced() const  
-                   { return (fileOrganization_ == ENTRY_SEQUENCED_FILE); }
   NABoolean isHashed() const      
                               { return (fileOrganization_ == HASH_FILE); }
   NABoolean isSyskeyLeading() const;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/15971f3d/core/sql/optimizer/RelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExpr.cpp b/core/sql/optimizer/RelExpr.cpp
index 7091c30..0bd7fdf 100644
--- a/core/sql/optimizer/RelExpr.cpp
+++ b/core/sql/optimizer/RelExpr.cpp
@@ -15603,13 +15603,10 @@ NABoolean Insert::isSideTreeInsertFeasible()
       return FALSE;
    }
 
-   NABoolean isEntrySequencedTable = getTableDesc()->getClusteringIndex()
-        ->getNAFileSet()->isEntrySequenced();
-
    if ( !getInliningInfo().hasPipelinedActions() ) 
      return TRUE;
 
-   if (isEntrySequencedTable || getInliningInfo().isEffectiveGU() ||
+   if (getInliningInfo().isEffectiveGU() ||
        getTolerateNonFatalError() == RelExpr::NOT_ATOMIC_)
       return FALSE;
 

Reply via email to