You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by sa...@apache.org on 2017/02/24 18:24:11 UTC

[1/5] incubator-trafodion git commit: Fix for a potential stack memory corruption.

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master d7793509b -> 2abcb0338


Fix for a potential stack memory corruption.


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

Branch: refs/heads/master
Commit: c50fc922e2c7ed7b89391a94fc5c21db5a748196
Parents: fcfc579
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Thu Feb 23 06:42:14 2017 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Thu Feb 23 06:42:14 2017 +0000

----------------------------------------------------------------------
 core/sql/optimizer/NATable.cpp          | 4 +++-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c50fc922/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index 7a90179..d57f770 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -5481,7 +5481,9 @@ NABoolean createNAFileSets(TrafDesc * table_desc       /*IN*/,
 
   if(postCreateNATableWarnings != preCreateNATableWarnings)
 	  tableConstructionHadWarnings_=TRUE;
-  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+  char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
+  memset(lobHdfsServer,0,256);
+  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), strlen(CmpCommon::getDefaultString(LOB_HDFS_SERVER)));
   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   if (hasLobColumn())
   {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c50fc922/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index 93f16be..cbe5463 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -4257,7 +4257,10 @@ short CmpSeabaseDDL::dropSeabaseTable2(
   short *lobNumList = new (STMTHEAP) short[numCols];
   short *lobTypList = new (STMTHEAP) short[numCols];
   char  **lobLocList = new (STMTHEAP) char*[numCols];
-  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+
+  char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
+  memset(lobHdfsServer,0,256);
+  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), strlen(CmpCommon::getDefaultString(LOB_HDFS_SERVER)));
   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   Lng32 j = 0;
   for (Int32 i = 0; i < nacolArr.entries(); i++)


[5/5] incubator-trafodion git commit: Merge remote branch 'origin/pr/977/head' into merge_977

Posted by sa...@apache.org.
Merge remote branch 'origin/pr/977/head' into merge_977


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

Branch: refs/heads/master
Commit: 2abcb0338eda2a054cb1d1dd476d49faa2bee63a
Parents: d779350 2aeb4d1
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Feb 24 18:23:49 2017 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Feb 24 18:23:49 2017 +0000

----------------------------------------------------------------------
 core/sql/cli/Cli.cpp                    |  7 ++++---
 core/sql/optimizer/NATable.cpp          |  8 ++++++--
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 14 ++++++++++----
 3 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------



[2/5] incubator-trafodion git commit: Fixes from review

Posted by sa...@apache.org.
Fixes from review


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

Branch: refs/heads/master
Commit: bd5f2b0106692120a84c665fdfa9bf2afeb3b61c
Parents: c50fc92
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Feb 24 00:17:27 2017 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Feb 24 00:17:27 2017 +0000

----------------------------------------------------------------------
 core/sql/cli/Cli.cpp                    | 6 +++---
 core/sql/optimizer/NATable.cpp          | 8 ++++----
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/bd5f2b01/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index d478483..27c869e 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -10576,7 +10576,7 @@ Lng32 SQLCLI_LOBddlInterface
  /*IN*/     short *lobTypList,
  /*IN*/     char* *lobLocList,
 /*IN*/      char* *lobColNameList,
- /*IN*/     char *hdfsServer,
+ /*IN*/     char *lobHdfsServer,
  /*IN*/     Int32 hdfsPort,
 /*IN*/    Int64 lobMaxSize,
 /*IN*/    NABoolean lobTrace
@@ -10606,7 +10606,7 @@ Lng32 SQLCLI_LOBddlInterface
   str_sprintf(logBuf,"lobMDName %s", lobMDName);
   lobDebugInfo(logBuf,0,__LINE__,lobTrace);
   char * query = new(currContext.exHeap()) char[4096];
-
+  char *hdfsServer = new(currContext.exHeap()) char[256];
   switch (qType)
     {
     case LOB_CLI_CREATE:
@@ -10955,7 +10955,7 @@ Lng32 SQLCLI_LOBddlInterface
 
  error_return:
   NADELETEBASIC(query, currContext.exHeap());
-
+  NADELETEBASIC(hdfsServer,currContext.exHeap());
   delete cliInterface;
  
   if (cliRC < 0)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/bd5f2b01/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index d57f770..e04f863 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -5483,13 +5483,13 @@ NABoolean createNAFileSets(TrafDesc * table_desc       /*IN*/,
 	  tableConstructionHadWarnings_=TRUE;
   char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
   memset(lobHdfsServer,0,256);
-  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), strlen(CmpCommon::getDefaultString(LOB_HDFS_SERVER)));
+  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), sizeof(lobHdfsServer));
   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   if (hasLobColumn())
   {
-	  // read lob related information from lob metadata
-	  //     setFromStoredDesc(TRUE);
-      //
+    // read lob related information from lob metadata
+    //     setFromStoredDesc(TRUE);
+    
 	    short *lobNumList = new (heap_) short[getColumnCount()];
 	    short *lobTypList = new (heap_) short[getColumnCount()];
 	    char  **lobLocList = new (heap_) char*[getColumnCount()];

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/bd5f2b01/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index cbe5463..74b020d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -4260,7 +4260,7 @@ short CmpSeabaseDDL::dropSeabaseTable2(
 
   char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
   memset(lobHdfsServer,0,256);
-  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), strlen(CmpCommon::getDefaultString(LOB_HDFS_SERVER)));
+  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER),sizeof(lobHdfsServer));
   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   Lng32 j = 0;
   for (Int32 i = 0; i < nacolArr.entries(); i++)


[3/5] incubator-trafodion git commit: Merge remote branch 'origin/master' into 2.2_work

Posted by sa...@apache.org.
Merge remote branch 'origin/master' into 2.2_work

Conflicts:
	core/sql/optimizer/NATable.cpp


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

Branch: refs/heads/master
Commit: 8c2ccd730d98737ac0d34be92b41c48a9bfd242c
Parents: bd5f2b0 549850a
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Feb 24 00:23:37 2017 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Feb 24 00:23:37 2017 +0000

