trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sand...@apache.org
Subject [3/8] trafodion git commit: Fixees to support stroring Udr libraries s Blobs.
Date Tue, 06 Nov 2018 05:31:35 GMT
http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/regress/udr/TEST001
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/TEST001 b/core/sql/regress/udr/TEST001
index 395cee8..3c8e794 100644
--- a/core/sql/regress/udr/TEST001
+++ b/core/sql/regress/udr/TEST001
@@ -77,7 +77,8 @@ insert into clicks values
  ('super-services',cast(time'11:59:59.55 pm' as TIME(6)),'12.345.567.345');
 
 -- for now use VARCHARs for LOBs
---cqd TRAF_BLOB_AS_VARCHAR 'OFF'; 
+cqd TRAF_BLOB_AS_VARCHAR 'ON'; 
+cqd TRAF_CLOB_AS_VARCHAR 'ON';
 
 create table t001_Datatypes (
 c_char char(15),
@@ -203,7 +204,6 @@ create table_mapping function sessionize_java(user_colname char(10),
 external name 'TEST001_Sessionize'
 language java
 library TEST001_Java;
-
 -- negative test case, the entry point SESSIONIZE_ERR does not exist
 create table_mapping function sessionize_err(dummy char(10))
 returns (session_id largeint)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcat/TrafDDLdesc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcat/TrafDDLdesc.cpp b/core/sql/sqlcat/TrafDDLdesc.cpp
index e1d4597..f54a79e 100644
--- a/core/sql/sqlcat/TrafDDLdesc.cpp
+++ b/core/sql/sqlcat/TrafDDLdesc.cpp
@@ -590,7 +590,7 @@ Long TrafRoutineDesc::pack(void * space)
   librarySqlName = (librarySqlName ? (char*)(((Space*)space)->convertToOffset(librarySqlName))
: NULL);
   libraryFileName = (libraryFileName ? (char*)(((Space*)space)->convertToOffset(libraryFileName))
: NULL);
   signature = (signature ? (char*)(((Space*)space)->convertToOffset(signature)) : NULL);
-
+  libBlobHandle = (libBlobHandle ? (char*)(((Space*)space)->convertToOffset(libBlobHandle))
: NULL);
   params.pack(space);
 
   return TrafDesc::pack(space);
@@ -603,7 +603,7 @@ Lng32 TrafRoutineDesc::unpack(void * base, void * reallocator)
   librarySqlName = (librarySqlName ? (char*)((char*)base - (Long)librarySqlName) : NULL);
   libraryFileName = (libraryFileName ? (char*)((char*)base - (Long)libraryFileName) : NULL);
   signature = (signature ? (char*)((char*)base - (Long)signature) : NULL);
-
+  libBlobHandle = (libBlobHandle ? (char*)((char*)base - (Long)libBlobHandle) : NULL);
   if (params.unpack(base, reallocator)) return -1;
 
   return TrafDesc::unpack(base, reallocator);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcat/TrafDDLdesc.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcat/TrafDDLdesc.h b/core/sql/sqlcat/TrafDDLdesc.h
index 7065924..adf7419 100644
--- a/core/sql/sqlcat/TrafDDLdesc.h
+++ b/core/sql/sqlcat/TrafDDLdesc.h
@@ -881,7 +881,11 @@ public:
   DescStructPtr priv_desc;
 
   Int64 routineDescFlags; // my flags
-
+  Int64 libRedefTime; 
+  char *libBlobHandle;
+  char *libSchName;
+  Int32 libVersion;
+  Int64 libObjUID;
   char filler[24];
 };
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
index 8ecf17e..0e385e1 100644
--- a/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
+++ b/core/sql/sqlcomp/CmpDDLCatErrorCodes.h
@@ -69,7 +69,7 @@ enum CatErrorCode { CAT_FIRST_ERROR = 1000
                   , CAT_CATALOG_ALREADY_EXISTS                    = 1035
                   , CAT_CIRCULAR_PRIVS                            = 1036
                   , CAT_DEPENDENT_PRIV_EXISTS                     = 1037
-                  // unused                                       = 1038
+                  , CAT_UNABLE_TO_UPGRADE                         = 1037
                   , CAT_PRIVILEGE_NOT_REVOKED                     = 1039
                   , CAT_SMD_CANNOT_BE_ALTERED                     = 1040
                   , CAT_PRIMARY_KEY_ALREADY_DEFINED               = 1041

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index 22ee692..08ba746 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -412,7 +412,8 @@ class CmpSeabaseDDL
        Int64 & objectFlags,
        bool reportErrorNow = true,
        NABoolean checkForValidDef = FALSE,
-       Int64 * createTime = NULL);
+       Int64 * createTime = NULL,
+       Int64 * redefTime = NULL);
   
   short getObjectName(
        ExeCliInterface *cliInterface,
@@ -529,8 +530,9 @@ protected:
 		  NAString &colName);
 
   TrafDesc *getSeabaseRoutineDescInternal(const NAString &catName,
-                                             const NAString &schName,
-                                             const NAString &objName);
+                                          const NAString &schName,
+                                          const NAString &objName
+                                          );
 
   // note: this function expects hbaseCreateOptionsArray to have
   // HBASE_MAX_OPTIONS elements
