trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #634: JIRA TRAFODION-2137 metadata access p...
Date Tue, 02 Aug 2016 21:54:07 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/634#discussion_r73245549
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLschema.cpp ---
    @@ -971,6 +972,251 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
     
     // *****************************************************************************
     // *                                                                           *
    +// * Function: CmpSeabaseDDL::alterSeabaseSchema                                *
    +// *                                                                           *
    +// *    Implements the ALTER SCHEMA command.                                    *
    +// *                                                                           *
    +// *****************************************************************************
    +// *                                                                           *
    +// *  Parameters:                                                              *
    +// *                                                                           *
    +// *  <alterSchemaNode>                StmtDDLAlterSchema *             In    
  *
    +// *    is a pointer to a create schema parser node.                           *
    +// *                                                                           *
    +// *****************************************************************************
    +void CmpSeabaseDDL::alterSeabaseSchema(StmtDDLAlterSchema * alterSchemaNode)
    +   
    +{
    +   Lng32 cliRC = 0;
    +
    +   ComSchemaName schemaName(alterSchemaNode->getSchemaName());
    +   NAString catName = schemaName.getCatalogNamePartAsAnsiString();
    +   ComAnsiNamePart schNameAsComAnsi = schemaName.getSchemaNamePart();
    +   NAString schName = schNameAsComAnsi.getInternalName();
    +   ComObjectName objName(catName,schName,NAString("dummy"),COM_TABLE_NAME,TRUE);
    +
    +   ExeCliInterface cliInterface(STMTHEAP, NULL, NULL, 
    +                                CmpCommon::context()->sqlSession()->getParentQid());
    +   Int32 objectOwnerID = 0;
    +   Int32 schemaOwnerID = 0;
    +   ComObjectType objectType;
    +
    +   bool isVolatile = (memcmp(schName.data(),"VOLATILE_SCHEMA",strlen("VOLATILE_SCHEMA"))
== 0);
    +   int32_t length = 0;
    +   int32_t rowCount = 0;
    +   bool someObjectsCouldNotBeAltered = false;
    +   char errorObjs[1010];
    +   Queue * objectsQueue = NULL;
    +   Queue * otherObjectsQueue = NULL;
    +
    +   NABoolean dirtiedMetadata = FALSE;
    +   Int32 checkErr = 0;
    +
    +   StmtDDLAlterTableStoredDesc::AlterStoredDescType sdo = 
    +     alterSchemaNode->getStoredDescOperation();
    +
    +   errorObjs[0] = 0;
    +
    +   Int64 schemaUID = getObjectTypeandOwner(&cliInterface,catName.data(),schName.data(),
    +                               SEABASE_SCHEMA_OBJECTNAME,objectType,schemaOwnerID);
    +   
    +   // if schemaUID == -1, then either the schema does not exist or an unexpected error
occurred
    +   if (schemaUID == -1)
    +   {
    +      // If an error occurred, return
    +      if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_) > 0)
    +          goto label_error;
    + 
    +      // A Trafodion schema does not exist if the schema object row is not
    +      // present: CATALOG-NAME.SCHEMA-NAME.__SCHEMA__.
    +      *CmpCommon::diags() << DgSqlCode(-CAT_SCHEMA_DOES_NOT_EXIST_ERROR)
    +                          << DgSchemaName(schemaName.getExternalName().data());
    +      goto label_error;
    +   }
    +
    +   if (!isDDLOperationAuthorized(SQLOperation::DROP_SCHEMA,
    --- End diff --
    
    Is there an ADD_SCHEMA privilege? Just curious: Why did we pick DROP_SCHEMA privilege
for an alter schema operation?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message