----------------------------------------------------------------------
 .../java/org/trafodion/ci/DatabaseQuery.java    |   23 +-
 .../java/org/trafodion/ci/InterfaceQuery.java   |   14 +-
 .../src/main/java/org/trafodion/ci/Session.java |   11 +
 .../export/include/common/evl_sqlog_eventnum.h  |    2 +
 core/sqf/monitor/linux/makefile                 |    5 +-
 core/sqf/monitor/linux/monitor.cxx              |    4 +-
 core/sqf/monitor/linux/pnode.cxx                |    2 +-
 core/sqf/monitor/linux/pnodeconfig.cxx          |   54 +-
 core/sqf/monitor/linux/pnodeconfig.h            |    1 +
 core/sqf/monitor/linux/process.cxx              |   20 +-
 core/sqf/monitor/linux/shell.cxx                |    8 +-
 core/sqf/monitor/linux/zclient.cxx              |  110 +-
 core/sqf/monitor/linux/zclient.h                |   83 +-
 core/sqf/monitor/linux/zootest.cxx              |    5 +-
 core/sqf/sqenvcom.sh                            |    4 +
 core/sqf/sql/scripts/sqnodestatus               |    2 +-
 core/sql/bin/SqlciErrors.txt                    |    5 +-
 core/sql/bin/ex_esp_main.cpp                    |   18 +-
 core/sql/cli/Globals.cpp                        |   24 +-
 core/sql/cli/Statement.cpp                      |    7 +
 core/sql/cli/memorymonitor.cpp                  |   76 +-
 core/sql/cli/memorymonitor.h                    |   18 +-
 core/sql/comexe/ComTdbExeUtil.h                 |   28 +-
 core/sql/common/ComUser.cpp                     |   27 +
 core/sql/common/ComUser.h                       |    2 +
 core/sql/common/NAMemory.cpp                    |    2 +-
 core/sql/executor/ExExeUtil.h                   |   10 +-
 core/sql/executor/ExExeUtilGet.cpp              |  394 +-
 core/sql/executor/ExHbaseIUD.cpp                |  208 +-
 core/sql/executor/ExHdfsScan.cpp                |   11 +-
 core/sql/executor/ex_hash_grby.h                |    3 -
 core/sql/executor/hiveHook.cpp                  |   66 +-
 core/sql/exp/ExpLOBinterface.cpp                |    6 +-
 core/sql/generator/GenPreCode.cpp               |   22 +-
 core/sql/generator/GenRelExeUtil.cpp            |   63 +-
 core/sql/generator/GenRelScan.cpp               |    2 +-
 core/sql/generator/GenRelUpdate.cpp             |   14 +-
 core/sql/optimizer/BindRelExpr.cpp              |  140 +-
 core/sql/optimizer/BindWA.h                     |    8 +-
 core/sql/optimizer/Inlining.cpp                 |   36 +-
 core/sql/optimizer/NATable.cpp                  | 4880 +++++++++---------
 core/sql/optimizer/NATable.h                    |   14 +-
 core/sql/optimizer/RelExeUtil.cpp               |   33 +-
 core/sql/optimizer/RelExeUtil.h                 |    4 +
 core/sql/optimizer/RelExpr.cpp                  |    3 +-
 core/sql/optimizer/RelSequence.cpp              |    9 +-
 core/sql/optimizer/RelUpdate.h                  |   12 +-
 core/sql/optimizer/hiveHook.h                   |   24 +-
 core/sql/parser/SqlParserAux.cpp                |    5 +
 core/sql/parser/SqlParserAux.h                  |    1 +
 core/sql/parser/StmtDDLNode.cpp                 |    1 +
 core/sql/parser/StmtDDLNode.h                   |   10 +
 core/sql/parser/sqlparser.y                     |   47 +-
 core/sql/regress/core/EXPECTEDRTS               | 1828 ++++---
 core/sql/regress/core/TESTRTS                   |   11 +
 core/sql/regress/executor/EXPECTED015.SB        |  158 +-
 core/sql/regress/executor/TEST015               |   68 +-
 core/sql/regress/hive/EXPECTED007               |  334 +-
 core/sql/regress/hive/TEST007                   |  153 +-
 core/sql/regress/privs1/EXPECTED141             |  Bin 100853 -> 102260 bytes
 core/sql/regress/privs1/TEST123                 |    2 +-
 core/sql/regress/privs1/TEST141                 |   10 +-
 core/sql/regress/privs2/EXPECTED144             |  Bin 59409 -> 59453 bytes
 core/sql/regress/privs2/FILTER144               |   31 +
 core/sql/regress/seabase/DIFF025.KNOWN          |    2 +-
 core/sql/regress/seabase/EXPECTED002            |  118 +-
 core/sql/regress/tools/runallsb                 |   20 +
 core/sql/runtimestats/SqlStats.cpp              |   12 +
 core/sql/runtimestats/SqlStats.h                |    7 +-
 core/sql/sqlci/SqlciStats.cpp                   |   44 +-
 core/sql/sqlci/sqlci_yacc.y                     |   49 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |  101 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp          |  103 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.h            |    1 +
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |   55 +-
 core/sql/sqlcomp/CmpSeabaseDDLmd.h              |    8 +-
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp       |   18 +
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |   33 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  106 +-
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp       |    7 +
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |    6 +-
 core/sql/sqlcomp/PrivMgr.cpp                    |   10 +-
 core/sql/sqlcomp/PrivMgr.h                      |    5 +-
 core/sql/sqlcomp/PrivMgrCommands.cpp            |   65 +-
 core/sql/sqlcomp/PrivMgrCommands.h              |    6 +
 core/sql/sqlcomp/PrivMgrPrivileges.cpp          |   26 +-
 core/sql/sqlcomp/PrivMgrPrivileges.h            |    4 +-
 core/sql/sqlcomp/PrivMgrRoles.cpp               |  106 +-
 core/sql/sqlcomp/nadefaults.cpp                 |    2 +-
 .../java/org/trafodion/sql/HBaseClient.java     |   38 +-
 core/sql/ustat/hs_globals.cpp                   |    2 +-
 core/sql/ustat/hs_la.cpp                        |   19 +-
 dcs/bin/dcs-config.sh                           |    2 +-
 .../src/asciidoc/_chapters/about.adoc           |    2 +-
 .../src/asciidoc/_chapters/ambari_install.adoc  |   92 +
 .../src/asciidoc/_chapters/introduction.adoc    |   24 +-
 .../src/asciidoc/_chapters/prepare.adoc         |  133 +-
 .../src/asciidoc/_chapters/quickstart.adoc      |    3 +-
 .../src/asciidoc/_chapters/recipe_install.adoc  |   29 -
 .../src/asciidoc/_chapters/recipe_upgrade.adoc  |   30 -
 .../src/asciidoc/_chapters/requirements.adoc    |  159 +-
 docs/provisioning_guide/src/asciidoc/index.adoc |    4 +-
 .../_chapters/sql_language_elements.adoc        |   78 +-
 .../src/asciidoc/_chapters/sql_statements.adoc  |  458 +-
 install/python-installer/configs/version.json   |    2 +-
 install/python-installer/db_install.py          |    8 +-
 install/python-installer/scripts/dcs_setup.py   |    8 +-
 install/python-installer/scripts/hdfs_cmds.py   |    4 +-
 install/python-installer/scripts/traf_setup.py  |    2 +-
 .../python-installer/scripts/traf_sqconfig.py   |    9 +-
 install/python-installer/scripts/traf_start.py  |    4 +-
 install/python-installer/scripts/traf_user.py   |    4 +-
 112 files changed, 6963 insertions(+), 4241 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8c2ccd73/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --cc core/sql/optimizer/NATable.cpp