@@ -1011,7 +1013,8 @@ protected:
      
   short createDefaultSystemSchema(ExeCliInterface * cliInterface);
   short createSchemaObjects(ExeCliInterface * cliInterface);
-  
+  short createLibrariesObject(ExeCliInterface * cliInterface);
+  short extractLibrary(ExeCliInterface *cliInterface,char *libHandle, char *cachedLibName);
   void  createSeabaseSchema(
      StmtDDLCreateSchema  * createSchemaNode,
      NAString             & currCatName);
@@ -1314,7 +1317,8 @@ protected:
 
   void createSeabaseLibrary(StmtDDLCreateLibrary  * createLibraryNode,
                             NAString &currCatName, NAString &currSchName);
-  
+  void createSeabaseLibrary2(StmtDDLCreateLibrary  * createLibraryNode,
+                            NAString &currCatName, NAString &currSchName);
   void registerSeabaseUser (
                             StmtDDLRegisterUser        * registerUserNode);
   void alterSeabaseUser (
@@ -1326,10 +1330,13 @@ protected:
 
   void dropSeabaseLibrary(StmtDDLDropLibrary  * dropLibraryNode,
                           NAString &currCatName, NAString &currSchName);
-
+  void dropSeabaseLibrary2(StmtDDLDropLibrary  * dropLibraryNode,
+                          NAString &currCatName, NAString &currSchName);
   void  alterSeabaseLibrary(StmtDDLAlterLibrary  *alterLibraryNode,
 			    NAString &currCatName, NAString &currSchName);
-
+  void  alterSeabaseLibrary2(StmtDDLAlterLibrary  *alterLibraryNode,
+			    NAString &currCatName, NAString &currSchName);
+  short isLibBlobStoreValid(ExeCliInterface * cliInterface);
   void createSeabaseRoutine(StmtDDLCreateRoutine  * createRoutineNode,
                             NAString &currCatName, NAString &currSchName);
   
@@ -1338,6 +1345,7 @@ protected:
 
   short createSeabaseLibmgr(ExeCliInterface * cliInterface);
   short upgradeSeabaseLibmgr(ExeCliInterface * inCliInterface);
+  short upgradeSeabaseLibmgr2(ExeCliInterface * inCliInterface);
   short dropSeabaseLibmgr(ExeCliInterface *inCliInterface);
   short createLibmgrProcs(ExeCliInterface * cliInterface);
   short grantLibmgrPrivs(ExeCliInterface *cliInterface);
@@ -1497,15 +1505,24 @@ protected:
                   NABoolean inRecovery = FALSE);
   short alterRenameRepos(ExeCliInterface * cliInterface, NABoolean newToOld);
   short copyOldReposToNew(ExeCliInterface * cliInterface);
