trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/2] incubator-trafodion git commit: [TRAFODION-2819] Fix 4247 error on drop table when certain CQDs are present
Date Tue, 28 Nov 2017 17:13:08 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master d0644d45f -> 6d2213d04


[TRAFODION-2819] Fix 4247 error on drop table when certain CQDs are present


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

Branch: refs/heads/master
Commit: d96f3c7c136eab380acbd3f481ff1f738e16306d
Parents: d0644d4
Author: Dave Birdsall <dbirdsall@apache.org>
Authored: Mon Nov 27 21:35:35 2017 +0000
Committer: Dave Birdsall <dbirdsall@apache.org>
Committed: Mon Nov 27 21:35:35 2017 +0000

----------------------------------------------------------------------
 core/sql/optimizer/RelRoutine.cpp        | 1 +
 core/sql/sqlcomp/CmpSeabaseDDL.h         | 2 ++
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 9 ++++++++-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp  | 3 +++
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp   | 2 +-
 5 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d96f3c7c/core/sql/optimizer/RelRoutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelRoutine.cpp b/core/sql/optimizer/RelRoutine.cpp
index 336c3ab..da660ab 100644
--- a/core/sql/optimizer/RelRoutine.cpp
+++ b/core/sql/optimizer/RelRoutine.cpp
@@ -1667,6 +1667,7 @@ void ProxyFunc::populateColumnDesc(char *tableNam,
                       new(STMTHEAP) char[numCols * sizeof(ComTdbVirtTableColumnInfo)];
 
    cmpSBD.buildColInfoArray(COM_USER_DEFINED_ROUTINE_OBJECT,
+                            FALSE,
                             &colArray, 
                             colInfoArray, 
                             FALSE, FALSE, NULL, NULL, NULL, NULL,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d96f3c7c/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index a0e4e34..1f6295d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -342,6 +342,7 @@ class CmpSeabaseDDL
 
   short buildColInfoArray(
                           ComObjectType objType,
+                          NABoolean isMetadataHistOrReposObject,
 			  ElemDDLColDefArray * colArray,
 			  ComTdbVirtTableColumnInfo * colInfoArray,
 			  NABoolean implicitPK,
@@ -596,6 +597,7 @@ protected:
 		    ULng32 &colFlags);
 
   short getColInfo(ElemDDLColDef * colNode, 
+                   NABoolean isMetadataHistOrReposColumn,
                    NAString &colFamily,
 		   NAString &colName,
                    NABoolean alignedFormat,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d96f3c7c/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 70ae917..2490e59 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -572,6 +572,7 @@ short CmpSeabaseDDL::processDDLandCreateDescs(
       keyInfoArray = new(CTXTHEAP) ComTdbVirtTableKeyInfo[numKeys];
 
       if (buildColInfoArray(COM_BASE_TABLE_OBJECT,
+                            TRUE, // this is a metadata, histogram or repository object
                             &colArray, colInfoArray, FALSE, FALSE, NULL, NULL, NULL,
NULL, 
                             CTXTHEAP))
         {
@@ -3013,6 +3014,7 @@ short CmpSeabaseDDL::getNAColumnFromColDef
   LobsStorage lobStorage;
   NABoolean alignedFormat = FALSE;
   if (getColInfo(colNode,
+                 FALSE,
                  colFamily,
                  colName,
                  alignedFormat,
@@ -3058,6 +3060,7 @@ short CmpSeabaseDDL::getNAColumnFromColDef
 }
 
 short CmpSeabaseDDL::getColInfo(ElemDDLColDef * colNode, 
+                                NABoolean isMetadataHistOrReposColumn,
                                 NAString &colFamily,
                                 NAString &colName,
                                 NABoolean alignedFormat,
@@ -3126,7 +3129,8 @@ short CmpSeabaseDDL::getColInfo(ElemDDLColDef * colNode,
       return rc;
     }
 
-  if ((naType->getTypeQualifier() == NA_CHARACTER_TYPE) &&
+  if ((!isMetadataHistOrReposColumn) &&
+      (naType->getTypeQualifier() == NA_CHARACTER_TYPE) &&
       (naType->getNominalSize() > CmpCommon::getDefaultNumeric(TRAF_MAX_CHARACTER_COL_LENGTH)))
     {
       *CmpCommon::diags() << DgSqlCode(-4247)
@@ -5982,6 +5986,7 @@ short CmpSeabaseDDL::processColFamily(NAString &inColFamily,
 
 short CmpSeabaseDDL::buildColInfoArray(
                                        ComObjectType objType,
+                                       NABoolean isMetadataHistOrReposObject,
                                        ElemDDLColDefArray *colArray,
                                        ComTdbVirtTableColumnInfo * colInfoArray,
                                        NABoolean implicitPK,
@@ -6016,6 +6021,7 @@ short CmpSeabaseDDL::buildColInfoArray(
       Int64 colFlags;
       LobsStorage lobStorage;
       if (getColInfo(colNode,
+                     isMetadataHistOrReposObject,
                      colFamily,
                      colName,
                      alignedFormat,
@@ -6161,6 +6167,7 @@ short CmpSeabaseDDL::buildColInfoArray(
       Int64 colFlags;
       LobsStorage lobStorage;
       if (getColInfo(&colNode,
+                     FALSE,
                      colFamily,
                      colName,
                      FALSE,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d96f3c7c/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index fcc8df1..124ec1b 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -2330,6 +2330,7 @@ short CmpSeabaseDDL::createSeabaseTable2(
       keyInfoArray = new(STMTHEAP) ComTdbVirtTableKeyInfo[numKeys];
 
       if (buildColInfoArray(COM_BASE_TABLE_OBJECT,
+                            FALSE, // not a metadata, histogram or repository object
                             &colArray, colInfoArray, implicitPK,
                             alignedFormat, &identityColPos,
                             (hbaseMapFormat ? NULL : &userColFamVec), 
@@ -5472,6 +5473,7 @@ void CmpSeabaseDDL::alterSeabaseTableAddColumn(
     }
 
   retcode = getColInfo(pColDef,
+                       FALSE, // not a metadata, histogram or repository column 
                        colFamily,
                        colName, 
                        naTable->isSQLMXAlignedTable(),
@@ -6895,6 +6897,7 @@ short CmpSeabaseDDL::alignedFormatTableAlterColumnAttr
     goto label_restore;
 
   if (getColInfo(pColDef,
+                 FALSE, // not a metadata, histogram or repository column
                  colFamily,
                  colName, 
                  naTable->isSQLMXAlignedTable(),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d96f3c7c/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
index e2bf7a5..b0e04ee 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
@@ -932,7 +932,7 @@ void CmpSeabaseDDL::createSeabaseView(
   ComTdbVirtTableColumnInfo * colInfoArray = 
     new(STMTHEAP) ComTdbVirtTableColumnInfo[numCols];
 
-  if (buildColInfoArray(COM_VIEW_OBJECT, &colDefArray, colInfoArray, FALSE, FALSE))
+  if (buildColInfoArray(COM_VIEW_OBJECT, FALSE, &colDefArray, colInfoArray, FALSE, FALSE))
     {
       deallocEHI(ehi); 
       processReturn();


Mime
View raw message