index e04f863,0e4bd31..35b9c84
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@@ -5024,527 -5025,530 +5025,534 @@@ NABoolean createNAFileSets(TrafDesc * t
  
     if (qualifiedName_.getQualifiedNameObj().isHistograms() || 
         qualifiedName_.getQualifiedNameObj().isHistogramIntervals())
-    {
-      setIsHistogramTable(TRUE);
-    }
+      {
+        setIsHistogramTable(TRUE);
+      }
   
-   insertMode_ = table_desc->tableDesc()->insertMode();
+    insertMode_ = table_desc->tableDesc()->insertMode();
  
-   setRecordLength(table_desc->tableDesc()->record_length);
-   //
-   // Add timestamp information.
-   //
-   createTime_ = table_desc->tableDesc()->createTime;
-   redefTime_  = table_desc->tableDesc()->redefTime;
-   cacheTime_  = table_desc->tableDesc()->cacheTime;
+    setRecordLength(table_desc->tableDesc()->record_length);
+    //
+    // Add timestamp information.
+    //
+    createTime_ = table_desc->tableDesc()->createTime;
+    redefTime_  = table_desc->tableDesc()->redefTime;
+    cacheTime_  = table_desc->tableDesc()->cacheTime;
  
-   catalogUID_ = table_desc->tableDesc()->catUID;
-   schemaUID_ = table_desc->tableDesc()->schemaUID;
-   objectUID_ = table_desc->tableDesc()->objectUID;
+    catalogUID_ = table_desc->tableDesc()->catUID;
+    schemaUID_ = table_desc->tableDesc()->schemaUID;
+    objectUID_ = table_desc->tableDesc()->objectUID;
  
-   // Set the objectUID_ for hbase Cell and Row tables, if the table has
-   // been defined in Trafodion use this value, otherwise, set to 0
-   if (isHbaseCell_ || isHbaseRow_)
-     {
-       if ( !fetchObjectUIDForNativeTable(corrName) )
-         return;
+    // Set the objectUID_ for hbase Cell and Row tables, if the table has
+    // been defined in Trafodion use this value, otherwise, set to 0
+    if (isHbaseCell_ || isHbaseRow_)
+      {
+        if ( !fetchObjectUIDForNativeTable(corrName) )
+          return;
  
-       if (objectUID_ > 0 )
-         setHasExternalTable(TRUE);
-     }
+        if (objectUID_ > 0 )
+          setHasExternalTable(TRUE);
+      }
  
-   if (table_desc->tableDesc()->owner)
-     {
-       Int32 userInfo (table_desc->tableDesc()->owner);
-       owner_ = userInfo;
-     }
-   if (table_desc->tableDesc()->schemaOwner)
-     {
-       Int32 schemaUser(table_desc->tableDesc()->schemaOwner);
-       schemaOwner_ = schemaUser;
-     }
+    if (table_desc->tableDesc()->owner)
+      {
+        Int32 userInfo (table_desc->tableDesc()->owner);
+        owner_ = userInfo;
+      }
+    if (table_desc->tableDesc()->schemaOwner)
+      {
+        Int32 schemaUser(table_desc->tableDesc()->schemaOwner);
+        schemaOwner_ = schemaUser;
+      }
  
-   objectType_ = table_desc->tableDesc()->objectType();
-   partitioningScheme_ = table_desc->tableDesc()->partitioningScheme();
+    objectType_ = table_desc->tableDesc()->objectType();
+    partitioningScheme_ = table_desc->tableDesc()->partitioningScheme();
  
-   // Set up privs
-   if ((corrName.getSpecialType() == ExtendedQualName::SG_TABLE) ||
-       (!(corrName.isSeabaseMD() || corrName.isSpecialTable())))
+    // Set up privs
+    if ((corrName.getSpecialType() == ExtendedQualName::SG_TABLE) ||
+        (!(corrName.isSeabaseMD() || corrName.isSpecialTable())))
       getPrivileges(table_desc->tableDesc()->priv_desc);
  
-   if ((table_desc->tableDesc()->objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HIVE) != 0 ||
-       (table_desc->tableDesc()->objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HBASE) != 0)
-     setIsExternalTable(TRUE);
+    if ((table_desc->tableDesc()->objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HIVE) != 0 ||
+        (table_desc->tableDesc()->objectFlags & SEABASE_OBJECT_IS_EXTERNAL_HBASE) != 0)
+      {
+        setIsExternalTable(TRUE);
  
-   if (CmpSeabaseDDL::isMDflagsSet
-       (table_desc->tableDesc()->tablesFlags, MD_TABLES_HIVE_EXT_COL_ATTRS))
-     setHiveExtColAttrs(TRUE);
-   if (CmpSeabaseDDL::isMDflagsSet
-       (table_desc->tableDesc()->tablesFlags, MD_TABLES_HIVE_EXT_KEY_ATTRS))
-     setHiveExtKeyAttrs(TRUE);
+        if (table_desc->tableDesc()->objectFlags & SEABASE_OBJECT_IS_IMPLICIT_EXTERNAL_HIVE)   
+          setIsImplicitExternalTable(TRUE);
+      }
  
-   if (table_desc->tableDesc()->snapshotName)
-     {
-     snapshotName_ =
-         new(heap_) char[strlen(table_desc->tableDesc()->snapshotName) + 1];
-       strcpy(snapshotName_, table_desc->tableDesc()->snapshotName);
-     }
+    if (CmpSeabaseDDL::isMDflagsSet
+        (table_desc->tableDesc()->tablesFlags, MD_TABLES_HIVE_EXT_COL_ATTRS))
+      setHiveExtColAttrs(TRUE);
+    if (CmpSeabaseDDL::isMDflagsSet
+        (table_desc->tableDesc()->tablesFlags, MD_TABLES_HIVE_EXT_KEY_ATTRS))
+      setHiveExtKeyAttrs(TRUE);
  
-   if (table_desc->tableDesc()->default_col_fam)
-     defaultColFam_ = table_desc->tableDesc()->default_col_fam;
+    if (table_desc->tableDesc()->snapshotName)
+      {
+        snapshotName_ =
+          new(heap_) char[strlen(table_desc->tableDesc()->snapshotName) + 1];
+        strcpy(snapshotName_, table_desc->tableDesc()->snapshotName);
+      }
  
-   if (table_desc->tableDesc()->all_col_fams)
-     {
-       // Space delimited col families.
+    if (table_desc->tableDesc()->default_col_fam)
+      defaultColFam_ = table_desc->tableDesc()->default_col_fam;
  
- 	    string buf; // Have a buffer string
- 	    stringstream ss(table_desc->tableDesc()->all_col_fams); // Insert the string into a stream
+    if (table_desc->tableDesc()->all_col_fams)
+      {
+        // Space delimited col families.
  
- 	    while (ss >> buf)
- 	    {
- 		    allColFams_.insert(buf.c_str());
- 	    }
-     }
-   else
- 	  allColFams_.insert(defaultColFam_);
+        string buf; // Have a buffer string
+        stringstream ss(table_desc->tableDesc()->all_col_fams); // Insert the string into a stream
  
-   TrafDesc * files_desc = table_desc->tableDesc()->files_desc;
+        while (ss >> buf)
+          {
+            allColFams_.insert(buf.c_str());
+          }
+      }
+    else
+      allColFams_.insert(defaultColFam_);
  
-   // Some objects don't have a file_desc set up (e.g. views)
-   // Therefore, only setup the partnsDesc_ if this is a partitionable object
-   if (files_desc)
-   {
- 	  if (files_desc->filesDesc()->partns_desc)
- 		  partnsDesc_ = files_desc->filesDesc()->partns_desc;
-   }
-   else
- 	  partnsDesc_ = NULL;
+    TrafDesc * files_desc = table_desc->tableDesc()->files_desc;
  
-   //
-   // Insert a NAColumn in the colArray_ for this NATable for each
-   // columns_desc from the ARK SMD. Returns TRUE if error creating NAColumns.
-   //
-   if (createNAColumns(table_desc->tableDesc()->columns_desc,
- 			  this,
- 			  colArray_ /*OUT*/,
- 			  heap_))
- 	  //coverity[leaked_storage]
- 	  return; // colcount_ == 0 indicates an error
- 
-   //
-   // Add view information, if this is a view
-   //
-   TrafDesc *view_desc = table_desc->tableDesc()->views_desc;
-   if (view_desc)
-   {
- 	  viewText_ = new (heap_) char[strlen(view_desc->viewDesc()->viewtext) + 2];
- 	  strcpy(viewText_, view_desc->viewDesc()->viewtext);
- 	  strcat(viewText_, ";");
- 
- 	  viewTextCharSet_ = (CharInfo::CharSet)view_desc->viewDesc()->viewtextcharset;
- 
- 	  viewCheck_    = NULL; //initialize
- 	  if(view_desc->viewDesc()->viewchecktext){
- 		  UInt32 viewCheckLength = str_len(view_desc->viewDesc()->viewchecktext)+1;
- 		  viewCheck_ = new (heap_) char[ viewCheckLength];
- 		  memcpy(viewCheck_, view_desc->viewDesc()->viewchecktext,
- 				  viewCheckLength);
- 	  }
+    // Some objects don't have a file_desc set up (e.g. views)
+    // Therefore, only setup the partnsDesc_ if this is a partitionable object
+    if (files_desc)
+      {
+        if (files_desc->filesDesc()->partns_desc)
+          partnsDesc_ = files_desc->filesDesc()->partns_desc;
+      }
+    else
+      partnsDesc_ = NULL;
  
- 	  viewColUsages_ = NULL;
- 	  if(view_desc->viewDesc()->viewcolusages){
- 		  viewColUsages_ = new (heap_) NAList<ComViewColUsage *>(heap_); //initialize empty list
- 		  char * beginStr (view_desc->viewDesc()->viewcolusages);
- 		  char * endStr = strchr(beginStr, ';');
- 		  while (endStr != NULL) {
- 			  ComViewColUsage *colUsage = new (heap_) ComViewColUsage;
- 			  NAString currentUsage(beginStr, endStr - beginStr + 1); 
- 			  colUsage->unpackUsage (currentUsage.data());
- 			  viewColUsages_->insert(colUsage);
- 			  beginStr = endStr+1;
- 			  endStr = strchr(beginStr, ';');
- 		  }
- 	  }
- 	  setUpdatable(view_desc->viewDesc()->isUpdatable());
- 	  setInsertable(view_desc->viewDesc()->isInsertable());
+    //
+    // Insert a NAColumn in the colArray_ for this NATable for each
+    // columns_desc from the ARK SMD. Returns TRUE if error creating NAColumns.
+    //
+    if (createNAColumns(table_desc->tableDesc()->columns_desc,
+                        this,
+                        colArray_ /*OUT*/,
+                        heap_))
+      //coverity[leaked_storage]
+      return; // colcount_ == 0 indicates an error
  
- 	  //
- 	  // 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.
- 	  //
+    //
+    // Add view information, if this is a view
+    //
+    TrafDesc *view_desc = table_desc->tableDesc()->views_desc;
+    if (view_desc)
+      {
+        viewText_ = new (heap_) char[strlen(view_desc->viewDesc()->viewtext) + 2];
+        strcpy(viewText_, view_desc->viewDesc()->viewtext);
+        strcat(viewText_, ";");
+ 
+        viewTextCharSet_ = (CharInfo::CharSet)view_desc->viewDesc()->viewtextcharset;
+ 
+        viewCheck_    = NULL; //initialize
+        if(view_desc->viewDesc()->viewchecktext){
+          UInt32 viewCheckLength = str_len(view_desc->viewDesc()->viewchecktext)+1;
+          viewCheck_ = new (heap_) char[ viewCheckLength];
+          memcpy(viewCheck_, view_desc->viewDesc()->viewchecktext,
+                 viewCheckLength);
+        }
  
- 	  viewFileName_ = NULL;
- 	  CMPASSERT(view_desc->viewDesc()->viewfilename);
- 	  UInt32 viewFileNameLength = str_len(view_desc->viewDesc()->viewfilename) + 1;
- 	  viewFileName_ = new (heap_) char[viewFileNameLength];
- 	  memcpy(viewFileName_, view_desc->viewDesc()->viewfilename,
- 			  viewFileNameLength);
-   }
-   else
-   {
- 	  //keep track of memory used by NAFileSets
- 	  Lng32 preCreateNAFileSetsMemSize = heap_->getAllocSize();
+        viewColUsages_ = NULL;
+        if(view_desc->viewDesc()->viewcolusages){
+          viewColUsages_ = new (heap_) NAList<ComViewColUsage *>(heap_); //initialize empty list
+          char * beginStr (view_desc->viewDesc()->viewcolusages);
+          char * endStr = strchr(beginStr, ';');
+          while (endStr != NULL) {
+            ComViewColUsage *colUsage = new (heap_) ComViewColUsage;
+            NAString currentUsage(beginStr, endStr - beginStr + 1); 
+            colUsage->unpackUsage (currentUsage.data());
+            viewColUsages_->insert(colUsage);
+            beginStr = endStr+1;
+            endStr = strchr(beginStr, ';');
+          }
+        }
+        setUpdatable(view_desc->viewDesc()->isUpdatable());
+        setInsertable(view_desc->viewDesc()->isInsertable());
  
- 	  //
- 	  // Process indexes and vertical partitions for this table.
- 	  //
- 	  if (createNAFileSets(table_desc       /*IN*/,
- 				  this             /*IN*/,
- 				  colArray_        /*IN*/,
- 				  indexes_         /*OUT*/,
- 				  vertParts_       /*OUT*/,
- 				  clusteringIndex_ /*OUT*/,
- 				  tableIdList_     /*OUT*/,
- 				  heap_,
- 				  bindWA,
- 				  newColumns_,     /*OUT*/
- 				  maxIndexLevelsPtr)) {
- 		  return; // colcount_ == 0 indicates an error
- 	  }
+        //
+        // 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.
+        //
  
- 	  // Add constraint info.
- 	  //
- 	  // This call to createConstraintInfo, calls the parser on
- 	  // the constraint name
- 	  //
+        viewFileName_ = NULL;
+        CMPASSERT(view_desc->viewDesc()->viewfilename);
+        UInt32 viewFileNameLength = str_len(view_desc->viewDesc()->viewfilename) + 1;
+        viewFileName_ = new (heap_) char[viewFileNameLength];
+        memcpy(viewFileName_, view_desc->viewDesc()->viewfilename,
+               viewFileNameLength);
+      }
+    else
+      {
+        //keep track of memory used by NAFileSets
+        Lng32 preCreateNAFileSetsMemSize = heap_->getAllocSize();
  
- 	  NABoolean  errorOccurred =
- 		  createConstraintInfo(table_desc        /*IN*/,
- 				  getTableName()    /*IN*/,
- 				  getNAColumnArray()/*IN (some columns updated)*/,
- 				  checkConstraints_ /*OUT*/,
- 				  uniqueConstraints_/*OUT*/,
- 				  refConstraints_   /*OUT*/,
- 				  heap_,
- 				  bindWA);
- 
- 	  if (errorOccurred) {
- 		  // return before setting colcount_, indicating that there
- 		  // was an error in constructing this NATable.
- 		  //
- 		  return;
- 	  }
+        //
+        // Process indexes and vertical partitions for this table.
+        //
+        if (createNAFileSets(table_desc       /*IN*/,
+                             this             /*IN*/,
+                             colArray_        /*IN*/,
+                             indexes_         /*OUT*/,
+                             vertParts_       /*OUT*/,
+                             clusteringIndex_ /*OUT*/,
+                             tableIdList_     /*OUT*/,
+                             heap_,
+                             bindWA,
+                             newColumns_,     /*OUT*/
+                             maxIndexLevelsPtr)) {
+          return; // colcount_ == 0 indicates an error
+        }
  
- 	  //
- 	  // FetchHistograms call used to be here -- moved to getStatistics().
- 	  //
-   }
+        // Add constraint info.
+        //
+        // This call to createConstraintInfo, calls the parser on
+        // the constraint name
+        //
  
-   // change partFunc for base table if PARTITION clause has been used
-   // to limit the number of partitions that will be accessed.
-   if ((qualifiedName_.isPartitionNameSpecified()) ||
- 		  (qualifiedName_.isPartitionRangeSpecified())) {
- 	  if (filterUnusedPartitions(corrName.getPartnClause())) {
- 		  return ;
- 	  }
-   }
+        NABoolean  errorOccurred =
+          createConstraintInfo(table_desc        /*IN*/,
+                               getTableName()    /*IN*/,
+                               getNAColumnArray()/*IN (some columns updated)*/,
+                               checkConstraints_ /*OUT*/,
+                               uniqueConstraints_/*OUT*/,
+                               refConstraints_   /*OUT*/,
+                               heap_,
+                               bindWA);
+ 
+        if (errorOccurred) {
+          // return before setting colcount_, indicating that there
+          // was an error in constructing this NATable.
+          //
+          return;
+        }
  
-   //
-   // Set colcount_ after all possible errors (Binder uses nonzero colcount
-   // as an indicator of valid table definition).
-   //
-   CMPASSERT(table_desc->tableDesc()->colcount >= 0);   // CollIndex cast ok?
-   colcount_ = (CollIndex)table_desc->tableDesc()->colcount;
+        //
+        // FetchHistograms call used to be here -- moved to getStatistics().
+        //
+      }
  
-   // If there is a host variable associated with this table, store it
-   // for use by the generator to generate late-name resolution information.
-   //
-   HostVar *hv = corrName.getPrototype();
-   prototype_ = hv ? new (heap_) HostVar(*hv) : NULL;
+    // change partFunc for base table if PARTITION clause has been used
+    // to limit the number of partitions that will be accessed.
+    if ((qualifiedName_.isPartitionNameSpecified()) ||
+        (qualifiedName_.isPartitionRangeSpecified())) {
+      if (filterUnusedPartitions(corrName.getPartnClause())) {
+        return ;
+      }
+    }
  
-   // MV
-   // Initialize the MV support data members
-   isAnMV_           = table_desc->tableDesc()->isMVTable();
-   isAnMVMetaData_   = table_desc->tableDesc()->isMVMetadataObject();
-   mvAttributeBitmap_.initBitmap(table_desc->tableDesc()->mvAttributesBitmap);
+    //
+    // Set colcount_ after all possible errors (Binder uses nonzero colcount
+    // as an indicator of valid table definition).
+    //
+    CMPASSERT(table_desc->tableDesc()->colcount >= 0);   // CollIndex cast ok?
+    colcount_ = (CollIndex)table_desc->tableDesc()->colcount;
  
-   TrafDesc *mvs_desc = NULL; // using mvs not set or returned for traf tables
-   // Memory Leak
-   while (mvs_desc)
-   {
- 	  TrafUsingMvDesc* mv = mvs_desc->usingMvDesc();
+    // If there is a host variable associated with this table, store it
+    // for use by the generator to generate late-name resolution information.
+    //
+    HostVar *hv = corrName.getPrototype();
+    prototype_ = hv ? new (heap_) HostVar(*hv) : NULL;
+ 
+    // MV
+    // Initialize the MV support data members
+    isAnMV_           = table_desc->tableDesc()->isMVTable();
+    isAnMVMetaData_   = table_desc->tableDesc()->isMVMetadataObject();
+    mvAttributeBitmap_.initBitmap(table_desc->tableDesc()->mvAttributesBitmap);
+ 
+    TrafDesc *mvs_desc = NULL; // using mvs not set or returned for traf tables
+    // Memory Leak
+    while (mvs_desc)
+      {
+        TrafUsingMvDesc* mv = mvs_desc->usingMvDesc();
  
- 	  UsingMvInfo *usingMv = new(heap_)
- 		  UsingMvInfo(mv->mvName, mv->refreshType(), mv->rewriteEnabled,
- 				  mv->isInitialized, heap_);
- 	  mvsUsingMe_.insert(usingMv);
+        UsingMvInfo *usingMv = new(heap_)
+          UsingMvInfo(mv->mvName, mv->refreshType(), mv->rewriteEnabled,
+                      mv->isInitialized, heap_);
+        mvsUsingMe_.insert(usingMv);
  
- 	  mvs_desc = mvs_desc->next;
-   }
+        mvs_desc = mvs_desc->next;
+      }
  
-   // ++MV
+    // ++MV
  
-   // fix the special-type for MV objects. There are case where the type is
-   // set to NORMAL_TABLE although this is an MV.
-   //
-   // Example:
-   // --------
-   // in the statement "select * from MV1" mv1 will have a NORMAL_TABLE
-   // special-type, while in "select * from table(mv_table MV1)" it will
-   // have the MV_TABLE special-type.
+    // fix the special-type for MV objects. There are case where the type is
+    // set to NORMAL_TABLE although this is an MV.
+    //
+    // Example:
+    // --------
+    // in the statement "select * from MV1" mv1 will have a NORMAL_TABLE
+    // special-type, while in "select * from table(mv_table MV1)" it will
+    // have the MV_TABLE special-type.
  
-   if (isAnMV_)
-   {
- 	  switch(qualifiedName_.getSpecialType())
- 	  {
- 		  case ExtendedQualName::GHOST_TABLE:
- 			  qualifiedName_.setSpecialType(ExtendedQualName::GHOST_MV_TABLE);
- 			  break;
- 		  case ExtendedQualName::GHOST_MV_TABLE:
- 			  // Do not change it
- 			  break;
- 		  default:
- 			  qualifiedName_.setSpecialType(ExtendedQualName::MV_TABLE);
- 			  break;
- 	  }
-   }
+    if (isAnMV_)
+      {
+        switch(qualifiedName_.getSpecialType())
+          {
+          case ExtendedQualName::GHOST_TABLE:
+            qualifiedName_.setSpecialType(ExtendedQualName::GHOST_MV_TABLE);
+            break;
+          case ExtendedQualName::GHOST_MV_TABLE:
+            // Do not change it
+            break;
+          default:
+            qualifiedName_.setSpecialType(ExtendedQualName::MV_TABLE);
+            break;
+          }
+      }
  
-   // --MV
+    // --MV
  
-   // Initialize the sequence generator fields
-   TrafDesc *sequence_desc = table_desc->tableDesc()->sequence_generator_desc;
-   if (sequence_desc != NULL) {
- 	  TrafSequenceGeneratorDesc *sg_desc = sequence_desc->sequenceGeneratorDesc();
+    // Initialize the sequence generator fields
+    TrafDesc *sequence_desc = table_desc->tableDesc()->sequence_generator_desc;
+    if (sequence_desc != NULL) {
+      TrafSequenceGeneratorDesc *sg_desc = sequence_desc->sequenceGeneratorDesc();
  
- 	  if (sg_desc != NULL)
- 	  {
- 		  sgAttributes_ = 
- 			  new(heap_) SequenceGeneratorAttributes(
- 					  sg_desc->startValue,
- 					  sg_desc->increment,
- 					  sg_desc->maxValue,
- 					  sg_desc->minValue,
- 					  sg_desc->sgType(),
- 					  (ComSQLDataType)sg_desc->sqlDataType,
- 					  (ComFSDataType)sg_desc->fsDataType,
- 					  sg_desc->cycleOption,
- 					  FALSE,
- 					  sg_desc->objectUID,
- 					  sg_desc->cache,
- 					  sg_desc->nextValue,
- 					  0,
- 					  sg_desc->redefTime);
- 	  }
-   }
+      if (sg_desc != NULL)
+        {
+          sgAttributes_ = 
+            new(heap_) SequenceGeneratorAttributes(
+                 sg_desc->startValue,
+                 sg_desc->increment,
+                 sg_desc->maxValue,
+                 sg_desc->minValue,
+                 sg_desc->sgType(),
+                 (ComSQLDataType)sg_desc->sqlDataType,
+                 (ComFSDataType)sg_desc->fsDataType,
+                 sg_desc->cycleOption,
+                 FALSE,
+                 sg_desc->objectUID,
+                 sg_desc->cache,
+                 sg_desc->nextValue,
+                 0,
+                 sg_desc->redefTime);
+        }
+    }
  #ifndef NDEBUG
-   if (getenv("NATABLE_DEBUG"))
-   {
- 	  cout << "NATable " << (void*)this << " "
- 		  << qualifiedName_.getQualifiedNameObj().getQualifiedNameAsAnsiString() << " "
- 		  << (Int32)qualifiedName_.getSpecialType() << endl;
- 	  colArray_.print();
-   }
+    if (getenv("NATABLE_DEBUG"))
+      {
+        cout << "NATable " << (void*)this << " "
+             << qualifiedName_.getQualifiedNameObj().getQualifiedNameAsAnsiString() << " "
+             << (Int32)qualifiedName_.getSpecialType() << endl;
+        colArray_.print();
+      }
  #endif
-   //this guy is cacheable
-   if((qualifiedName_.isCacheable())&&
- 		  (NOT (isHbaseTable())) && 
- 		  //this object is not on the statement heap (i.e. it is being cached)
- 		  ((heap_ != CmpCommon::statementHeap())||
- 		   (OSIM_runningInCaptureMode())))
-   {
- 	  char * nodeName = NULL;
- 	  char * catStr = NULL;
- 	  char * schemaStr = NULL;
- 	  char * fileStr = NULL;
- 	  short nodeNameLen = 0;
- 	  Int32 catStrLen = 0;
- 	  Int32 schemaStrLen = 0;
- 	  Int32 fileStrLen = 0;
+    //this guy is cacheable
+    if((qualifiedName_.isCacheable())&&
+       (NOT (isHbaseTable())) && 
+       //this object is not on the statement heap (i.e. it is being cached)
+       ((heap_ != CmpCommon::statementHeap())||
+        (OSIM_runningInCaptureMode())))
+      {
+        char * nodeName = NULL;
+        char * catStr = NULL;
+        char * schemaStr = NULL;
+        char * fileStr = NULL;
+        short nodeNameLen = 0;
+        Int32 catStrLen = 0;
+        Int32 schemaStrLen = 0;
+        Int32 fileStrLen = 0;
  #ifdef NA_64BIT
- 	  // dg64 - match signature
- 	  int_32 primaryNodeNum=0;
+        // dg64 - match signature
+        int_32 primaryNodeNum=0;
  #else
- 	  Int32 primaryNodeNum=0;
+        Int32 primaryNodeNum=0;
  #endif
- 	  short error = 0;
+        short error = 0;
  
- 	  //clusteringIndex has physical filename that can be used to check
- 	  //if a catalog operation has been performed on a table.
- 	  //Views don't have clusteringIndex, so we get physical filename
- 	  //from the viewFileName_ datamember.
- 	  if(viewText_)
- 	  {
- 		  //view filename starts with node name
- 		  //filename is in format \<node_name>.$<volume>.<subvolume>.<file>
- 		  //catStr => <volume>
- 		  //schemaStr => <subvolume>
- 		  //fileStr => <file>
- 		  nodeName = viewFileName_;
- 		  catStr = nodeName;
- 
- 		  //skip over node name
- 		  //measure node name length
- 		  //get to begining of volume name
- 		  //Measure length of node name
- 		  //skip over node name i.e. \MAYA, \AZTEC, etc
- 		  //and get to volume name
- 		  while((nodeName[nodeNameLen]!='.')&&
- 				  (nodeNameLen < 8)){
- 			  catStr++;
- 			  nodeNameLen++;
- 		  };
- 
- 		  //skip over '.' and the '$' in volume name
- 		  catStr=&nodeName[nodeNameLen+2];
- 		  schemaStr=catStr;
- 
- 		  //skip over the volume/catalog name
- 		  //while measuring catalog name length
- 		  while((catStr[catStrLen]!='.')&&
- 				  (catStrLen < 8))
- 		  {
- 			  schemaStr++;
- 			  catStrLen++;
- 		  }
- 
- 		  //skip over the '.'
- 		  schemaStr++;
- 		  fileStr=schemaStr;
- 
- 		  //skip over the subvolume/schema name
- 		  //while measuring schema name length
- 		  while((schemaStr[schemaStrLen]!='.')&&
- 				  (schemaStrLen < 8))
- 		  {
- 			  fileStr++;
- 			  schemaStrLen++;
- 		  }
- 
- 		  //skip over the '.'
- 		  fileStr++;
- 		  fileStrLen = str_len(fileStr);
- 
- 		  //figure out the node number for the node
- 		  //which has the primary partition.
- 		  primaryNodeNum=0;
- 
- 		  if(!OSIM_runningSimulation())        
- 			  primaryNodeNum = gpClusterInfo->mapNodeNameToNodeNum(NAString(nodeName));
- 	  }
- 	  else{
- 		  //get qualified name of the clustering index which should
- 		  //be the actual physical file name of the table
- 		  const QualifiedName fileNameObj = getClusteringIndex()->
- 			  getRandomPartition();
- 		  const NAString fileName = fileNameObj.getObjectName();
- 
- 		  //get schemaName object
- 		  const SchemaName schemaNameObj = fileNameObj.getSchemaName();
- 		  const NAString schemaName = schemaNameObj.getSchemaName();
- 
- 		  //get catalogName object
- 		  //this contains a string in the form \<node_name>.$volume
- 		  const CatalogName catalogNameObj = fileNameObj.getCatalogName();
- 		  const NAString catalogName = catalogNameObj.getCatalogName();
- 		  nodeName = (char*) catalogName.data();
- 		  catStr = nodeName;
- 
- 		  //Measure length of node name
- 		  //skip over node name i.e. \MAYA, \AZTEC, etc
- 		  //and get to volume name
- 		  while((nodeName[nodeNameLen]!='.')&&
- 				  (nodeNameLen < 8)){
- 			  catStr++;
- 			  nodeNameLen++;
- 		  };
- 
- 		  //get volume/catalog name
- 		  //skip ".$"
- 		  catStr=&nodeName[nodeNameLen+2];
+        //clusteringIndex has physical filename that can be used to check
+        //if a catalog operation has been performed on a table.
+        //Views don't have clusteringIndex, so we get physical filename
+        //from the viewFileName_ datamember.
+        if(viewText_)
+          {
+            //view filename starts with node name
+            //filename is in format \<node_name>.$<volume>.<subvolume>.<file>
+            //catStr => <volume>
+            //schemaStr => <subvolume>
+            //fileStr => <file>
+            nodeName = viewFileName_;
+            catStr = nodeName;
+ 
+            //skip over node name
+            //measure node name length
+            //get to begining of volume name
+            //Measure length of node name
+            //skip over node name i.e. \MAYA, \AZTEC, etc
+            //and get to volume name
+            while((nodeName[nodeNameLen]!='.')&&
+                  (nodeNameLen < 8)){
+              catStr++;
+              nodeNameLen++;
+            };
+ 
+            //skip over '.' and the '$' in volume name
+            catStr=&nodeName[nodeNameLen+2];
+            schemaStr=catStr;
+ 
+            //skip over the volume/catalog name
+            //while measuring catalog name length
+            while((catStr[catStrLen]!='.')&&
+                  (catStrLen < 8))
+              {
+                schemaStr++;
+                catStrLen++;
+              }
+ 
+            //skip over the '.'
+            schemaStr++;
+            fileStr=schemaStr;
+ 
+            //skip over the subvolume/schema name
+            //while measuring schema name length
+            while((schemaStr[schemaStrLen]!='.')&&
+                  (schemaStrLen < 8))
+              {
+                fileStr++;
+                schemaStrLen++;
+              }
+ 
+            //skip over the '.'
+            fileStr++;
+            fileStrLen = str_len(fileStr);
+ 
+            //figure out the node number for the node
+            //which has the primary partition.
+            primaryNodeNum=0;
+ 
+            if(!OSIM_runningSimulation())        
+              primaryNodeNum = gpClusterInfo->mapNodeNameToNodeNum(NAString(nodeName));
+          }
+        else{
+          //get qualified name of the clustering index which should
+          //be the actual physical file name of the table
+          const QualifiedName fileNameObj = getClusteringIndex()->
+            getRandomPartition();
+          const NAString fileName = fileNameObj.getObjectName();
+ 
+          //get schemaName object
+          const SchemaName schemaNameObj = fileNameObj.getSchemaName();
+          const NAString schemaName = schemaNameObj.getSchemaName();
+ 
+          //get catalogName object
+          //this contains a string in the form \<node_name>.$volume
+          const CatalogName catalogNameObj = fileNameObj.getCatalogName();
+          const NAString catalogName = catalogNameObj.getCatalogName();
+          nodeName = (char*) catalogName.data();
+          catStr = nodeName;
+ 
+          //Measure length of node name
+          //skip over node name i.e. \MAYA, \AZTEC, etc
+          //and get to volume name
+          while((nodeName[nodeNameLen]!='.')&&
+                (nodeNameLen < 8)){
+            catStr++;
+            nodeNameLen++;
+          };
+ 
+          //get volume/catalog name
+          //skip ".$"
+          catStr=&nodeName[nodeNameLen+2];
  #pragma nowarn(1506)   // warning elimination
- 		  catStrLen = catalogName.length() - (nodeNameLen+2);
+          catStrLen = catalogName.length() - (nodeNameLen+2);
  #pragma warn(1506)  // warning elimination
  
- 		  //get subvolume/schema name
- 		  schemaStr = (char *) schemaName.data();
+          //get subvolume/schema name
+          schemaStr = (char *) schemaName.data();
  #pragma nowarn(1506)   // warning elimination
- 		  schemaStrLen = schemaName.length();
+          schemaStrLen = schemaName.length();
  #pragma warn(1506)  // warning elimination
  
- 		  //get file name
- 		  fileStr = (char *) fileName.data();
+          //get file name
+          fileStr = (char *) fileName.data();
  #pragma nowarn(1506)   // warning elimination
- 		  fileStrLen = fileName.length();
+          fileStrLen = fileName.length();
  #pragma warn(1506)  // warning elimination
  
- 		  //figure out the node number for the node
- 		  //which has the primary partition.
- 		  primaryNodeNum=0;
+          //figure out the node number for the node
+          //which has the primary partition.
+          primaryNodeNum=0;
  
- 		  primaryNodeNum = gpClusterInfo->mapNodeNameToNodeNum(NAString(nodeName));
+          primaryNodeNum = gpClusterInfo->mapNodeNameToNodeNum(NAString(nodeName));
  
- 	  }
-   }
+        }
+      }
  
-   Lng32 postCreateNATableWarnings = CmpCommon::diags()->getNumber(DgSqlCode::WARNING_);
+    Lng32 postCreateNATableWarnings = CmpCommon::diags()->getNumber(DgSqlCode::WARNING_);
  
-   if(postCreateNATableWarnings != preCreateNATableWarnings)
- 	  tableConstructionHadWarnings_=TRUE;
-   char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
-   memset(lobHdfsServer,0,256);
-   strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), sizeof(lobHdfsServer));
-   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
-   if (hasLobColumn())
-   {
-     // read lob related information from lob metadata
-     //     setFromStoredDesc(TRUE);
-     
- 	    short *lobNumList = new (heap_) short[getColumnCount()];
- 	    short *lobTypList = new (heap_) short[getColumnCount()];
- 	    char  **lobLocList = new (heap_) char*[getColumnCount()];
-             char  **lobColNameList = new (heap_) char*[getColumnCount()];
- 	    const NAColumnArray &colArray = getNAColumnArray();
- 	    NAColumn *nac = NULL;
- 
- 	    Lng32 j = 0;
- 	    for (CollIndex i = 0; i < getColumnCount(); i++)
- 	    {
- 		    nac = colArray.getColumn(i);
- 
- 		    if (nac->getType()->getTypeQualifier() == NA_LOB_TYPE)
- 		    {
- 			    lobLocList[j] = new (heap_) char[1024];
-                             lobColNameList[j] = new (heap_)char[256];
- 			    j++;
- 		    }
- 	    }      
- 
- 	    NAString schNam;
- 	    schNam = "\"";
- 	    schNam += getTableName().getCatalogName();
- 	    schNam += "\".\"";
- 	    schNam += getTableName().getSchemaName();
- 	    schNam += "\"";
- 
- 	    Lng32 numLobs = 0;
- 	    Lng32 cliRC = SQL_EXEC_LOBddlInterface
- 		    (
- 		     (char*)schNam.data(),
- 		     schNam.length(),
- 		     objectUid().castToInt64(),
- 		     numLobs,
- 		     LOB_CLI_SELECT_CURSOR,
- 		     lobNumList,
- 		     lobTypList,
- 		     lobLocList,lobColNameList,(char *)lobHdfsServer,lobHdfsPort,0,FALSE);
- 
- 	    if (cliRC == 0)
- 	    {
- 		    for (Lng32 i = 0; i < numLobs; i++)
- 		    {
- 			    nac = colArray.getColumn(lobNumList[i]);
 +
- 			    nac->lobNum() = lobNumList[i];
- 			    nac->lobStorageType() = (LobsStorage)lobTypList[i];
- 			    nac->lobStorageLocation() = lobLocList[i];
- 		    }
- 	    } // if
-     } // if
+    if(postCreateNATableWarnings != preCreateNATableWarnings)
+      tableConstructionHadWarnings_=TRUE;
 -   const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
