You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2017/09/07 01:54:58 UTC

[04/30] incubator-trafodion git commit: TRAFODION-2731 CodeCleanup: Remove obsolete, legacy and unused code

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenExpGenerator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenExpGenerator.cpp b/core/sql/generator/GenExpGenerator.cpp
index 31e6f11..c0c6108 100644
--- a/core/sql/generator/GenExpGenerator.cpp
+++ b/core/sql/generator/GenExpGenerator.cpp
@@ -165,7 +165,6 @@ ExpGenerator::ExpGenerator(Generator * generator_)
                    ex_expr::PCODE_LLO;
       break;
     }
-#ifdef NA_64BIT
   static Int32 pcodeEnvSet = 0;
   static Int32 pcodeEnv = 1;  // if non-zero, pcode is enabled as before.
   if (pcodeEnvSet == 0)
@@ -178,7 +177,6 @@ ExpGenerator::ExpGenerator(Generator * generator_)
     }
   if (pcodeEnv == 0)
     pCodeMode_ = ex_expr::PCODE_NONE;
-#endif
 
   addPCodeMode( ex_expr::PCODE_SPECIAL_FIELDS );
 
@@ -4832,9 +4830,7 @@ short ExpGenerator::endExprGen(ex_expr ** expr, short gen_last_clause)
          clause;
          clause = clause->getNextClause())
       {
-	if ((clause->getClassID() == ex_clause::FUNC_EXTRACT_COLUMNS) ||
-	    (clause->getClassID() == ex_clause::FUNC_AUDIT_ROW_IMAGE) ||
-	    (clause->getClassID() == ex_clause::FUNC_HBASE_COLUMN_CREATE) ||
+        if ((clause->getClassID() == ex_clause::FUNC_HBASE_COLUMN_CREATE) ||
 	    (clause->getClassID() == ex_clause::FUNC_HBASE_COLUMNS_DISPLAY))
 	  tooHard = TRUE;
         break;
@@ -5332,150 +5328,6 @@ short ExpGenerator::generateSamplingExpr(const ValueId &valId, ex_expr **expr,
   return 0;
 }
 
-short ExpGenerator::generateIarExtractionExpr (
-                                          Int32 workAtp,
-                                          Int32 workAtpIndex,
-                                          const ValueIdList &extractedColIdList,
-                                          Int32 extractedRowLen,
-                                          const ValueId &auditImageId,
-                                          const ValueId &mfMapId,
-                                          ExpTupleDesc *extractedRowDesc,
-                                          ExpTupleDesc *auditImageDesc,
-                                          ULng32 *extractColList,
-                                          UInt32 compressedAuditFlag,
-                                          ULng32 encodedKeyLength,
-                                          ex_expr ** expr )
-{
-   ExFunctionExtractColumns *extractClause = 0;
-
-   // 3 operands.
-   // input: the audit row image and possibly the mfMap, in the
-   //        upEntry/downEntry atp, atp 0.
-   // output: the extracted tuple, in the upEntry atp, atp 0.
-   short numOperands;
-   short totalNumOperands;
-   Attributes **attr;
-
-   // Compute how many input operands this expression will work with. If
-   // a null constant is passed in for the modified field map (this is allowed
-   // by the parser), then there is no need to process it or pass it in as an
-   // operand. A flag is set in the expression indicating that a null constant
-   // was used. Note that only a null constant can be passed in - any other
-   // constant value should be caught by the parser, but if not, will cause
-   // an assertion here.
-   if (mfMapId.getItemExpr()->getOperatorType() == ITM_CONSTANT)
-   {
-      ConstValue * constant = (ConstValue *)(mfMapId.getItemExpr());
-      GenAssert((constant->isNull()), "Cannot have a non-null constant value for the modified field map parameter to INTERPRET_AS_ROW");
-
-      numOperands = 2;
-   }
-   else
-      numOperands = 3;
-
-   totalNumOperands = numOperands;
-
-   // Initialize clause list, constants list etc. and allocate a map table.
-   // By not calling initExprGen() we avoid using tempSapce. 
-   // We don't want to use tempSpace here because the datamembers of 
-   // EXE_IAR_ERROR_EXTRACTING_COLUMNS actully use fagment space.
-   // Such uses confuse the codeGenerator() during packing and unpacking
-   // that is used as part of the Leaner Expressiopn project.
-   // Hence we use fragment space for generating IAR expressions.
-   // initExprGen();
-   startExprGen(expr,ex_expr::exp_ARITH_EXPR);
-
-   // This is a showplan statement.
-   if (getShowplan())
-#pragma nowarn(1506)
-     totalNumOperands = totalNumOperands * 2;
-#pragma warn(1506)
-
-   attr = new(generator->wHeap()) Attributes * [totalNumOperands];
-
-   // attr[0] gives the extracted row, i.e., the extracted columns. Allocate
-   // an Attribute object with the atp set to the workAtp and the atpIndex
-   // set to workAtpIndex. Initialize all the other relevant attributes.
-   attr[0] = (Attributes *) new(generator->wHeap())
-                               SimpleType(extractedRowLen, 1, 0);
-   attr[0]->setDatatype(REC_BYTE_F_ASCII);
-   attr[0]->setTupleFormat(ExpTupleDesc::SQLARK_EXPLODED_FORMAT);
-   attr[0]->setOffset(0);
-   attr[0]->setNullIndicatorLength(0);
-   attr[0]->setNullFlag(0);
-   attr[0]->setVCIndicatorLength(0);
-#pragma nowarn(1506)
-   attr[0]->setAtpIndex(workAtpIndex);
-   attr[0]->setAtp(workAtp);
-#pragma warn(1506)
-
-   // attr[1] gives the input audit row image
-   attr[1] = generator->getMapInfo(auditImageId)->getAttr();
-
-   if (numOperands == 3)
-   {
-      // attr[2] gives the input modified field map
-      attr[2] = generator->getMapInfo(mfMapId)->getAttr();
-   }
-
-   if (getShowplan())
-   {
-     attr[0]->setShowplan();
-     NAString extractedCols;
-     for (CollIndex i=0; i<extractedColIdList.entries(); i++)
-     {
-        extractedCols += extractedColIdList[i].getItemExpr()->getText();
-        if (i < extractedColIdList.entries() - 1)
-           extractedCols += ", ";
-     }
-
-#pragma nowarn(1506)
-     ValueId dummyValId(NULL_VALUE_ID);
-     attr[numOperands] = new(generator->wHeap())
-                  ShowplanAttributes
-                   (dummyValId,
-                    convertNAString(extractedCols,
-                                    generator->wHeap())
-                   );
-     attr[numOperands+1] = new(generator->wHeap())
-                  ShowplanAttributes
-                   (auditImageId,
-                    convertNAString(auditImageId.getItemExpr()->getText(),
-                                    generator->wHeap())
-                   );
-     if (numOperands == 3)
-     {
-        attr[numOperands+2] = new(generator->wHeap())
-                     ShowplanAttributes
-                       (mfMapId,
-                        convertNAString(mfMapId.getItemExpr()->getText(),
-                                        generator->wHeap())
-                       );
-     }
-#pragma warn(1506)
-
-   }
-
-   // Create the extraction clause, which has the information to do the
-   // actual work.
-   extractClause = new(getSpace()) ExFunctionExtractColumns(ITM_EXTRACT_COLUMNS,
-                                                            numOperands,
-                                                            attr,
-                                                            getSpace(),
-                                                            compressedAuditFlag,
-                                                            extractColList,
-                                                            encodedKeyLength,
-                                                            auditImageDesc,
-                                                            extractedRowDesc);
-
-   // Add extract clause to the clause_list. This is attached to the expression
-   // by the method endExprGen().
-   linkClause(0, extractClause);
-
-   endExprGen (expr, -1);
-   return 0;
-}
-
 MapInfo *ExpGenerator::addTemporary(ValueId val, MapTable *mapTable)
 {
   // Add the value ID to the last map table.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenExpGenerator.h
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenExpGenerator.h b/core/sql/generator/GenExpGenerator.h
index 6ec022e..2e7a051 100644
--- a/core/sql/generator/GenExpGenerator.h
+++ b/core/sql/generator/GenExpGenerator.h
@@ -615,21 +615,6 @@ public:
                            ConstNAStringPtr *colNamesForExpr,
                            ConstQualifiedNamePtr *tblNamesForExpr);
 
-  // generate code to extract columns from an audit row image, as required
-  // by the INTERPRET_AS_ROW function.
-  short generateIarExtractionExpr(Int32 workAtp,
-                                  Int32 workAtpIndex,
-                                  const ValueIdList &extractedColIdList,
-                                  Int32 extractedRowLen,
-                                  const ValueId &auditImageId,
-                                  const ValueId &mfMapId,
-                                  ExpTupleDesc *extractedRowDesc,
-                                  ExpTupleDesc *auditImageDesc,
-                                  ULng32 *extractColList,
-                                  UInt32 compressedAuditFlag,
-                                  ULng32 encodedKeyLength,
-                                  ex_expr ** expr );
-
   //////////////////////////////////////////////////////////////////////
   // Input is a ValueIdList to be copied into a contiguous buffer.
   // Adds convert nodes before moving, if addConvNodes is true.
@@ -1053,7 +1038,7 @@ public:
       flags_ &= ~SAVE_CLAUSES_IN_EXPR;
   };
 
-  NA_EIDPROC NABoolean saveClausesInExpr() {
+  NABoolean saveClausesInExpr() {
     return ((flags_ & SAVE_CLAUSES_IN_EXPR) != 0);
   };
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenExplain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenExplain.cpp b/core/sql/generator/GenExplain.cpp
index 738d95e..1997674 100644
--- a/core/sql/generator/GenExplain.cpp
+++ b/core/sql/generator/GenExplain.cpp
@@ -1395,8 +1395,6 @@ RelRoot::addSpecificExplainInfo(ExplainTupleMaster *explainTuple,
   // on different systems.
   if ((child(0) && child(0)->castToRelExpr()->getOperatorType() == REL_DDL) &&
       (sqlmxRegress))
-      //      (val = ActiveControlDB()->getControlSessionValue("EXPLAIN")) &&
-      //      (*val == "ON"))
     {  
       explainTuple->setDescription(statement);
 
@@ -1406,10 +1404,6 @@ RelRoot::addSpecificExplainInfo(ExplainTupleMaster *explainTuple,
 
   char buf[20];
 
-  statement += "statement_index: ";
-  sprintf(buf,"%d ", CmpCommon::statement()->getStmtIndex());
-  statement += buf;
-
   // For Adaptive Segmentation
   //
   statement += "affinity_value: ";

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenItemFunc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenItemFunc.cpp b/core/sql/generator/GenItemFunc.cpp
index bf0b306..8b40c9a 100644
--- a/core/sql/generator/GenItemFunc.cpp
+++ b/core/sql/generator/GenItemFunc.cpp
@@ -2469,225 +2469,6 @@ newExpr->codeGen(generator);
 return 0;
 }
 
-
-short AuditImage::codeGen(Generator * generator)
-{
-  // Used to save the original Expression Generator.
-  ExpGenerator *saveExpGen = NULL;
-  
-  try
-    {
-      Attributes ** attr;
-      Int32 numAttrs = 1 /* result */ + getArity();
-      
-      if (generator->getExpGenerator()->genItemExpr
-	  (this,      // (IN) : the tree for which code is to be generated
-	   &attr,     // (OUT): the generated attributes array is returned here
-	   numAttrs,  // 1 (result) + number of children
-	   -1         // if -1, generate code for children.
-	   )
-	  == 1)
-	return 0;
-      
-      // Note that we always generate a Cast operator here, even
-      // if it's not necessary. Because columnValuesVidList may be a
-      // VEGReference and it may not be possible to determine its
-      // exact type at this time. This Cast operator serves dual purpose -
-      // in addition to casting the result of VEGReference resolution 
-      // to the original datatype, it moves the result value to the target 
-      // location. We would have opted to add a conv node (parameter 2) in 
-      // our call to generateContiguousMoveExpr() to do the move if we 
-      // hadn't introduced the Cast operator here.
-      
-      ValueIdList typedColumnValueVidList;
-      Lng32 numChildren = getNumChildren();
-      for (Lng32 i = 0; i < numChildren; i++)
-	{  
-	  // cast the key column to the exact type of the original key column
-	  const NAType &oType = *columnTypeList_[i];
-	  ItemExpr *resultCastExpr = NULL;
-	  
-	  ItemExpr * ie = children()[i].getPtr();
-	  
-	  resultCastExpr = new(generator->wHeap()) Cast(ie,&oType);
-	  resultCastExpr->synthTypeAndValueId();
-	  resultCastExpr = resultCastExpr->preCodeGen(generator);
-	  
-	  // We assemble all the inputs to AI in a temporary tuple.
-	  // We don't need to explicitly set the (atp, atpIndx) as, we
-	  // get this as part of the codeGen of new cast expression.
-	  // The value is added to the temporary ATP (atp,atpindex) - (0,1).
-	  resultCastExpr->codeGen(generator);
-	  
-	  // Set these these cast nodes as the children.
-	  children().insertAt(i, resultCastExpr->getValueId());
-	  
-	  // Populate the typedColumnValueVidList. This list is
-	  // passed to generateContiguousMoveExpr.
-	  typedColumnValueVidList.insert(children()[i].getValueId());
-	}
-      
-      // These cast nodes will copy the inputs to the temp tuple.
-      // At runtime the temp tuple will be made available in (atp,atpindx) -(0,3)
-      // So, modify the map table for the cast nodes to say (0,3) 
-      // for the atp and atp index.
-      CollIndex idx=0;
-      for (idx=0; idx<typedColumnValueVidList.entries(); idx++)
-	{
-	  Attributes * mapAttr =
-                 generator->getMapInfo(typedColumnValueVidList[idx])->getAttr();
-
-	  mapAttr->setAtp(0);
-	  mapAttr->setAtpIndex(3);
-	}
-      
-      // We use a separate ExpGenerator to generate the ex_expr 
-      // that builds the audit row image. 
-      ExpGenerator tempExpGen(generator);
-      
-      // Save the original one. We need to set it back to this value after 
-      // generataContiguousMoveExpr.
-      saveExpGen = generator->getExpGenerator();
-
-      // Use the temp Exp Generator for generateContiguousMoveExpr
-      generator->setExpGenerator(&tempExpGen);
-      generator->getExpGenerator()->setInContainerExpr(TRUE);
-      
-      // allocate a work cri desc to generate audit image. It has
-      // 4 entries: 0, for consts. 1, for temps. 
-      // 2, for the audit row image.
-      // 3, where the input tuple in EXPLODED format will be available.
-      ex_cri_desc * auditRowImageCriDesc = new(generator->getSpace()) 
-	                                   ex_cri_desc(4, generator->getSpace());
-      short auditRowImageAtpIndex   = 2; // where the audit row image will be built
-      ex_expr *auditRowImageExpr = NULL;
-      ULng32 rowLength    = 0;
-      ExpTupleDesc * auditRowImageTupleDesc = 0;
-      
-      // Note that we opt to add a convert node (second parameter) in this call.
-      // The above cast node will copy the inputs to AuditImage to the temporary
-      // tuple, the convert node created as part of this generateContiguousMoveExpr
-      // will copy the inputs from the temporary tuple to the result location.
-      
-      ExpTupleDesc::TupleDataFormat tupleFormat = 
-	generator->getTableDataFormat(getNATable());
-      
-      GenAssert((tupleFormat == ExpTupleDesc::SQLMX_FORMAT ||
-		 tupleFormat == ExpTupleDesc::SQLMX_ALIGNED_FORMAT )
-		,"AUDIT_IMAGE supported only for PACKED and ALIGNED format"); 
-
-       // Tell the expression generator to gen a header clause.
-      tempExpGen.setForInsertUpdate( TRUE );
-
-      tempExpGen.generateContiguousMoveExpr
-	(
-	 typedColumnValueVidList,            // [IN] source ValueIds
-	 TRUE,                               // [IN] add convert nodes?
-	 0,                                  // [IN] target atp number
-	 auditRowImageAtpIndex,              // [IN] target tupp index
-         tupleFormat,                        // [IN]
-	 rowLength,                          // [OUT] target tuple length
-	 &auditRowImageExpr,                 // [OUT] move expression
-	 &auditRowImageTupleDesc,            // [optional OUT] target tuple desc
-	 ExpTupleDesc::LONG_FORMAT           // [optional IN] target desc format
-	 );
-      
-       // Need this to obtain the length of the row with no varChar columns.
-      auditRowImageCriDesc->setTupleDescriptor(auditRowImageAtpIndex /* 2 */,
-                                               auditRowImageTupleDesc);
-      
-      // Create a ExpDp2Expr and pass it to ExAuditImage clause.
-      ExpDP2Expr * auditImageContainerExpr = 
-	new(generator->getSpace()) ExpDP2Expr(auditRowImageExpr,
-					      auditRowImageCriDesc,
-					      generator->getSpace());
-      
-      generator->getExpGenerator()->setInContainerExpr(FALSE);
-      // Reset it back to the original.
-      generator->setExpGenerator(saveExpGen);
-      
-      // Reset the map table entries for the input values to temp (atp, atpIndx)
-      // - (0,1). This is the same as creating a map table with this information
-      // without the overhead of creating a map table.
-      
-      for (idx=0; idx < typedColumnValueVidList.entries(); idx++)
-	{
-	  Attributes * mapAttr = generator->getMapInfo(typedColumnValueVidList[idx])->getAttr();
-	  mapAttr->setAtp(0);
-	  mapAttr->setAtpIndex(1);
-	}
-      
-      // Use the Expression Generator object from the Generator work area for
-      // generating ExAuditImage.
-      ExpGenerator * expGen = generator->getExpGenerator();
-      
-      // set the numAttrs to 2. Note that it was (1 /* result */ + getArity())
-      // up till now. Beyond this the  ExAuditImage clause will have two operands.
-      // operand(0) - (attr[0]) represents the result.
-      // operand(1) - points to the beginning of temp tuple
-      // carrying the inputs.
-      
-      Int32 numAttrsSave = numAttrs;
-      numAttrs = 2;
-      
-      Int32 numAttrsShowPlan =
-        (generator->getExpGenerator()->getShowplan() ? numAttrs : 0);
-      Attributes ** auditImageAttrs =
-        new(generator->wHeap()) Attributes * [numAttrs + numAttrsShowPlan];
-      
-      // Copy the result attributes of AuditImage to auditImageAttrs[0]
-      auditImageAttrs[0] = attr[0]->newCopy(generator->wHeap());
-      if (numAttrsShowPlan)
-	{
-	  // copy the showplan attributes for AuditImage result (attr[0]) as well
-	  auditImageAttrs[numAttrs] =  
-	    attr[numAttrsSave]->newCopy(generator->wHeap());
-	}
-      
-      // Since this attr represents the temps area, get its length.
-      auditImageAttrs[1] = (Attributes *) new(generator->wHeap()) 
-	SimpleType((Lng32)expGen->getTempsLength(), 
-		   1 /* scale */, 
-		   0 /* precision */);
-      // ex_clause constructor requires the format to be set.
-      auditImageAttrs[1]->setDatatype(REC_BYTE_F_ASCII);
-      auditImageAttrs[1]->setTupleFormat(ExpTupleDesc::SQLARK_EXPLODED_FORMAT);
-      auditImageAttrs[1]->setAtp(0);
-      auditImageAttrs[1]->setAtpIndex(1);
-      auditImageAttrs[1]->setOffset(0);
-
-      if (numAttrsShowPlan)
-	{
-	  // copy the showplan attributes for ExAuditImage's input tuple as well
-	  // Create ShowplanAttributes corresponding to auditImageAttrs[1].
-	  auditImageAttrs[numAttrs + 1] = new (generator->wHeap())
-	    ShowplanAttributes(0, /* NULL_VALUE_ID */
-			       convertNAString("TemporaryTupleWithAuditImageInputValues",
-					       generator->wHeap()));
-	}
-      
-      ex_clause * function_clause =
-	new(generator->getSpace()) ExAuditImage(auditImageAttrs, 
-						generator->getSpace(), 
-						auditImageContainerExpr
-						);
-      
-      if (function_clause)
-	expGen->linkClause(this, function_clause);
-      
-      return 0;
-    } //try
-  
-  catch (...)
-    {
-      // Reset it back to the original.
-      if(saveExpGen != NULL)
-	generator->setExpGenerator(saveExpGen);
-      
-      throw;
-    } // catch (...)
-}
-
 short HbaseColumnLookup::codeGen(Generator * generator)
 {
   Attributes ** attr;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenPreCode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenPreCode.cpp b/core/sql/generator/GenPreCode.cpp
index 0505432..1789cc0 100644
--- a/core/sql/generator/GenPreCode.cpp
+++ b/core/sql/generator/GenPreCode.cpp
@@ -44,7 +44,6 @@
 #include "GroupAttr.h"
 #include "AllRelExpr.h"
 #include "RelPackedRows.h"
-#include "ReadTableDef.h"
 #include "Generator.h"
 #include "GenExpGenerator.h"
 #include "dfs2rec.h"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenRelDCL.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelDCL.cpp b/core/sql/generator/GenRelDCL.cpp
index ea0c8e1..10b1a4d 100644
--- a/core/sql/generator/GenRelDCL.cpp
+++ b/core/sql/generator/GenRelDCL.cpp
@@ -293,12 +293,7 @@ short RelSetTimeout::codeGen(Generator * generator)
     char * varName;
     GenAssert(hv->getName().data(), "Hostvar pointer must have name");
 
-#pragma nowarn(1506)   // warning elimination 
     lateNameInfo->setEnvVar(hv->isEnvVar());
-#pragma warn(1506)  // warning elimination 
-#pragma nowarn(1506)   // warning elimination 
-    lateNameInfo->setDefine(hv->isDefine());
-#pragma warn(1506)  // warning elimination 
 
     varName = convertNAString(hv->getName(), generator->wHeap());
     strcpy(lateNameInfo->variableName(), varName);
@@ -309,7 +304,6 @@ short RelSetTimeout::codeGen(Generator * generator)
     lateNameInfo->setLastUsedName(prototypeValue, space);
     strcpy(lateNameInfo->resolvedPhyName(), prototypeValue);
     lateNameInfo->setVariable(1);
-    lateNameInfo->setAvoidSimCheck(TRUE); 
   } // end of host-var
   else if ( isForAllTables_ ) { // a "*" was specified for a table name
     strcpy( lateNameInfo->resolvedPhyName(), "*" );  // special mark

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/GenRelMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelMisc.cpp b/core/sql/generator/GenRelMisc.cpp
index c7ad623..33f90cb 100644
--- a/core/sql/generator/GenRelMisc.cpp
+++ b/core/sql/generator/GenRelMisc.cpp
@@ -40,7 +40,6 @@
 #include "ComOptIncludes.h"
 #include "GroupAttr.h"
 #include "ItemColRef.h"
-#include "ReadTableDef.h"
 #include "RelEnforcer.h"
 #include "RelJoin.h"
 #include "RelExeUtil.h"
@@ -1664,17 +1663,9 @@ short RelRoot::codeGen(Generator * generator)
 	      char * varName;
 	      GenAssert(hv->getName().data(), "Hostvar pointer must have name");
 
-#pragma nowarn(1506)   // warning elimination
 	      lateNameInfo->setEnvVar(hv->isEnvVar());
-#pragma warn(1506)  // warning elimination
 
-#pragma nowarn(1506)   // warning elimination
-	      lateNameInfo->setDefine(hv->isDefine());
-#pragma warn(1506)  // warning elimination
-
-#pragma nowarn(1506)   // warning elimination
 	      lateNameInfo->setCachedParam(hv->isCachedParam());
-#pragma warn(1506)  // warning elimination
 
 	      varName = convertNAString(hv->getName(), generator->wHeap());
 	      strcpy(lateNameInfo->variableName(), varName);
@@ -1795,7 +1786,6 @@ short RelRoot::codeGen(Generator * generator)
   for (j = 0; j < numEntries; j++)
     lnil->setLateNameInfo(j,((LateNameInfo *)(lnil + 1)) + j);
 
-  NABoolean definePresent = FALSE;
   NABoolean viewPresent = FALSE;
   NABoolean variablePresent = FALSE;
 
@@ -1813,14 +1803,12 @@ short RelRoot::codeGen(Generator * generator)
 	  if (src->isVariable())
 	    {
               doTablenameOltOpt = FALSE;
-	      if (src->isDefine())
-		definePresent = TRUE;
 	    }
 
 	  // *tgt = *src wouldn't work since it doesn't copy over the vtblptr.
 	  memmove(tgt,src,sizeof(LateNameInfo));
 	  // find the position of this hostvar in input var list.
-	  if ((src->isVariable()) && (! src->isEnvVar()) && (! src->isDefine()))
+	  if ((src->isVariable()) && (! src->isEnvVar()))
 	    {
 	      if (tgt->isCachedParam())
 		{
@@ -1854,18 +1842,11 @@ short RelRoot::codeGen(Generator * generator)
         {
 	  if (NOT tgt->isVariable())
 	    {
-	      if (NOT tgt->isMPalias())
-		tgt->setAnsiPhySame(TRUE);
-	      else
-		tgt->setAnsiPhySame(FALSE);
+              tgt->setAnsiPhySame(TRUE);
 	    }
 	  else
 	    {
-	      if (tgt->isMPalias())
-		tgt->setAnsiPhySame(FALSE);
-	      else if (tgt->isDefine())
-		tgt->setAnsiPhySame(TRUE);
-	      else if (tgt->isEnvVar())
+	      if (tgt->isEnvVar())
 		tgt->setAnsiPhySame(TRUE);
 	      else
 		{
@@ -1888,9 +1869,6 @@ short RelRoot::codeGen(Generator * generator)
 	      char * compileTimeAnsiName = space->AllocateAndCopyToAlignedSpace(
 		   qn.getQualifiedNameAsAnsiString(), 0);
               tgt->setCompileTimeName(compileTimeAnsiName, space);
-	      
-	      if (tgt->isView())
-		tgt->setMPalias(1);
 	    }
 	} // else
       
@@ -1918,10 +1896,6 @@ short RelRoot::codeGen(Generator * generator)
     }
 
 #pragma nowarn(1506)   // warning elimination
-  lnil->setDefinePresent(definePresent);
-#pragma warn(1506)  // warning elimination
-
-#pragma nowarn(1506)   // warning elimination
   lnil->setViewPresent(viewPresent);
 #pragma warn(1506)  // warning elimination
 
@@ -2733,7 +2707,6 @@ short RelRoot::codeGen(Generator * generator)
       if ((NOT root_tdb->getUpdAbortOnError()) &&
 	  (NOT root_tdb->getUpdSavepointOnError()) &&
 	  (NOT root_tdb->getUpdPartialOnError()) &&
-	  (NOT definePresent) &&
 	  (retryableStmt) &&
 	  (NOT root_tdb->thereIsACompoundStatement()))
 	{
@@ -5348,8 +5321,6 @@ TrafDesc *ProxyFunc::createVirtualTableDesc()
     table_desc->tableDesc()->colcount;
   index_desc->indexesDesc()->blocksize = 4096; // doesn't matter.
 
-  // cannot simply point to same files desc as the table one,
-  // because then ReadTableDef::deleteTree frees same memory twice (error)
   TrafDesc *i_files_desc = TrafAllocateDDLdesc(DESC_FILES_TYPE, NULL);
   i_files_desc->filesDesc()->setAudited(TRUE); // audited table
   index_desc->indexesDesc()->files_desc = i_files_desc;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/generator/Generator.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/Generator.cpp b/core/sql/generator/Generator.cpp
index 9bd81a9..8e72b60 100644
--- a/core/sql/generator/Generator.cpp
+++ b/core/sql/generator/Generator.cpp
@@ -415,8 +415,6 @@ RelExpr * Generator::preGenCode(RelExpr * expr_node)
       	collectStatsType_ = ComTdb::ALL_STATS;
       else if (tmp == "ACCUMULATED")
 	collectStatsType_ = ComTdb::ACCUMULATED_STATS;
-      else if (tmp == "MEASURE")
-	collectStatsType_ = ComTdb::MEASURE_STATS;
       else if (tmp == "PERTABLE")
 	collectStatsType_ = ComTdb::PERTABLE_STATS;
       else if (tmp == "OPERATOR")
@@ -1837,7 +1835,7 @@ TrafDesc * Generator::createRefConstrDescStructs(
  
 }
 
-static Lng32 createDescStructs(char * rforkName,
+static Lng32 createDescStructs(char * tableName,
                                Int32 numCols,
                                ComTdbVirtTableColumnInfo * columnInfo,
                                Int32 numKeys,
@@ -1851,7 +1849,7 @@ static Lng32 createDescStructs(char * rforkName,
   UInt32 reclen = 0;
 
   // create column descs
-  colDescs = Generator::createColDescs(rforkName, columnInfo, (Int16) numCols,
+  colDescs = Generator::createColDescs(tableName, columnInfo, (Int16) numCols,
                                        reclen, space);
 
   keyDescs = Generator::createKeyDescs(numKeys, keyInfo, space);
@@ -2273,8 +2271,6 @@ TrafDesc * Generator::createVirtualTableDesc
   if (privInfo)
       priv_desc = createPrivDescs(privInfo, space);
 
-  // cannot simply point to same files desc as the table one,
-  // because then ReadTableDef::deleteTree frees same memory twice (error)
   TrafDesc * i_files_desc = TrafAllocateDDLdesc(DESC_FILES_TYPE, space);
   i_files_desc->filesDesc()->setAudited(TRUE); // audited table
   index_desc->indexesDesc()->files_desc = i_files_desc;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/langman/LmComQueue.h
----------------------------------------------------------------------
diff --git a/core/sql/langman/LmComQueue.h b/core/sql/langman/LmComQueue.h
index 6d6b514..6a40f5a 100644
--- a/core/sql/langman/LmComQueue.h
+++ b/core/sql/langman/LmComQueue.h
@@ -139,9 +139,6 @@ class Queue
   Q_EntryPtr   curr;                                             // 16-31
 
   CollHeap    *heap_;
-#ifndef NA_64BIT
-  char         fillersQueue1_[4];
-#endif                                                           // 32-39
 
   Int32        numEntries_;                                      // 40-43
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/langman/LmCommon.h
----------------------------------------------------------------------
diff --git a/core/sql/langman/LmCommon.h b/core/sql/langman/LmCommon.h
index 8686db7..b20eff7 100644
--- a/core/sql/langman/LmCommon.h
+++ b/core/sql/langman/LmCommon.h
@@ -36,23 +36,19 @@
 #include "ComSmallDefs.h"
 #include "ComDiags.h"
 
-  #ifdef __EID
-    #define SQLLM_LIB_FUNC
+#ifdef LMCOMP_BUILD
+  // This is for the lmcomp library which gets statically linked
+  // into tdm_arkcmp
+  #define SQLLM_LIB_FUNC
+#else
+  #ifdef LM_DLL
+    // This is for building the LM DLL
+    #define SQLLM_LIB_FUNC __declspec( dllexport )
   #else
-    #ifdef LMCOMP_BUILD
-      // This is for the lmcomp library which gets statically linked
-      // into tdm_arkcmp
-      #define SQLLM_LIB_FUNC
-    #else
-      #ifdef LM_DLL
-        // This is for building the LM DLL
-        #define SQLLM_LIB_FUNC __declspec( dllexport )
-      #else
-        // This is for LM DLL callers
-        #define SQLLM_LIB_FUNC __declspec( dllimport )
-      #endif
-    #endif
+    // This is for LM DLL callers
+    #define SQLLM_LIB_FUNC __declspec( dllimport )
   #endif
+#endif
 
 //////////////////////////////////////////////////////////////////////
 //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/langman/LmDebug.h
----------------------------------------------------------------------
diff --git a/core/sql/langman/LmDebug.h b/core/sql/langman/LmDebug.h
index c03ccf7..67a9f19 100644
--- a/core/sql/langman/LmDebug.h
+++ b/core/sql/langman/LmDebug.h
@@ -60,7 +60,7 @@ void lmDebug(const char *, ...);
 #define LM_DEBUG5(msg,a1,a2,a3,a4,a5)
 #endif
 
-#if defined(LM_DEBUG) && !defined(NA_WINNT)
+#if defined(LM_DEBUG)
 void debugLmSignalHandlers();
 #define LM_DEBUG_SIGNAL_HANDLERS(msg) \
 lmDebug(msg); \

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/nskgmake/arkcmplib/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/arkcmplib/Makefile b/core/sql/nskgmake/arkcmplib/Makefile
index 0a20fd2..0037d7a 100755
--- a/core/sql/nskgmake/arkcmplib/Makefile
+++ b/core/sql/nskgmake/arkcmplib/Makefile
@@ -36,8 +36,6 @@ CPPSRC := cmpargs.cpp \
 	ProcessEnv.cpp \
 	QueryCacheSt.cpp \
 	NATableSt.cpp \
-	rtdu.cpp \
-	rtdu2.cpp \
 	vers_libarkcmp.cpp
 
 INCLUDE_DIRS := sqludr

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/nskgmake/tdm_sqlcli/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/tdm_sqlcli/Makefile b/core/sql/nskgmake/tdm_sqlcli/Makefile
index f7ff985..251f995 100755
--- a/core/sql/nskgmake/tdm_sqlcli/Makefile
+++ b/core/sql/nskgmake/tdm_sqlcli/Makefile
@@ -23,7 +23,6 @@
 
 CPPSRC := CliDll.cpp \
 	StoredProcInterface.cpp \
-	rtdu.cpp \
 	vers_libcli.cpp
 
 SRCPATH := cli catman smdio

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index eb54ddb9..de5cc78 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -1231,7 +1231,6 @@ Int32 ItemExpr::shouldPushTranslateDown(CharInfo::CharSet chrset) const
      case ITM_MOVING_MIN:            // b) possibly different orderings
      case ITM_SCALAR_MIN:            // b) ordering, also may eliminate data
      case ITM_SCALAR_MAX:            // b) ordering, also may eliminate data
-     case ITM_AUDIT_IMAGE:           // a), b) output is binary disguised as ISO
      case ITM_OLAP_MAX:              // b) ordering, also may eliminate data
      case ITM_OLAP_MIN:              // b) ordering, also may eliminate data
      case ITM_CONVERTTOHEX:          // b) operator depends on encoding
@@ -12597,42 +12596,6 @@ ItemExpr *ItmSequenceFunction::bindNode(BindWA *bindWA)
     return getValueId().getItemExpr();
 }
 
-//-------------------------------------------------------------------------
-//
-// member functions for class AuditImage
-//
-//-------------------------------------------------------------------------
-ItemExpr *AuditImage::bindNode(BindWA *bindWA)
-{
-  if (nodeIsBound())
-    return getValueId().getItemExpr();
-
-  ItemExpr * boundExpr = NULL;
-     
-  // Obtain the NATable for the objectName.
-  NATable *table = bindWA->getNATable(getObjectName());
-  if (bindWA->errStatus()) return NULL; 
-
-  setNATable(table);
-
-  // The number of columns in the object must match the number of columns
-  // in the expression list for AUDIT_IMAGE. The columns in the expression
-  // list form the children of AUDIT_IMAGE node.
-  if (table->getColumnCount() != (ULng32) getArity())
-    {
-      *CmpCommon::diags() << DgSqlCode(-4315)
-			  << DgTableName(getObjectName().getQualifiedNameAsString());
-      bindWA->setErrStatus();
-      return NULL;
-    }
- 
-  // Binds self; Binds children; AuditImage::synthesize();
-  boundExpr = Function::bindNode(bindWA);
-  if (bindWA->errStatus()) return NULL;
- 
-  return boundExpr;
-}
-
 //---------------------------------------------------------------------------
 //
 // member functions for class HbaseColumnLookup

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index 2e46dcf..266e23f 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -7751,8 +7751,7 @@ OptSqlTableOpenInfo *setupStoi(OptSqlTableOpenInfo *&optStoi_,
   // notion to begin with.
   if ((naTable->getSpecialType() == ExtendedQualName::TRIGTEMP_TABLE) ||
       (naTable->getSpecialType() == ExtendedQualName::IUD_LOG_TABLE) ||
-      (naTable->getSpecialType() == ExtendedQualName::INDEX_TABLE) ||
-      (naTable->getSpecialType() == ExtendedQualName::RESOURCE_FORK))
+      (naTable->getSpecialType() == ExtendedQualName::INDEX_TABLE))
   {
     return NULL;
   }
@@ -14540,20 +14539,6 @@ RelExpr *Describe::bindNode(BindWA *bindWA)
       NAString cat(catsch.getCatalogNameAsAnsiString(),bindWA->wHeap());
       NAString sch(catsch.getUnqualifiedSchemaNameAsAnsiString(),bindWA->wHeap());
       //
-      if (SqlParser_NAMETYPE == DF_NSK) {
-// LCOV_EXCL_START - nsk
-        // The cat & sch from the BindWA are really from MPLOC.
-        // Get the real ANSI cat & sch, prepending them to the strings
-        // and put the MPLOC info in parens.
-        const SchemaName &csAnsi = ActiveSchemaDB()->getDefaultSchema();
-        NAString cAnsi(csAnsi.getCatalogNameAsAnsiString(),bindWA->wHeap());
-        NAString sAnsi(csAnsi.getUnqualifiedSchemaNameAsAnsiString(),bindWA->wHeap());
-        cat.prepend(cAnsi + " (");
-        cat += ")";
-        sch.prepend(sAnsi + " (");
-        sch += ")";
-// LCOV_EXCL_STOP
-      }
       *CmpCommon::diags() << DgSqlCode(-ABS(ShowSchema::DiagSqlCode()))
         << DgCatalogName(cat) << DgSchemaName (sch);
       bindWA->setErrStatus();
@@ -14629,8 +14614,6 @@ RelExpr *Describe::bindNode(BindWA *bindWA)
   index_desc->indexesDesc()->colcount = table_desc->tableDesc()->colcount;
   index_desc->indexesDesc()->blocksize = 4096; // anything > 0
 
-  // Cannot simply point to same files desc as the table one,
-  // because then ReadTableDef::deleteTree frees same memory twice (error)
   TrafDesc * i_files_desc = TrafAllocateDDLdesc(DESC_FILES_TYPE, NULL);
   index_desc->indexesDesc()->files_desc = i_files_desc;
 
@@ -14679,28 +14662,6 @@ RelExpr *Describe::bindNode(BindWA *bindWA)
           // do not override schema for showddl
           bindWA->setToOverrideSchema(FALSE);  
           
-          // if this is a showlabel command on a resource fork, 
-          // but the describedTableName
-          // is not a fully qualified rfork name, then get the rfork name
-          // for the specified table.
-          if ((getFormat() == Describe::LABEL_) &&
-              (describedTableName_.getSpecialType() == ExtendedQualName::RESOURCE_FORK) &&
-              (describedTableName_.getLocationName().isNull()))
-            {
-              describedTableName_.setSpecialType(ExtendedQualName::NORMAL_TABLE);
-              NATable *naTable = bindWA->getNATable(describedTableName_);
-              if (NOT bindWA->errStatus())
-                {
-                  // replace the describedTableName with its rfork name.
-                  describedTableName_.setSpecialType(ExtendedQualName::RESOURCE_FORK);
-                
-                  NAString rforkName = naTable->getClusteringIndex()->getFileSetName().getQualifiedNameAsString();
-                  char * rforkNameData = (char*)(rforkName.data());
-                  rforkNameData[rforkName.length()-1] += 1;
-                  describedTableName_.setLocationName(rforkName);
-                }
-            }
-
           // check if we need to consider public schema before 
           // describedTableName_ is qualified by getNATable
           if (describedTableName_.getQualifiedNameObj().getSchemaName().isNull())

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ColStatDesc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ColStatDesc.cpp b/core/sql/optimizer/ColStatDesc.cpp
index 9e2ce36..cb95703 100644
--- a/core/sql/optimizer/ColStatDesc.cpp
+++ b/core/sql/optimizer/ColStatDesc.cpp
@@ -9500,12 +9500,7 @@ MultiColumnUecList::findDenom (const ValueIdSet & columns) const
 // all tablePtrs should be 4-byte aligned, so divide by 4
 // to get a better hash value
 ULng32 TableDescHashFn (const TableDesc & tablePtr)
-#ifdef NA_64BIT
 { return (ULng32)((Long)&tablePtr/8) ; }
-#else
-{ return (ULng32)&tablePtr/4 ; }
-#endif
-
 
 #pragma nowarn(262)   // warning elimination
 NABoolean

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ControlDB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ControlDB.cpp b/core/sql/optimizer/ControlDB.cpp
index ceab262..f8e2f1b 100644
--- a/core/sql/optimizer/ControlDB.cpp
+++ b/core/sql/optimizer/ControlDB.cpp
@@ -452,12 +452,7 @@ void ControlDB::setControlDefault(ControlQueryDefault *def)
       }
     }
     break;
-  case QUERY_CACHE_MPALIAS:
-    // turning off mpalias query caching decaches any mpalias queries
-    if (CmpCommon::getDefault(QUERY_CACHE_MPALIAS) == DF_OFF) {
-      CURRENTQCACHE->deCacheAliases();
-    }
-    break;
+
   case QUERY_CACHE_STATISTICS: // is now a no-op
     break;
   case QUERY_CACHE_AVERAGE_PLAN_SIZE:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/EncodedKeyValue.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/EncodedKeyValue.cpp b/core/sql/optimizer/EncodedKeyValue.cpp
index 1c697c2..ce63728 100644
--- a/core/sql/optimizer/EncodedKeyValue.cpp
+++ b/core/sql/optimizer/EncodedKeyValue.cpp
@@ -26,7 +26,7 @@
 * File:         EncodedKeyValue.cpp
 * Description:  Functions to compute binary encoded keys that can be written 
                 to disk for a given set of TrafDescs.
-* Origin:       Copy of existing code from GenRFork.cpp
+* Origin:       
 * Created:      10/30/2013
 * Language:     C++
 *

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ItemConstr.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemConstr.h b/core/sql/optimizer/ItemConstr.h
index 6c94c64..25ee914 100644
--- a/core/sql/optimizer/ItemConstr.h
+++ b/core/sql/optimizer/ItemConstr.h
@@ -597,7 +597,7 @@ private:
 //
 // The whole scheme with the ComplementaryRIConstraint's array of columns
 // "parallel" to the defining constraint's columns assumes that constraint info
-// is is stored in CatMan (or at least by the ReadTableDef/NATable) in the
+// is stored in CatMan (or at least by NATable) in the
 // manner described for this example:
 //   CREATE TABLE U ... CONSTRAINT U0 UNIQUE(V,W,X)    [ or PRIMARY KEY(V,W,X) ]
 //   CREATE TABLE F ... CONSTRAINT R1 FOREIGN KEY(G,H,I) REFERENCES U(X,W,V)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index 6ed6ad2..565f6bf 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -14810,123 +14810,11 @@ NABoolean ItemExpr::isARangePredicate() const
 }
 
 
-
-// -----------------------------------------------------------------------
-// member functions for AuditImage
-// -----------------------------------------------------------------------
-AuditImage:: AuditImage(const CorrName &objectName,
-			ItemExpr    *columnValueList)
-                  : objectName_(objectName),
-		    naTable_(NULL),
-		    columnTypeList_(CmpCommon::statementHeap()),
-                    Function(ITM_AUDIT_IMAGE, FALSE /* not a leaf node */)
-{
-
-  // The parser generates a ItemList for the column value arguments.
-
-  // If there is only one item, then a ItemList is not generated.
-  // In that case, set that value as AuditImage's child.
-  if (columnValueList->getOperatorType() != ITM_ITEM_LIST)
-    {
-      children().insertAt(0, (columnValueList));
-    }
-  else
-    {
-
-      // Assert that the columnValueList is of type ItemList.
-      CMPASSERT(columnValueList->getOperatorType() == ITM_ITEM_LIST);
-
-      // Collect all the leaf nodes from the (ItemList) columnList
-      // into a list and set each leaf as a child of AuditImage.
-
-      ExprValueIdList *list = ((ItemList *)columnValueList)->collectLeaves(
-             CmpCommon::statementHeap());
-      const ULng32 num = list->entries();
-
-      for (ULng32 i = 0; i < num; i++)
-	{
-	  children().insertAt(i, (*(*list)[i]));
-	}
-    }
-}
-
-AuditImage::~AuditImage() {}
-
-Int32 AuditImage::getArity() const
-{
-  return Function::getNumChildren();
-}
-
-HashValue AuditImage::topHash()
-{
-  HashValue result = ItemExpr::topHash();
-
-  // hash any local data members of the derived class
-  result ^= objectName_.getQualifiedNameAsString();
-
-  return result;
-}
-
-NABoolean AuditImage::duplicateMatch(const ItemExpr & other) const
-{
-  if (NOT genericDuplicateMatch(other))
-    return FALSE;
-
-  AuditImage &o = (AuditImage &) other;
-
-  // compare any local data members of the derived class
-  // and return FALSE if they don't match
-  if (objectName_ != o.objectName_)
-    return FALSE;
-
-  if (!(columnTypeList_ == o.columnTypeList_))
-    return FALSE;
-
-  return TRUE;
-}
-
-ItemExpr * AuditImage::copyTopNode(ItemExpr *derivedNode,
-					CollHeap* outHeap)
-{
-  AuditImage *result=NULL;
-
-  CMPASSERT(derivedNode == NULL);
-
-  result = new (outHeap) AuditImage(objectName_);
-  result->naTable_ = naTable_;
-  result->columnTypeList_ = columnTypeList_;
-
-  return Function::copyTopNode(result, outHeap);
-}
-
 QR::ExprElement Function::getQRExprElem() const
 {
   return QR::QRFunctionElem;
 }
 
-void AuditImage::unparse(NAString &result,
-		       PhaseEnum phase,
-		       UnparseFormatEnum form,
-		       TableDesc * tabId) const
-{
-
-  result += getText();
-  result += "(INDEX_TABLE ";
-  result += getObjectName().getQualifiedNameAsString();
-
-  result += ", (";
-  for (Int32 i=0; i < getNumChildren(); i++)
-    {
-      if (i>0) // if not the first parameter.
-	result +=", ";
-      child(i)->unparse(result, phase, form, tabId);
-    }
-  result += ")";
-
-  result += ")";
-
-}
-
 // Flipping the tree in 1 pass top->bottom
 //
 //ITEM_LIST  (OLD TREE)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ItemFunc.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemFunc.h b/core/sql/optimizer/ItemFunc.h
index 2bb3c67..e4bdf07 100644
--- a/core/sql/optimizer/ItemFunc.h
+++ b/core/sql/optimizer/ItemFunc.h
@@ -2570,10 +2570,10 @@ public:
   void setSrcIsVarcharPtr(NABoolean v)
        { (v ? flags_ |= SRC_IS_VARCHAR_PTR : flags_ &= ~SRC_IS_VARCHAR_PTR); }
 
-  NA_EIDPROC NABoolean allowSignInInterval()
+  NABoolean allowSignInInterval()
     { return ((flags_ & ALLOW_SIGN_IN_INTERVAL) != 0); };
 
-  NA_EIDPROC void setAllowSignInInterval(NABoolean v)
+  void setAllowSignInInterval(NABoolean v)
     { (v) ? flags_ |= ALLOW_SIGN_IN_INTERVAL : flags_ &= ~ALLOW_SIGN_IN_INTERVAL; }
 
   NABoolean convertNullWhenError() 
@@ -5354,94 +5354,6 @@ public:
 
 } ;     // class ItmSeqNotTHISFunction
 
-
-
-//
-// This function creates an audit row image given the
-// name of the object (table or index - initially just index) and 
-// the list of expressions (column values) that make the row.
-//
-
-class AuditImage : public Function
-{
-public:
-  AuditImage(const CorrName &objectName,
-	     ItemExpr    *columnValueList);
- 
-  AuditImage(const CorrName &objectName)
-    : objectName_(objectName),
-      naTable_ (NULL),
-      columnTypeList_(CmpCommon::statementHeap()),
-      Function(ITM_AUDIT_IMAGE, CmpCommon::statementHeap(), 0){};
-
- 
-  // copy ctor
-  AuditImage (const AuditImage &, CollHeap * h=0) ; // not written
-
-  // virtual destructor
-  virtual ~AuditImage();
-
-  // get the degree of this node (it depends on the type of the operator)
-  virtual Int32 getArity() const;
-
-  // Does semantic checks and binds the function.
-  virtual ItemExpr * bindNode(BindWA * bindWA);
-
-  // a virtual function that does type synthesis.
-  //
-  virtual const NAType * synthesizeType();
-
-  // virtual method to do code generation
-  //
-  virtual short codeGen(Generator*);
-
-  // get a printable string that identifies the operator
-  //
-  virtual const NAString getText() const
-  {
-    return "AUDIT_IMAGE";
-  };
-
-  virtual HashValue topHash();
-  
-  virtual NABoolean duplicateMatch(const ItemExpr & other) const;
-  
-  virtual ItemExpr * copyTopNode(ItemExpr *derivedNode = NULL,
-				 CollHeap* outHeap = 0);
-
-  // produce an ascii-version of the object (for display or saving into a file)
-  virtual void unparse(NAString &result,
-		       PhaseEnum phase = DEFAULT_PHASE,
-		       UnparseFormatEnum form = EXPLAIN_FORMAT,
-		       TableDesc * tabId = NULL) const;
-
-
-  const CorrName & getObjectName() const  { return objectName_; }
-        CorrName & getObjectName()        { return objectName_; }
-
-  inline const NATable  *getNATable()           const { return naTable_; }
-  void setNATable (NATable *naTable) {naTable_ = naTable;}
-
-private:
-  // ---------------------------------------------------------------//
-  // the user-specified name of the table or an index or any other
-  // SQL/MX object.
-  // -------------------------------------------------------------- //
-  CorrName objectName_;
-  // ---------------------------------------------------------------------
-  // This stores the original column values. The original column values 
-  // can be replaced with an equivalent value as a result of 
-  // VEGReference resolution. If this happens, we refer to this list to 
-  // cast the replaced value to the data type in this original list.
-  // ---------------------------------------------------------------------
-  LIST(const NAType *) columnTypeList_;
-
-  // NATable for the object (INDEX) referenced by objectName_. 
-  // This is needed to do semantic checks
-  const NATable *naTable_;
-
-};
-
 // lookup a column in a native hbase table that is being accessed in row format
 class HbaseColumnLookup : public BuiltinFunction
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index e8ba671..dbcc323 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -36,10 +36,8 @@
 
 #undef  _DP2NT_
 #define _DP2NT_
-// #define NA_ARKFS
 #define __ROSETTA
 #undef _DP2NT_
-// #undef NA_ARKFS
 #undef __ROSETTA
 
 #include "NATable.h"
@@ -3375,7 +3373,7 @@ NABoolean createNAColumns(TrafDesc *column_desc_list	/*IN*/,
       NAColumn *newColumn = NULL;
       if (column_desc->colname[0] != '\0')
         {
-	  // Standard named column from ReadTableDef...
+	  // Standard named column
           CMPASSERT(column_desc->colnumber >= 0);
 
          char* defaultValue = column_desc->defaultvalue;
@@ -5035,7 +5033,7 @@ NABoolean NATable::fetchObjectUIDForNativeTable(const CorrName& corrName,
 
    MonitorMemoryUsage_Enter((char*)mmPhase.data(), heap_, TRUE);
 
-   // Do a readTableDef, if table descriptor has not been passed in
+   // Do a metadata read, if table descriptor has not been passed in
    //
    TrafDesc * table_desc;
    Int32 *maxIndexLevelsPtr = new (STMTHEAP) Int32;
@@ -5276,7 +5274,7 @@ NABoolean NATable::fetchObjectUIDForNativeTable(const CorrName& corrName,
        //
        // The updatable flag is false for an MP view only if it is NOT a
        // protection view. Therefore updatable == FALSE iff it is a
-       // shorthand view. See ReadTableDef.cpp, l. 3379.
+       // shorthand view.
        //
 
        viewFileName_ = NULL;
@@ -5456,12 +5454,7 @@ NABoolean NATable::fetchObjectUIDForNativeTable(const CorrName& corrName,
        Int32 catStrLen = 0;
        Int32 schemaStrLen = 0;
        Int32 fileStrLen = 0;
-#ifdef NA_64BIT
-       // dg64 - match signature
        int_32 primaryNodeNum=0;
-#else
-       Int32 primaryNodeNum=0;
-#endif
        short error = 0;
 
        //clusteringIndex has physical filename that can be used to check
@@ -7526,7 +7519,6 @@ NATable * NATableDB::get(const ExtendedQualName* key, BindWA* bindWA, NABoolean
       const Int64 tableRedefTime = cachedNATable->getRedefTime();
       //Get last catalog operation time
       Int64 labelCatalogOpTime = tableRedefTime;
-      Int64 rforkCatalogOpTime = tableRedefTime;
       Int64 currentSchemaRedefTS = 0;
       Int64 cachedSchemaRedefTS = 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/NATable.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.h b/core/sql/optimizer/NATable.h
index 3d4b96e..111f99f 100644
--- a/core/sql/optimizer/NATable.h
+++ b/core/sql/optimizer/NATable.h
@@ -1018,13 +1018,13 @@ private:
   UInt32 flags_;
 
   // ---------------------------------------------------------------------
-  // NORMAL, INDEX, RFORK, VIRTUAL, etc.
+  // NORMAL, INDEX, VIRTUAL, etc.
   // ---------------------------------------------------------------------
   // ExtendedQualName::SpecialTableType specialType_;
 
   // ---------------------------------------------------------------------
   // Extended Qualified name for the table. This also has the specialType
-  // (NORMAL, INDEX, RFORK, VIRTUAL, etc.) and the location Name.
+  // (NORMAL, INDEX, VIRTUAL, etc.) and the location Name.
   // ---------------------------------------------------------------------
   ExtendedQualName qualifiedName_;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ObjectNames.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ObjectNames.cpp b/core/sql/optimizer/ObjectNames.cpp
index d309ca6..c58fef1 100644
--- a/core/sql/optimizer/ObjectNames.cpp
+++ b/core/sql/optimizer/ObjectNames.cpp
@@ -55,12 +55,11 @@
 
 #include "ComSmallDefs.h"
 
+#include "ComResWords.h"
 
 #include "SqlParserGlobals.h"			// must be last
 
-#if !defined(__EID) && !defined(ARKFS_OPEN)
-#include "ComResWords.h"
-#endif
+
 // -----------------------------------------------------------------------
 // Context variable for "getXxxAsAnsiString()" methods simplifies the
 // calling interface (we don't have to pass a boolean all over the place).
@@ -429,12 +428,6 @@ Int32 QualifiedName::extractAndDefaultNameParts(const SchemaName& defCatSch
         catName = defCatSch.getCatalogName();
       }
     }
-    else if (SqlParser_NAMETYPE == DF_NSK &&
-	     *catName.data() == '$' &&
-	     SqlParser_MPLOC.hasSystemName()) {
-      // If user specified only a $VOL, fill in the current default \SYS.
-      catName.prepend(SqlParser_MPLOC.getSystemName() + ".");
-    }
 
     if (schName.isNull()) {
       if((ActiveSchemaDB()->getDefaults().schSetToUserID()) &&
@@ -1496,7 +1489,6 @@ ComAnsiNameSpace ExtendedQualName::convSpecialTableTypeToAnsiNameSpace( const Sp
   case  MV_TABLE:
   case  PARTITION_TABLE:
   case  TRIGTEMP_TABLE:
-  case  RESOURCE_FORK:
   case  VIRTUAL_TABLE:
   case  MVS_UMD:
     return COM_TABLE_NAME;
@@ -1628,10 +1620,7 @@ ostream& operator<< (ostream& out, TaskMonitor t)
   return out<< "Time = " <<
   ((double) t.timer()) / CLOCKS_PER_SEC
   << " us (microsecond)" <<
-//#if defined(NA_LINUX)
-   //"\tET = " << out.fixed << out.precision(6) << t.elapsed_time() << " s" << 
    "\tET = " << t.elapsed_time() << " s" << 
-//#endif
   " \tCounts = "<<t.count()<<" \tGoodCnts = "<<t.goodcount();
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/ObjectNames.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ObjectNames.h b/core/sql/optimizer/ObjectNames.h
index b799ffa..c900a2a 100644
--- a/core/sql/optimizer/ObjectNames.h
+++ b/core/sql/optimizer/ObjectNames.h
@@ -477,7 +477,6 @@ public:
 			  ISP_TABLE, 		// Internal Stored Procedure
 			  LOAD_TABLE,
 			  PARTITION_TABLE,
-			  RESOURCE_FORK,
 			  VIRTUAL_TABLE,
 			  IUD_LOG_TABLE, 
 			  RANGE_LOG_TABLE,
@@ -667,11 +666,6 @@ private:
 // These are 'virtual' tables for special purpose needs.
 // Binder uses this information to 'generate' table descriptors.
 // Ustat does not fetch real histograms for virtual tables.
-//   E.g., RESOURCE_FORK is a SQL table that doesn't exist in metadata
-//   as a base table.
-//   So, any sql dml operation on resource fork is done by specifying a
-//   special syntax in the SQL statement that tells if this is a resource fork.
-//   "SELECT * FROM TABLE (RESOURCE_FORK <rfork-guardian-name>)" is an example.
 // -----------------------------------------------------------------------
 class CorrName : public NABasicObject
 {
@@ -741,19 +735,6 @@ public:
        flagbits_(corr.flagbits_)
   {}
 
-/*
-// c89 can't distinguish between the non-tandem version of
-// this constructor and the above constructor taking four NAString
-// arguments (what?  It can't tell a NABoolean is not a NAString, or,
-// somebody wrote a conversion operator from NABoolean to NAString?)
-// May need more investigation, but this fix certainly works.  -wlr-
-#ifndef __TANDEM
-  #define CORRNAME_CTOR_const const
-#else
-  #define CORRNAME_CTOR_const
-#endif
-  CorrName(CORRNAME_CTOR_const NAString& corrName,
-*/
   CorrName(const NAString& corrName,
   	   NABoolean isFabricated,
            CollHeap * h=0,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/RelCache.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelCache.cpp b/core/sql/optimizer/RelCache.cpp
index 5fb606c..2496f65 100644
--- a/core/sql/optimizer/RelCache.cpp
+++ b/core/sql/optimizer/RelCache.cpp
@@ -1208,10 +1208,6 @@ void Scan::generateCacheKey(CacheWA &cwa) const
   if (stream_) { 
     cwa += " stream "; 
   }
-  // mark mpalias queries so they can be decached upon user request
-  if (getTableDesc()->getNATable()->isAnMPTableWithAnsiName()) {
-    cwa += AM_AN_MPALIAS_QUERY;
-  }
 
   if (getHbaseAccessOptions())
     {
@@ -1237,11 +1233,7 @@ NABoolean Scan::isCacheableExpr(CacheWA& cwa)
     if (stream_) { // pub-sub streams are not cacheable
       return FALSE;
     }
-    // mpalias SELECT is not cacheable unless explicitly requested
-    if (getTableDesc()->getNATable()->isAnMPTableWithAnsiName() &&
-        CmpCommon::getDefault(QUERY_CACHE_MPALIAS) == DF_OFF) {
-      return FALSE;
-    }
+
     cwa.setConditionallyCacheable(); 
     if (CmpCommon::getDefaultLong(MVQR_REWRITE_LEVEL) >= 1 &&
         QRDescGenerator::hasRewriteEnabledMVs(getTableDesc())) {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/SchemaDB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SchemaDB.cpp b/core/sql/optimizer/SchemaDB.cpp
index a2f611f..ef5f3a9 100644
--- a/core/sql/optimizer/SchemaDB.cpp
+++ b/core/sql/optimizer/SchemaDB.cpp
@@ -81,7 +81,7 @@ void InitSchemaDB()
 // there were a statement heap, as soon as it was "wiped away" these data
 // members would be time bombs, since their internal heap pointers would be
 // invalid.
-SchemaDB::SchemaDB(ReadTableDef *rtd)
+SchemaDB::SchemaDB()
   : tableDB_(
           new CTXTHEAP NAHeap("NATable Heap", (NAHeap *)CTXTHEAP, 
           16 * 1024,
@@ -90,7 +90,6 @@ SchemaDB::SchemaDB(ReadTableDef *rtd)
     actionRoutineDB_(CmpCommon::contextHeap()),
     valueDArray_(),
     domainDList_(CmpCommon::contextHeap()),
-    readTableDef_(rtd),
     defaults_(CmpCommon::contextHeap()),
     defaultSchema_(CmpCommon::contextHeap()),
 	// triggers -- eliezer
@@ -150,16 +149,10 @@ void SchemaDB::initPerStatement(NABoolean lightweight)
 }
 
 // By default, this returns the ANSI default schema.
-// You need to pass in a flag bit to get the MPLOC, if NAMETYPE is NSK
-// (BindWA does this).
-//
 const SchemaName &SchemaDB::getDefaultSchema(UInt32 flags)
 {
-  if (flags & REFRESH_CACHE) initPerStatement();
-
-  if (flags & APPLY_NAMETYPE_RULES)
-    if (SqlParser_Initialized() && SqlParser_NAMETYPE == DF_NSK)
-      return SqlParser_MPLOC_as_SchemaName;
+  if (flags & REFRESH_CACHE) 
+    initPerStatement();
 
   return defaultSchema_;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/SchemaDB.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SchemaDB.h b/core/sql/optimizer/SchemaDB.h
index 8f4a8cd..0bc9a9b 100644
--- a/core/sql/optimizer/SchemaDB.h
+++ b/core/sql/optimizer/SchemaDB.h
@@ -93,7 +93,7 @@ public:
   // --------------------------------------------------------------------
   // Constructor function
   // --------------------------------------------------------------------
-  SchemaDB(ReadTableDef *rtd) ;
+  SchemaDB() ;
 
   // copy ctor
   SchemaDB(const SchemaDB & orig) ; // not written
@@ -107,7 +107,6 @@ public:
   // Accessor functions
   // --------------------------------------------------------------------
   NATableDB       * getNATableDB()          { return &tableDB_; }
-  ReadTableDef	  * getReadTableDef()       { return readTableDef_; }
   ValueDescArray  & getValueDescArray()     { return valueDArray_; }
   NADefaults      & getDefaults()           { return defaults_; }
   NARoutineDB     * getNARoutineDB()        { return &routineDB_; }
@@ -136,8 +135,6 @@ public:
   // now **ONLY** CmpContext should manage the init/cleanupPerStatement
   // calls, which is the current mechanism!
   //
-  // This is also a convenient spot to hide transaction ends and begins;
-  // see ReadTableDef.[hC] for fuller discussion.
   // --------------------------------------------------------------------
   void createStmtTables();      // no longer used (formerly required)
   void dropStmtTables();        // no longer used
@@ -179,8 +176,7 @@ private:
   // SQL compiler terminates processing. For now, (11/20/96) tableDB_
   // needs to be cleanup up for each statement, because it is caching
   // the information without checking the timestamp for reload if 
-  // necessary. After integrated with catman ReadTableDef code, it
-  // will only be reloaded if necessary.
+  // necessary.
   // --------------------------------------------------------------------
   NATableDB tableDB_;
 
@@ -200,11 +196,6 @@ private:
   DomainDescList domainDList_;
 
   // --------------------------------------------------------------------
-  // ReadTableDef server
-  // --------------------------------------------------------------------
-  ReadTableDef *readTableDef_;
-
-  // --------------------------------------------------------------------
   // In-memory table of defaults values.
   // --------------------------------------------------------------------
   NADefaults defaults_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index 1445562..44d6d99 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -87,7 +87,6 @@ static void shortenTypeSQLname(const NAType &op,
   }
 }
 
-// This one's NOT static -- GenRfork calls it!
 void emitDyadicTypeSQLnameMsg(Lng32 sqlCode,
 			      const NAType &op1,
 			      const NAType &op2,
@@ -6651,76 +6650,6 @@ const NAType *ItmSeqNotTHISFunction::synthesizeType()
  return result;
 }
 
-// -----------------------------------------------------------------------
-// member functions for class AuditImage
-// -----------------------------------------------------------------------
-
-const NAType *AuditImage::synthesizeType()
-{
-  const NAType * type = NULL;
-
-  const NATable *naTable = getNATable();
-
-  // The data types of the columns (in order) in the object
-  // must match the data types of columns specified in the
-  // expression list for AUDIT_IMAGE. The columns in the expression
-  // list form the children of AUDIT_IMAGE node.
-
-  const NAColumnArray &naColumns = naTable->getNAColumnArray();
-  for (UInt32 i=0; i < naColumns.entries(); i++)
-    {
-
-      const NAColumn *tableNACol = naColumns[i];
-      const NAType *tableColumnType = tableNACol->getType();
-
-      // Populate member varaible columnTypeList_ (to be used
-      // during codeGen. See AuditImage::codeGen()) with the
-      // column types of the object.
-      columnTypeList_.insert(tableColumnType);
-
-      // Actual datatype checking is done only for non-Constants.
-      // Compatiblity type checking is done for Constants.
-      // Note: Constants are used only for internal testing.
-      const NAType *childType = &children()[i].getValueId().getType();
-      if (children()[i].getPtr()->getOperatorType() == ITM_CONSTANT ||
-	  childType->getTypeQualifier() == NA_UNKNOWN_TYPE)
-	{
-	  children()[i].getValueId().coerceType(*tableColumnType);
-	  // the coerceType method above might have changed
-	  // the childType. So, get it one more time.
-	  childType = &children()[i].getValueId().getType();
-	  if (NOT childType->isCompatible(*tableColumnType))
- 	    {
-	      *CmpCommon::diags() << DgSqlCode(-4316)
-				  << DgTableName(getObjectName().getQualifiedNameAsString())
-				  << DgColumnName(tableNACol->getColName());
-	      return NULL;
-	    }
-	}
-      else
-	{
-	  // Not a constant, so enforce type checking; but w.r.t NULL - check
-	  // only if it's physical and not if the value of
-	  // has the exact enum NAType::SupportsSQLnull.
- 	  if (!(tableColumnType->equalPhysical(*childType)))
-	    {
-	      *CmpCommon::diags() << DgSqlCode(-4316)
-				  << DgTableName(getObjectName().getQualifiedNameAsString())
-				  << DgColumnName(tableNACol->getColName());
-	      return NULL;
-	    }
-	}
-    }
-
-
-  const Lng32 recordLength = naTable->getRecordLength();
-
-  type = new HEAP
-    SQLVarChar(HEAP, recordLength);
-
-  return type;
-}
-
 const NAType * HbaseColumnLookup::synthesizeType()
 {
   NAType * type = NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/TableDesc.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/TableDesc.h b/core/sql/optimizer/TableDesc.h
index d749c58..321be1b 100644
--- a/core/sql/optimizer/TableDesc.h
+++ b/core/sql/optimizer/TableDesc.h
@@ -196,12 +196,7 @@ public:
   //
   // 64-bit Project: Cast 'this' to "long" first to avoid C++ error
   //
-#ifdef NA_64BIT
   ULng32 hash() const { return (ULng32) ((Long)this/8);}
-#else
-  ULng32 hash() const { return (ULng32) this/4;}
-#endif
-
 
   // get local predicates for this table
   ValueIdSet getLocalPreds();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/VEGTable.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/VEGTable.h b/core/sql/optimizer/VEGTable.h
index 0501c1a..b353f3a 100644
--- a/core/sql/optimizer/VEGTable.h
+++ b/core/sql/optimizer/VEGTable.h
@@ -99,7 +99,7 @@ public:
   // oops I need to delete theArray_ and arrayValid_, but since I dont 
   // have time to run regression again and RAList is only used within
   // CmpStatementHeap so far, then I will delay this to next checkin
-  NA_EIDPROC virtual ~RAList() {};
+  virtual ~RAList() {};
 
   // assignment
   RAList<T> & operator =(const RAList<T> &other);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/costmethod.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/costmethod.cpp b/core/sql/optimizer/costmethod.cpp
index 9ff5c3a..83683e5 100644
--- a/core/sql/optimizer/costmethod.cpp
+++ b/core/sql/optimizer/costmethod.cpp
@@ -7146,7 +7146,7 @@ CostMethodHashGroupBy::computePassCost(NABoolean         isFirstPass,
 
   // this check was added to prevent overflowing.  11/06/00
   if ( noOfClustersToBeProcessed_ > INT_MAX/MIN_ONE(noOfClustersSpilled) )
-    noOfClustersToBeProcessed_ = INT_MAX; // NA_64BIT revisit for large value
+    noOfClustersToBeProcessed_ = INT_MAX;
   else
     noOfClustersToBeProcessed_ *= noOfClustersSpilled;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/optimizer/opt.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/opt.cpp b/core/sql/optimizer/opt.cpp
index bc81124..2ab3de9 100644
--- a/core/sql/optimizer/opt.cpp
+++ b/core/sql/optimizer/opt.cpp
@@ -3773,8 +3773,8 @@ OptDefaults::OptDefaults(CollHeap* h) : heap_(h)
    readAheadMaxBlocks_ =16.0;
    acceptableInputEstLogPropError_ = 0.5;
    taskCount_ = 0;
-   optTaskLimit_ = INT_MAX; // NA_64BIT - revisit for large value
-   enumPotentialThreshold_ = INT_MAX; // NA_64BIT - revisit for large value
+   optTaskLimit_ = INT_MAX;
+   enumPotentialThreshold_ = INT_MAX;
    level1Constant1_ = 100;
    level1Constant2_ = 100;
    level1ImmunityLimit_ = 5000;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/parser/HvRoles.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/HvRoles.h b/core/sql/parser/HvRoles.h
index ab8c896..6245583 100644
--- a/core/sql/parser/HvRoles.h
+++ b/core/sql/parser/HvRoles.h
@@ -54,8 +54,7 @@ enum HostVarRole {
   HV_IS_DESC_DEST,
   HV_IS_DESC_SOURCE,
   HV_IS_DYNPARAM,
-  HV_IS_INPUT_OUTPUT,  // A variable appearing in a SET statement of a Compound Statement
-  HV_IS_DEFINE  // NSK define
+  HV_IS_INPUT_OUTPUT  // A variable appearing in a SET statement of a Compound Statement
 };
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/parser/ParKeyWords.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParKeyWords.cpp b/core/sql/parser/ParKeyWords.cpp
index a599ec5..e0a2f28 100644
--- a/core/sql/parser/ParKeyWords.cpp
+++ b/core/sql/parser/ParKeyWords.cpp
@@ -110,7 +110,6 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("ATTRIBUTE",          TOK_ATTRIBUTE,   NONRESTOKEN_),
   ParKeyWord("ATTRIBUTES",         TOK_ATTRIBUTES,  NONRESTOKEN_),
   ParKeyWord("AUDIT",              TOK_AUDIT,       NONRESTOKEN_),
-  ParKeyWord("AUDIT_IMAGE",        TOK_AUDIT_IMAGE, NONRESTOKEN_),
   ParKeyWord("AUDITCOMPRESS",      TOK_AUDITCOMPRESS, NONRESTOKEN_),
   ParKeyWord("AUTHENTICATION",     TOK_AUTHENTICATION, NONRESTOKEN_),
   ParKeyWord("AUDITONREFRESH",     TOK_AUDITONREFRESH, FLAGSNONE_),
@@ -680,7 +679,6 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("MOVINGSTDDEV",       TOK_MSTDDEV,     NONRESTOKEN_),
   ParKeyWord("MOVINGSUM",          TOK_MSUM,        NONRESTOKEN_),
   ParKeyWord("MOVINGVARIANCE",     TOK_MVARIANCE,   NONRESTOKEN_),
-  ParKeyWord("MPLOC",              TOK_MPLOC,       NONRESTOKEN_),
   ParKeyWord("MTS",                TOK_MTS,         NONRESTOKEN_),
   ParKeyWord("MULTI",              TOK_MULTI,       NONRESTOKEN_),
   ParKeyWord("MULTIDELTA",         TOK_MULTIDELTA,  FLAGSNONE_),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/parser/SqlParserAux.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/SqlParserAux.cpp b/core/sql/parser/SqlParserAux.cpp
index 58196dd..ff62d2d 100644
--- a/core/sql/parser/SqlParserAux.cpp
+++ b/core/sql/parser/SqlParserAux.cpp
@@ -1771,10 +1771,7 @@ CorrName * corrNameFromStrings(ShortStringSequence *names)
 
   const NAString &tblName = qn->getObjectName();
 
-  if ((qn->getCatalogName() == "") && (SqlParser_NAMETYPE == DF_NSK))
-    result = new (PARSERHEAP()) CorrName(*qn, PARSERHEAP(), tblName);
-  else
-    result = new (PARSERHEAP()) CorrName(*qn, PARSERHEAP());
+  result = new (PARSERHEAP()) CorrName(*qn, PARSERHEAP());
 
   ComASSERT(result);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 0639508..076c9e7 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -466,7 +466,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %token <tokval> TOK_ASC
 %token <tokval> TOK_ASCII
 %token <tokval> TOK_ATOMIC
-%token <tokval> TOK_AUDIT_IMAGE 		// Utilities.
 %token <tokval> TOK_AUDITONREFRESH		// MV
 %token <tokval> TOK_AUTOABORT
 %token <tokval> TOK_AUTOBEGIN
@@ -854,7 +853,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 // %token <tokval> TOK_M -- already defined below
 %token <tokval> TOK_MONTHNAME
 %token <tokval> TOK_MORE                /* ANSI SQL non-reserved word */
-%token <tokval> TOK_MPLOC               /* Tandem extension non-reserved word */
 %token <tokval> TOK_MRANK               /* Tandem extension non-reserved word */
 %token <tokval> TOK_MSTDDEV             /* Tandem extension non-reserved word */
 %token <tokval> TOK_MSUM                /* Tandem extension non-reserved word */
@@ -2003,9 +2001,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <item>				insert_value_expression_list_paren
 // left recursion for insert statement values.
 
-%type <item>                audit_image_value
-%type <item>                audit_image_arg_list
-%type <corrName>            audit_image_object
 %type <hbaseColumnCreateOptionsList>                hbase_column_create_list
 %type <hbaseColumnCreateOptions>                hbase_column_create_value
 %type <item>      			cast_specification
@@ -2484,7 +2479,6 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <boolean>                 optional_with_shared_access_clause
 %type <stringval>               fully_expanded_guardian_loc_name
 %type <stringval>               guardian_location_name
-%type <stringval>               guardian_subvolume_name
 %type <stringval>               partition_name
 %type <pElemDDL>  		location_list
 %type <pElemDDL>  		source_location_list
@@ -10080,12 +10074,6 @@ misc_function :
 				  ((BiArith*) $$)->setStandardNormalization();
                 }
 
-     | TOK_AUDIT_IMAGE '(' audit_image_object ',' '(' audit_image_arg_list ')' ')'
-             {
-	       // Create an AuditImage function.
-	       $$ = new(PARSERHEAP()) AuditImage(*$3, $6);
-	     }
-
          | TOK_LAST_DAY '(' value_expression ')'
              {
 	       $$ = new (PARSERHEAP()) ZZZBinderFunction(ITM_LAST_DAY, $3);
@@ -10327,76 +10315,6 @@ date_time_operand : TOK_YEAR    { $$ = ITM_DATEDIFF_YEAR   ;}
                       }
                     }
 
-/* type corrname  */
-audit_image_object: TOK_INDEX_TABLE actual_table_name 
-                           {
-			     // This syntax is only allowed if the internal 
-			     // parser flag is set, since this is internal syntax.
-			     // For showplan, note that currently, the internal 
-			     // sqlparser flags are not correctly propagated to 
-			     // the second mxcmp, hence a check for the control
-			     // session value for showplan is also needed.
-			     const NAString * val =
-			       ActiveControlDB()->getControlSessionValue("SHOWPLAN");
-			     if (((val) && (*val == "ON")) ||
-				 (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE)) 
-#ifdef _DEBUG
-                                 || (getenv("TEST_INTERNAL_SYNTAX"))
-#endif // _DEBUG
-                                )
-			       {
-				 $2->setSpecialType(ExtendedQualName::INDEX_TABLE);
-				 $$ = $2;
-			       }
-                               else
-                               {
-                                 yyerror(""); YYERROR;
-                               }
-			   } // TOK_INDEX_TABLE
-                    | TOK_TABLE actual_table_name 
-                        {
-			  
-			  // Enable AUDIT_IMAGE functions for tables. 
-			  // This is used only for testing purpose right now.
-			  if (CmpCommon::getDefault(AUDIT_IMAGE_FOR_TABLES) == DF_ON)
-			    {
-			      // This syntax is only allowed if the internal 
-			      // parser flag is set, since this is internal 
-			      // syntax. For showplan, note that currently, 
-			      // the internal sqlparser flags are not correctly 
-			      // propagated to the second mxcmp,
-			      // hence a check for the control session value for 
-			      // showplan is also needed.
-			      
-			      // In addition, AuditImage for TOK_TABLE must be allowed
-			      // only if CQD AUDIT_IMAGE_FOR_TABLES is set to ON.
-			      const NAString * val =
-				ActiveControlDB()->getControlSessionValue("SHOWPLAN");
-			      if (((val) && (*val == "ON")) ||
-				  (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE))
-#ifdef _DEBUG
-                                  || (getenv("TEST_INTERNAL_SYNTAX"))
-#endif // _DEBUG
-                                 )
-				{
-				  // NORMAL_TABLE should be the default. Setting it 
-				  // anyway to be consistent with its INDEX_TABLE 
-				  // counterpart.
-				  $2->setSpecialType(ExtendedQualName::NORMAL_TABLE);
-				  $$ = $2;
-				}
-                                else
-                                {
-                                   yyerror(""); YYERROR;
-                                }
-			      
-			    } // End of CQD AUDIT_IMAGE_FOR_TABLES
-                            else
-                            {
-                               yyerror(""); YYERROR;
-                            }
-			}
-
 // The value_expression must be cast to the Token Type
 /* type token */
 datetime_keywords : TOK_QUARTER  ',' value_expression 		  // 3 months	Cast 3*num_expr to months
@@ -10557,20 +10475,6 @@ timestamp_keywords : IDENTIFIER ',' value_expression
   }
 
 /* type item */
-audit_image_arg_list:  audit_image_value 
-                      {
-			$$ = $1;
-                      }
-                      | audit_image_value ',' audit_image_arg_list
-                      {
-			$$ = new(PARSERHEAP()) ItemList($1, $3);
-                      }
-
-/* type item */
-audit_image_value : value_expression
-
-
-/* type item */
 encode_key_cast_spec : cast_specification
 
                    | TOK_LOW_VALUE '(' data_type
@@ -21524,19 +21428,6 @@ declare_or_set_cqd: TOK_DECLARE TOK_CATALOG character_string_literal
                                     ControlQueryDefault(
                                       SQLTEXT(), (CharInfo::CharSet)SQLTEXTCHARSET(), "NAMETYPE", *$3);
 				}
-                  | TOK_DECLARE TOK_MPLOC character_string_literal
-                                {
-                                  // DEFAULT_CHARSET has no effect on character_string_literal in this context
-                                  $$ = new (PARSERHEAP())
-                                    ControlQueryDefault(
-                                      SQLTEXT(), (CharInfo::CharSet)SQLTEXTCHARSET(), "MP_SUBVOLUME", *$3);
-                                }
-                  | TOK_DECLARE TOK_MPLOC guardian_subvolume_name
-                                {
-                                  $$ = new (PARSERHEAP())
-                                    ControlQueryDefault(
-                                      SQLTEXT(), (CharInfo::CharSet)SQLTEXTCHARSET(), "MP_SUBVOLUME", *$3);
-                                }
 
 		  /* The SET flavor is dynamic (the extra TRUE flag).
 		  /* See the comments way at the top for when
@@ -21627,17 +21518,6 @@ declare_or_set_cqd: TOK_DECLARE TOK_CATALOG character_string_literal
 				  $$ = normalizeDynamicCQD(
 				    "NAMETYPE", *$3);
 				}
-                  | TOK_SET TOK_MPLOC character_string_literal 
-                                {
-                                  // DEFAULT_CHARSET has no effect on character_string_literal in this context
-				  $$ = normalizeDynamicCQD(
-				    "MP_SUBVOLUME", *$3);
-                                }
-                  | TOK_SET TOK_MPLOC guardian_subvolume_name 
-                                {
-				  $$ = normalizeDynamicCQD(
-				    "MP_SUBVOLUME", *$3);
-                                }
 
 /* type tokval */
 query_shape_options : TOK_IMPLICIT TOK_EXCHANGE
@@ -22773,9 +22653,6 @@ show_statement:
                case ExtendedQualName::TRIGTEMP_TABLE:
                  labelAnsiNameSpace = COM_TRIGTEMP_TABLE_NAME;
                  break;
-               case ExtendedQualName::RESOURCE_FORK:
-                 labelAnsiNameSpace = COM_TABLE_NAME;
-                 break;
                default :
                  // There should be a case for every special type that
                  // is specified by the production extended_label_name.
@@ -23103,15 +22980,6 @@ collate_clause : TOK_COLLATE TOK_DEFAULT   { $$ = CharInfo::DefaultCollation; }
 		     //
 		     $$ = CharInfo::UNKNOWN_COLLATION;
 		     NABoolean lookupNameAsNSK = FALSE;
-		     if (SqlParser_NAMETYPE == DF_NSK) {
-		       if (qn->getCatalogName().isNull()) {
-			 lookupNameAsNSK = TRUE;
-			 if (qn->getSchemaName().isNull()) {
-			   NAString n(qn->getObjectName());
-			   $$ = CharInfo::getCollationEnum(n, lookupNameAsNSK);
-			 }	// SJIS
-		       }	// Y.SJIS or SJIS
-		     }		// NAMETYPE NSK
 
 		     if ($$ == CharInfo::UNKNOWN_COLLATION) {
 
@@ -28905,18 +28773,6 @@ location_definition : guardian_location_name
  */
 
 /* type stringval */
-/* ...lu-shung... kludge */
-// Use identifier instead of regular_identifier to allow reserved words all 
-// caps in double quotes as subvolume name.  Double quotes are handled in 
-// ValidateNSKNamePart::validate of DefaultValidator.cpp and
-// ComMPLoc::parse of ComMPLoc.cpp.
-guardian_subvolume_name : guardian_volume_name '.' identifier
-                                {
-                                  $1->append("." + *$3);
-                                  delete $3;
-                                  $$ = $1;
-                                }
-/* type stringval */
 guardian_location_name : guardian_volume_name
                        | guardian_volume_name '.' 
 		         regular_identifier   '.'
@@ -33753,7 +33609,6 @@ nonreserved_word :      TOK_ABORT
                       | TOK_MORE
                       | TOK_MOVE
                       | TOK_MOVEMENT
-                      | TOK_MPLOC             /* Tandem extension */
                       | TOK_MTS
                       | TOK_MV  
                       | TOK_MULTI            /* Long Running */
@@ -34084,7 +33939,6 @@ nonreserved_func_word:  TOK_ABS
                       | TOK_ASIN
                       | TOK_ATAN
                       | TOK_ATAN2
-                      | TOK_AUDIT_IMAGE  // Utilities
                       | TOK_AUTHNAME
                       | TOK_AUTHTYPE
                       | TOK_BITAND

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/qms/QmmMain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/qms/QmmMain.cpp b/core/sql/qms/QmmMain.cpp
index 140db8d..557a8ce 100644
--- a/core/sql/qms/QmmMain.cpp
+++ b/core/sql/qms/QmmMain.cpp
@@ -27,14 +27,12 @@
 #include "QRLogger.h"
 #include "NAType.h"
 
-#if defined (NA_LINUX)
 #include "nsk/nskport.h"
 #include "seabed/ms.h"
 #include "seabed/fs.h"
 extern void my_mpi_fclose();
 #include "SCMVersHelp.h"
 DEFINE_DOVERS(tdm_arkqmm)
-#endif
 
 /**
  * \file
@@ -144,10 +142,6 @@ static short getDefaultQmpCpu(const IpcEnvironment* ipcEnv)
 {
   short qmpCpu;
 
-#ifdef NA_WINNT
-  qmpCpu = 0;
-#elif defined(NA_LINUX)
-
   // Default QMP location is the same cpu QMM is running on.
   SB_Phandle_Type procHandle;
   Int32 lc_cpu;
@@ -161,24 +155,19 @@ static short getDefaultQmpCpu(const IpcEnvironment* ipcEnv)
                                "XPROCESSHANDLE_DECOMPOSE_ returned error %d", error);
       qmpCpu = 3;  // best-guess default
     }
-#endif
 
   return qmpCpu;
 }
 
 
-#ifdef NA_LINUX
 extern "C"
 {
 Int32 sq_fs_dllmain();
 }
-#endif
-
 
 Int32 main(Int32 argc, char *argv[])
 {
 
-#ifdef NA_LINUX
   dovers(argc, argv);
 
   try
@@ -194,7 +183,6 @@ Int32 main(Int32 argc, char *argv[])
     cerr << "Error while initializing messaging system. Exiting..." << endl;
     exit(1);
   }
-#endif
 
   Lng32 result = 0;
 
@@ -206,13 +194,6 @@ Int32 main(Int32 argc, char *argv[])
   //for (int i=0; i<argc; i++)
   //  debugMessage2("Program argument %d is %s", i, argv[i]);
    
-#ifdef NA_WINNT
-  if (getenv("QMP_MSGBOX_PROCESS") != NULL)
-  {
-    MessageBox( NULL, "QMM Process Launched", (CHAR *)argv[0], MB_OK|MB_ICONINFORMATION );
-  };
-#endif
-
   Qmm* qmm = NULL;
   try
     {