Fix issue with init sql ordering
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/fab3c416 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/fab3c416 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/fab3c416 Branch: refs/heads/master Commit: fab3c4164a0a3f8a8acd48afe07b4f10eaee8de1 Parents: 9528f8c Author: Sandhya Sundaresan <[email protected]> Authored: Sat Sep 29 01:36:37 2018 +0000 Committer: Sandhya Sundaresan <[email protected]> Committed: Sat Sep 29 01:36:37 2018 +0000 ---------------------------------------------------------------------- core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 17 ++++------- core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp | 42 ++++++++++++++------------ 2 files changed, 28 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/fab3c416/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp index 8b78f5f..8945254 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp @@ -9285,11 +9285,10 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode, currSchName); else { - if (isLibBlobStoreValid(&cliInterface)==0) + createSeabaseLibrary2(createLibraryParseNode, currCatName, currSchName); - else - *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_CREATE_OBJECT); + } } @@ -9301,11 +9300,8 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode, 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); + { + dropSeabaseLibrary2(dropLibraryParseNode, currCatName, currSchName); } } else if (ddlNode->getOperatorType() == DDL_ALTER_LIBRARY) @@ -9318,10 +9314,9 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode, 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/fab3c416/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp b/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp index ca24b2a..5c6773c 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLinitraf.cpp @@ -529,25 +529,7 @@ short CmpSeabaseDDL::initTrafMD(CmpDDLwithStatusInfo *dws) } } // for - // update SPJ info - // Note that this is not an existing jar file, the class - // loader will attempt to load the class from the CLASSPATH if - // it can't find this jar - NAString installJar(getenv("TRAF_HOME")); - installJar += "/export/lib/trafodion-sql-currversion.jar"; - if (updateSeabaseMDSPJ(&cliInterface, sysCat, SEABASE_MD_SCHEMA, - SEABASE_VALIDATE_LIBRARY, - installJar.data(),SUPER_USER,SUPER_USER, - &seabaseMDValidateRoutineInfo, - sizeof(seabaseMDValidateRoutineColInfo) / sizeof(ComTdbVirtTableColumnInfo), - seabaseMDValidateRoutineColInfo)) - { - setValuesInDWS(dws, IT_STEP_FAILED, - "Update Metadata Tables: Failed", 0, TRUE, - FALSE, TRUE, TRUE); - - return 0; - } + updateSeabaseVersions(&cliInterface, sysCat); updateSeabaseAuths(&cliInterface, sysCat); @@ -684,7 +666,7 @@ short CmpSeabaseDDL::initTrafMD(CmpDDLwithStatusInfo *dws) return 0; } - setValuesInDWS(dws, IT_CREATE_PRIVMGR_REPOS, + setValuesInDWS(dws, IT_CREATE_LIBRARIES, "Create Repository Tables: Completed", 0, TRUE, FALSE, TRUE, TRUE); @@ -719,7 +701,27 @@ short CmpSeabaseDDL::initTrafMD(CmpDDLwithStatusInfo *dws) FALSE, TRUE, TRUE); return 0; } + // update SPJ info + // Note that this is not an existing jar file, the class + // loader will attempt to load the class from the CLASSPATH if + // it can't find this jar + NAString installJar(getenv("TRAF_HOME")); + installJar += "/export/lib/trafodion-sql-currversion.jar"; + const char* sysCat = + ActiveSchemaDB()->getDefaults().getValue(SEABASE_CATALOG); + if (updateSeabaseMDSPJ(&cliInterface, sysCat, SEABASE_MD_SCHEMA, + SEABASE_VALIDATE_LIBRARY, + installJar.data(),SUPER_USER,SUPER_USER, + &seabaseMDValidateRoutineInfo, + sizeof(seabaseMDValidateRoutineColInfo) / sizeof(ComTdbVirtTableColumnInfo), + seabaseMDValidateRoutineColInfo)) + { + setValuesInDWS(dws, IT_STEP_FAILED, + "Update MDSPJ : Failed", 0, TRUE, + FALSE, TRUE, TRUE); + return 0; + } setValuesInDWS(dws, IT_CREATE_PRIVMGR_REPOS, "Create Libraries Tables: Completed", 0, TRUE, FALSE, TRUE, TRUE);
