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: [TRAFODION-1100] Creator of view...
Date Thu, 19 Nov 2015 23:51:21 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/182#discussion_r45418920
  
    --- 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 --
    
    I see... so in the one code path I alluded to, pPrivInfo is not pointing to a heap-allocated
object but is pointing to a member of an object (possibly heap-allocated), and other code
will take care of destroying that larger object.


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