++   char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
++   memset(lobHdfsServer,0,256);
++   strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), sizeof(lobHdfsServer));
++   
+    Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
+    if (hasLobColumn())
+      {
+        // read lob related information from lob metadata
+        //     setFromStoredDesc(TRUE);
+        //
+        short *lobNumList = new (heap_) short[getColumnCount()];
+        short *lobTypList = new (heap_) short[getColumnCount()];
+        char  **lobLocList = new (heap_) char*[getColumnCount()];
+        char  **lobColNameList = new (heap_) char*[getColumnCount()];
+        const NAColumnArray &colArray = getNAColumnArray();
+        NAColumn *nac = NULL;
+ 
+        Lng32 j = 0;
+        for (CollIndex i = 0; i < getColumnCount(); i++)
+          {
+            nac = colArray.getColumn(i);
  
-   // LCOV_EXCL_STOP
-   initialSize_ = heap_->getAllocSize();
-   MonitorMemoryUsage_Exit((char*)mmPhase.data(), heap_, NULL, TRUE);
+            if (nac->getType()->getTypeQualifier() == NA_LOB_TYPE)
+              {
+                lobLocList[j] = new (heap_) char[1024];
+                lobColNameList[j] = new (heap_)char[256];
+                j++;
+              }
+          }      
+ 
+        NAString schNam;
+        schNam = "\"";
+        schNam += getTableName().getCatalogName();
+        schNam += "\".\"";
+        schNam += getTableName().getSchemaName();
+        schNam += "\"";
+ 
+        Lng32 numLobs = 0;
+        Lng32 cliRC = SQL_EXEC_LOBddlInterface
+          (
+               (char*)schNam.data(),
+               schNam.length(),
+               objectUid().castToInt64(),
+               numLobs,
+               LOB_CLI_SELECT_CURSOR,
+               lobNumList,
+               lobTypList,
+               lobLocList,lobColNameList,(char *)lobHdfsServer,lobHdfsPort,0,FALSE);
+ 
+        if (cliRC == 0)
+          {
+            for (Lng32 i = 0; i < numLobs; i++)
+              {
+                nac = colArray.getColumn(lobNumList[i]);
+ 
+                nac->lobNum() = lobNumList[i];
+                nac->lobStorageType() = (LobsStorage)lobTypList[i];
+                nac->lobStorageLocation() = lobLocList[i];
+              }
+          } // if
+      } // if
+ 
+    // LCOV_EXCL_STOP
+    initialSize_ = heap_->getAllocSize();
+    MonitorMemoryUsage_Exit((char*)mmPhase.data(), heap_, NULL, TRUE);
   } // NATable()
  #pragma warn(770)  // warning elimination
  

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8c2ccd73/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------