+
   short dropAndLogReposViews(ExeCliInterface * cliInterface,
                              NABoolean & someViewSaved /* out */);
+  short createLibraries(ExeCliInterface * cliInterface);
+  short dropLibraries(ExeCliInterface * cliInterface, 
+                  NABoolean oldLibraries = FALSE, 
+                  NABoolean inRecovery = FALSE);
+  short alterRenameLibraries(ExeCliInterface * cliInterface, NABoolean newToOld);
+  short copyOldLibrariesToNew(ExeCliInterface * cliInterface);
 
 public:
 
   short upgradeRepos(ExeCliInterface * cliInterface, CmpDDLwithStatusInfo *mdui);
   short upgradeReposComplete(ExeCliInterface * cliInterface, CmpDDLwithStatusInfo *mdui);
   short upgradeReposUndo(ExeCliInterface * cliInterface, CmpDDLwithStatusInfo *mdui);
-
+  short upgradeLibraries(ExeCliInterface * cliInterface, CmpDDLwithStatusInfo *mdui);
+  short upgradeLibrariesComplete(ExeCliInterface * cliInterface, CmpDDLwithStatusInfo *mdui);
+  short upgradeLibrariesUndo(ExeCliInterface * cliInterface, CmpDDLwithStatusInfo *mdui);
   NAString genHBaseObjName(const NAString &catName, 
 			   const NAString &schName,
 			   const NAString &objName);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 79ed311..8b78f5f 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -3735,7 +3735,8 @@ Int64 CmpSeabaseDDL::getObjectInfo(
                                    Int64 & objectFlags,
                                    bool reportErrorNow,
                                    NABoolean checkForValidDef,
-                                   Int64 *createTime)
+                                   Int64 *createTime,
+                                   Int64 *redefTime)
 {
   Lng32 retcode = 0;
   Lng32 cliRC = 0;
@@ -3754,7 +3755,7 @@ Int64 CmpSeabaseDDL::getObjectInfo(
     strcpy(cfvd, " and valid_def = 'Y' ");
 
   char buf[4000];
-  str_sprintf(buf, "select object_uid, object_owner, schema_owner, flags, create_time from
%s.\"%s\".%s where catalog_name = '%s' and schema_name = '%s' and object_name = '%s'  and
object_type = '%s' %s ",
+  str_sprintf(buf, "select object_uid, object_owner, schema_owner, flags, create_time,redef_time
from %s.\"%s\".%s where catalog_name = '%s' and schema_name = '%s' and object_name = '%s'
 and object_type = '%s' %s ",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catName, quotedSchName.data(), quotedObjName.data(),
               objectTypeLit, cfvd);
@@ -3805,6 +3806,11 @@ Int64 CmpSeabaseDDL::getObjectInfo(
   if (createTime)
     *createTime = *(Int64*)ptr;
   
+ // return create_time
+  cliInterface->getPtrAndLen(6, ptr, len);
+  if (redefTime)
+    *redefTime = *(Int64*)ptr;
+  
   cliInterface->fetchRowsEpilogue(NULL, TRUE);
 
   return objUID;
@@ -5167,10 +5173,12 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
       cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
       return -1;
     }
-
-  str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', %d, 0)",
-              getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES,
-              libObjUID, libPath, routineInfo->library_version);
+  
+     
+  str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', empty_blob(), %d, 0)",
+                   getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES,
+              libObjUID, libPath,routineInfo->library_version);
+     
   
   cliRC = cliInterface->executeImmediate(buf);
   if (cliRC < 0)
@@ -7231,8 +7239,10 @@ short CmpSeabaseDDL::updateSeabaseAuths(
 
  New method is called  initTrafMD.
 
+
 */
 
+
 void CmpSeabaseDDL::createSeabaseMDviews()
 {
   if (!ComUser::isRootUserID())
@@ -7318,14 +7328,14 @@ void CmpSeabaseDDL::createSeabaseSchemaObjects()
 
 }
 
+
 short CmpSeabaseDDL::createDefaultSystemSchema(ExeCliInterface *cliInterface)
 {
   Lng32 cliRC = 0;
   char buf[4000];
   
   str_sprintf(buf,"create shared schema " TRAFODION_SYSCAT_LIT"." SEABASE_SYSTEM_SCHEMA"
");
-  
-  cliRC = cliInterface->executeImmediate(buf);
+   cliRC = cliInterface->executeImmediate(buf);
   if (cliRC < 0)
     {
       cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
@@ -7335,6 +7345,25 @@ short CmpSeabaseDDL::createDefaultSystemSchema(ExeCliInterface *cliInterface)
   return 0;
 }
 
+short CmpSeabaseDDL::createLibrariesObject(ExeCliInterface *cliInterface)
+{
+  Lng32 retcode = 0;
+  Lng32 cliRC = 0;
+  char buf[4000];
+ 
+  str_sprintf(buf,"create table %s.\"%s\".LIBRARIES (library_uid largeint not null not serialized,library_filename
varchar(512) character set iso88591 not null not serialized,library_storage  blob, version
int not null not serialized, flags largeint not null not serialized)  primary key (library_uid)
attribute hbase format ; ", getSystemCatalog(),SEABASE_MD_SCHEMA );
+
+  cliRC = cliInterface->executeImmediate(buf);
+  if (cliRC < 0)
+    {
+      cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
+      return -1;
+    }
+
+  return retcode;
+
+}
+
 short CmpSeabaseDDL::createSchemaObjects(ExeCliInterface *cliInterface)
 
 {
@@ -8837,7 +8866,12 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode
* ddlNode,
     }
   else if (ddlExpr->upgradeLibmgr())
     {
-      upgradeSeabaseLibmgr(&cliInterface);
+      if( (CmpCommon::getDefault(USE_LIB_BLOB_STORE) == DF_OFF))
+        upgradeSeabaseLibmgr(&cliInterface);
+      else
+        {
+          upgradeSeabaseLibmgr2(&cliInterface);         
+        }
     }
   else if (ddlExpr->updateVersion())
     {
@@ -9246,26 +9280,49 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode
* ddlNode,
           // create seabase library
           StmtDDLCreateLibrary * createLibraryParseNode =
             ddlNode->castToStmtDDLNode()->castToStmtDDLCreateLibrary();
-          
-          createSeabaseLibrary(createLibraryParseNode, currCatName, 
+          if( (CmpCommon::getDefault(USE_LIB_BLOB_STORE) == DF_OFF))
+            createSeabaseLibrary(createLibraryParseNode, currCatName, 
                                currSchName);
+          else
+            {
+              if (isLibBlobStoreValid(&cliInterface)==0)
+                createSeabaseLibrary2(createLibraryParseNode, currCatName, 
+                                      currSchName);
+              else
+                *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_CREATE_OBJECT);
+      
+            }
         }
       else if (ddlNode->getOperatorType() == DDL_DROP_LIBRARY)
         {
           // drop seabase library
           StmtDDLDropLibrary * dropLibraryParseNode =
             ddlNode->castToStmtDDLNode()->castToStmtDDLDropLibrary();
-          
-          dropSeabaseLibrary(dropLibraryParseNode, currCatName, currSchName);
+          if( (CmpCommon::getDefault(USE_LIB_BLOB_STORE) == DF_OFF))
+            dropSeabaseLibrary(dropLibraryParseNode, currCatName, currSchName);
+          else
+            {
+              if (isLibBlobStoreValid(&cliInterface)==0)
+                dropSeabaseLibrary2(dropLibraryParseNode, currCatName, currSchName);
+              else
+                 *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_DROP_OBJECT);
+            }
         }
        else if (ddlNode->getOperatorType() == DDL_ALTER_LIBRARY)
          {
            // create seabase library
            StmtDDLAlterLibrary * alterLibraryParseNode =
              ddlNode->castToStmtDDLNode()->castToStmtDDLAlterLibrary();
-           
-           alterSeabaseLibrary(alterLibraryParseNode, currCatName, 
-                               currSchName);
+           if( (CmpCommon::getDefault(USE_LIB_BLOB_STORE) == DF_OFF))
+             alterSeabaseLibrary(alterLibraryParseNode, currCatName, 
+                                 currSchName);
+           else
+             {
+               if (isLibBlobStoreValid(&cliInterface)==0)
+                alterSeabaseLibrary2(alterLibraryParseNode, currCatName, currSchName);
+              else
+                *CmpCommon::diags() << DgSqlCode(CAT_CANNOT_ALTER_WRONG_TYPE);
+             }
          }
       else if (ddlNode->getOperatorType() == DDL_CREATE_ROUTINE)
         {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpSeabaseDDLincludes.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLincludes.h b/core/sql/sqlcomp/CmpSeabaseDDLincludes.h
index 9cbae54..e2713e3 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLincludes.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLincludes.h
@@ -105,7 +105,7 @@ enum {
   METADATA_MAJOR_VERSION = 2,
   METADATA_OLD_MAJOR_VERSION = 1,
   METADATA_MINOR_VERSION = 1,
-  METADATA_UPDATE_VERSION = 0,
+  METADATA_UPDATE_VERSION = 1,
   METADATA_OLD_MINOR_VERSION = 1,
   METADATA_OLD_UPDATE_VERSION = 0,
   DATAFORMAT_MAJOR_VERSION = 1,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp b/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp
index e5491aa..ca24b2a 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp
@@ -49,6 +49,7 @@ enum InitTrafSteps {
   IT_CREATE_SCHEMA_OBJECTS,
   IT_CREATE_MD_VIEWS,
   IT_CREATE_REPOS,
+  IT_CREATE_LIBRARIES,
   IT_CREATE_PRIVMGR_REPOS,
   IT_CREATE_LIBMGR,
   IT_STEP_FAILED,
@@ -692,7 +693,42 @@ short CmpSeabaseDDL::initTrafMD(CmpDDLwithStatusInfo *dws)
               } // switch
           }
           break;
+        case IT_CREATE_LIBRARIES:
+          {
+            switch (dws->subStep())
+              {
+              case 0:
+                {
+                  setValuesInDWS(dws, IT_NO_CHANGE,
+                                 "Create Libraries Tables: Started", 1, FALSE,
+                                 TRUE, FALSE, FALSE);
+
+                  return 0;
+                }
+                break;
+
+              case 1:
+                {
+                  ExeCliInterface cliInterface(STMTHEAP, 0, NULL, 
+                                               CmpCommon::context()->sqlSession()->getParentQid());
+
+                  if (createLibrariesObject(&cliInterface))
+                    {
+                      setValuesInDWS(dws, IT_STEP_FAILED,
+                                     "Create Libraries Tables: Failed", 0, TRUE,
+                                     FALSE, TRUE, TRUE);
+                      return 0;
+                    }
 
+                  setValuesInDWS(dws, IT_CREATE_PRIVMGR_REPOS,
+                                 "Create Libraries Tables: Completed", 0, TRUE,
+                                 FALSE, TRUE, TRUE);
+
+                  return 0;
+                } // case 1
+              } // switch
+          }
+          break;
         case IT_CREATE_PRIVMGR_REPOS:
           {
             switch (dws->subStep())

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpSeabaseDDLmd.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLmd.h b/core/sql/sqlcomp/CmpSeabaseDDLmd.h
index fefc29e..98ace75 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLmd.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLmd.h
@@ -190,7 +190,8 @@ static const QString seabaseLibrariesDDL[] =
   {" primary key (library_uid) "},
   {" attribute hbase format "},
   {" ; "}
-};
+  };
+
 
 static const QString seabaseLibrariesUsageDDL[] =
 {
@@ -497,7 +498,7 @@ static const QString seabaseViewsUsageDDL[] =
 
 static const ComTdbVirtTableRoutineInfo seabaseMDValidateRoutineInfo =
   {
-    "VALIDATEROUTINE", COM_PROCEDURE_TYPE_LIT,  COM_LANGUAGE_JAVA_LIT, 1, COM_NO_SQL_LIT,
0, 0, COM_STYLE_JAVA_CALL_LIT, COM_NO_TRANSACTION_REQUIRED_LIT, 0, 0, "org.trafodion.sql.udr.LmUtility.validateMethod",
COM_ROUTINE_NO_PARALLELISM_LIT, " ", COM_ROUTINE_EXTERNAL_SECURITY_INVOKER_LIT, COM_ROUTINE_SAFE_EXECUTION_LIT,
" ", 1, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;III[Ljava/lang/String;[I[Ljava/lang/String;)V",
" "
+    "VALIDATEROUTINE", COM_PROCEDURE_TYPE_LIT,  COM_LANGUAGE_JAVA_LIT, 1, COM_NO_SQL_LIT,
0, 0, COM_STYLE_JAVA_CALL_LIT, COM_NO_TRANSACTION_REQUIRED_LIT, 0, 0, "org.trafodion.sql.udr.LmUtility.validateMethod",
COM_ROUTINE_NO_PARALLELISM_LIT, " ", COM_ROUTINE_EXTERNAL_SECURITY_INVOKER_LIT, COM_ROUTINE_SAFE_EXECUTION_LIT,
" ", 1, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;III[Ljava/lang/String;[I[Ljava/lang/String;)V",
" ",0
   };
 
 static const ComTdbVirtTableColumnInfo seabaseMDValidateRoutineColInfo[] =
@@ -633,9 +634,9 @@ static const MDTableInfo allMDtablesInfo[] = {
    seabaseKeysDDL, sizeof(seabaseKeysDDL),
    NULL, 0, FALSE},
 
-  {SEABASE_LIBRARIES, 
+  /* {SEABASE_LIBRARIES, 
    seabaseLibrariesDDL, sizeof(seabaseLibrariesDDL),
-   NULL, 0, FALSE},
+   NULL, 0, FALSE},*/
 
   {SEABASE_LIBRARIES_USAGE, 
    seabaseLibrariesUsageDDL, sizeof(seabaseLibrariesUsageDDL),
@@ -746,6 +747,7 @@ static const MDTableInfo allMDHistInfo[] = {
 #define SEABASE_SEQ_GEN_OLD_MD          SEABASE_SEQ_GEN"_OLD_MD"
 #define SEABASE_TABLES_OLD_MD              SEABASE_TABLES"_OLD_MD"
 #define SEABASE_TABLE_CONSTRAINTS_OLD_MD SEABASE_TABLE_CONSTRAINTS"_OLD_MD"
+#define SEABASE_TABLE_CONSTRAINTS_IDX_OLD_MD SEABASE_TABLE_CONSTRAINTS_IDX"_OLD_MD" 
 #define SEABASE_TEXT_OLD_MD                 SEABASE_TEXT"_OLD_MD"
 #define SEABASE_UNIQUE_REF_CONSTR_USAGE_OLD_MD SEABASE_UNIQUE_REF_CONSTR_USAGE"_OLD_MD"
 #define SEABASE_VIEWS_OLD_MD                SEABASE_VIEWS"_OLD_MD"
@@ -1117,7 +1119,7 @@ static const QString seabaseOldTrafMDv11ViewsUsageDDL[] =
 
 static const ComTdbVirtTableRoutineInfo seabaseOldTrafMDv11MDValidateRoutineInfo =
   {
-    "VALIDATEROUTINE", COM_PROCEDURE_TYPE_LIT,  COM_LANGUAGE_JAVA_LIT, 1, COM_NO_SQL_LIT,
0, 0, COM_STYLE_JAVA_CALL_LIT, COM_NO_TRANSACTION_REQUIRED_LIT, 0, 0, "org.trafodion.sql.udr.LmUtility.validateMethod",
COM_ROUTINE_NO_PARALLELISM_LIT, " ", COM_ROUTINE_EXTERNAL_SECURITY_INVOKER_LIT, COM_ROUTINE_SAFE_EXECUTION_LIT,
" ", 1, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;III[Ljava/lang/String;[I[Ljava/lang/String;)V",
" "
+    "VALIDATEROUTINE", COM_PROCEDURE_TYPE_LIT,  COM_LANGUAGE_JAVA_LIT, 1, COM_NO_SQL_LIT,
0, 0, COM_STYLE_JAVA_CALL_LIT, COM_NO_TRANSACTION_REQUIRED_LIT, 0, 0, "org.trafodion.sql.udr.LmUtility.validateMethod",
COM_ROUTINE_NO_PARALLELISM_LIT, " ", COM_ROUTINE_EXTERNAL_SECURITY_INVOKER_LIT, COM_ROUTINE_SAFE_EXECUTION_LIT,
" ", 1, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;III[Ljava/lang/String;[I[Ljava/lang/String;)V",
" ",0
   };
 
 static const ComTdbVirtTableColumnInfo seabaseOldTrafMDv11MDValidateRoutineColInfo[] =

http://git-wip-us.apache.org/repos/asf/trafodion/blob/9528f8c0/core/sql/sqlcomp/CmpSeabaseDDLrepos.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLrepos.h b/core/sql/sqlcomp/CmpSeabaseDDLrepos.h
index 7a672d4..92ac39e 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLrepos.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLrepos.h
@@ -30,7 +30,7 @@
 
 #ifndef _CMP_SEABASE_REPOS_H_
 #define _CMP_SEABASE_REPOS_H_
-
+#include "CmpSeabaseDDLupgrade.h"
 #define TRAF_METRIC_QUERY_VIEW "METRIC_QUERY_VIEW"
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -894,8 +894,33 @@ static const QString createOldv23ReposMetricQueryAggrTable[] =
  {" primary key ( aggregation_start_utc_ts, session_id ) salt using 8 partitions "},
  {" ; "}
 };
-
 static const MDUpgradeInfo allReposUpgradeInfo[] = {
+ { REPOS_METRIC_QUERY_TABLE,  TRAF_METRIC_QUERY_TABLE_OLD_REPOS,
+   createMetricQueryTable,  sizeof(createMetricQueryTable),
+   NULL,0,
+   NULL, 0,
+   FALSE, NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
+ // REPOS_METRIC_SESSION_TABLE
+  { REPOS_METRIC_SESSION_TABLE,  TRAF_METRIC_SESSION_TABLE_OLD_REPOS,
+    createMetricSessionTable,  sizeof(createMetricSessionTable),
+    NULL,0,
+    NULL, 0,
+    FALSE, NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
+  // REPOS_METRIC_QUERY_AGGR_TABLE
+  { REPOS_METRIC_QUERY_AGGR_TABLE,  TRAF_METRIC_QUERY_AGGR_TABLE_OLD_REPOS,
+    createMetricQueryAggrTable,  sizeof(createMetricQueryAggrTable),
+    NULL,0,
+    NULL, 0,
+    FALSE, NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
+  // REPOS_METRIC_TEXT_TABLE  
+  { REPOS_METRIC_TEXT_TABLE,  NULL,
+    createMetricTextTable,  sizeof(createMetricTextTable),
+    NULL, 0,
+    NULL, 0,
+    FALSE, NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
+  
+};
+static const MDUpgradeInfo allReposv110Tov210UpgradeInfo[] = {
 
   // TRAF_METRIC_QUERY_TABLE
   { REPOS_METRIC_QUERY_TABLE,  TRAF_METRIC_QUERY_TABLE_OLD_REPOS,


Mime
View raw message