trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertamarton <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1100] Creator of view...
Date Thu, 19 Nov 2015 23:43:51 GMT
Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/182#discussion_r45418307
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLview.cpp ---
    @@ -1498,32 +1577,50 @@ PrivColumnBitmap colGrantableBitmap;
           }
           int32_t usedColNumber = naCol->getPosition();
          
    -      // Grab privileges from the NATable structure
    -      PrivMgrUserPrivs *privs = naTable->getPrivInfo();
    -      if (privs == NULL) 
    +      PrivMgrUserPrivs privs;
    +      PrivMgrUserPrivs *pPrivInfo = NULL;
    +      if (viewCreator)
    +        pPrivInfo = naTable->getPrivInfo();
    +      else
    +      {
    +        PrivStatus retcode = privInterface.getPrivileges((int64_t)naTable->objectUid().get_value(),
    +                                                           naTable->getObjectType(),
    +                                                           naTable->getOwner(),
    +                                                           privs);
    +
    +        if (retcode == STATUS_ERROR)
    +        {
    +           *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_RETRIEVE_PRIVS);
    +           return false;
    +        }
    +        pPrivInfo = &privs;
    --- End diff --
    
    As part of creating the natable, the list of privileges the current user has is allocated
and stored in the class.  This information is retained until the entry is removed.  There
should not be any memory leak.  


---
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