[4/5] incubator-trafodion git commit: review comment #2

Posted by sa...@apache.org.
review comment #2


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

Branch: refs/heads/master
Commit: 2aeb4d1d8cb805f609dc89d7a316955e436a5442
Parents: 8c2ccd7
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Feb 24 07:31:30 2017 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Feb 24 07:31:30 2017 +0000

----------------------------------------------------------------------
 core/sql/cli/Cli.cpp                    |  1 +
 core/sql/optimizer/NATable.cpp          |  4 ++--
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 11 +++++++----
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2aeb4d1d/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index 27c869e..bcefedf 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -10607,6 +10607,7 @@ Lng32 SQLCLI_LOBddlInterface
   lobDebugInfo(logBuf,0,__LINE__,lobTrace);
   char * query = new(currContext.exHeap()) char[4096];
   char *hdfsServer = new(currContext.exHeap()) char[256];
+  strcpy(hdfsServer,lobHdfsServer);
   switch (qType)
     {
     case LOB_CLI_CREATE:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2aeb4d1d/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index 35b9c84..496736a 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -5490,7 +5490,7 @@ NABoolean createNAFileSets(TrafDesc * table_desc       /*IN*/,
      tableConstructionHadWarnings_=TRUE;
    char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
    memset(lobHdfsServer,0,256);
-   strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), sizeof(lobHdfsServer));
+   strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER), sizeof(lobHdfsServer)-1);// leave a NULL terminator at the end. 
    
    Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
    if (hasLobColumn())
@@ -5535,7 +5535,7 @@ NABoolean createNAFileSets(TrafDesc * table_desc       /*IN*/,
               LOB_CLI_SELECT_CURSOR,
               lobNumList,
               lobTypList,
-              lobLocList,lobColNameList,(char *)lobHdfsServer,lobHdfsPort,0,FALSE);
+              lobLocList,lobColNameList,lobHdfsServer,lobHdfsPort,0,FALSE);
 
        if (cliRC == 0)
          {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2aeb4d1d/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index ba07e3b..a15b11c 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -2803,7 +2803,10 @@ short CmpSeabaseDDL::createSeabaseTable2(
     }
   
 
-  const char *lobHdfsServer = CmpCommon::getDefaultString(LOB_HDFS_SERVER);
+  
+  char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
+  memset(lobHdfsServer,0,256);
+  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER),sizeof(lobHdfsServer)-1);
   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
    
   if (j > 0)
@@ -2842,7 +2845,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
                                           lobTypList,
                                           lobLocList,
                                           lobColNameList,
-                                          (char *)lobHdfsServer,
+                                          lobHdfsServer,
                                           lobHdfsPort,
                                           lobMaxSize,
                                           lobTrace);
@@ -4278,7 +4281,7 @@ short CmpSeabaseDDL::dropSeabaseTable2(
 
   char  lobHdfsServer[256] ; // max length determined by dfs.namenode.fs-limits.max-component-length(255)
   memset(lobHdfsServer,0,256);
-  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER),sizeof(lobHdfsServer));
+  strncpy(lobHdfsServer,CmpCommon::getDefaultString(LOB_HDFS_SERVER),sizeof(lobHdfsServer)-1);
   Int32 lobHdfsPort = (Lng32)CmpCommon::getDefaultNumeric(LOB_HDFS_PORT);
   Lng32 j = 0;
   for (Int32 i = 0; i < nacolArr.entries(); i++)
@@ -4331,7 +4334,7 @@ short CmpSeabaseDDL::dropSeabaseTable2(
 					  LOB_CLI_DROP,
 					  lobNumList,
 					  lobTypList,
-                                    lobLocList,NULL,(char *)lobHdfsServer, lobHdfsPort,0,lobTrace);
+                                    lobLocList,NULL,lobHdfsServer, lobHdfsPort,0,lobTrace);
       if (rc < 0)
 	{
 	  *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_DROP_OBJECT)