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 #660: TRAFODION [2137] Improve metadata acc...
Date Thu, 18 Aug 2016 15:27:18 GMT
Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/660#discussion_r75330235
  
    --- Diff: core/sql/generator/Generator.cpp ---
    @@ -1737,6 +1737,82 @@ TrafDesc * Generator::createConstrKeyColsDescs(Int32 numKeys,
       return first_key_desc;
     }
     
    +// ****************************************************************************
    +// This method creates a set of trafodion descriptors (TrafDesc) based on 
    +// ComTdbVirtTablePrivInfo 
    +//
    +// see ComTdb.h for a description of the ComTdbVirtTablePrivInfo
    +// see TrafDDLdesc.h for a description of TrafDesc for the priv_desc
    +// ****************************************************************************
    +TrafDesc * Generator::createPrivDescs( const ComTdbVirtTablePrivInfo * privInfo,
    +                                       Space * space)
    +{
    +  // When authorization is enabled, each object must have at least one grantee
    +  // - the system grant to the object owner
    +  std::vector<PrivMgrDesc> *privGrantees = privInfo[0].privmgr_desc_list;
    +  DCMPASSERT (privGrantees.size() > 0);
    + 
    +  TrafDesc * priv_desc = TrafAllocateDDLdesc(DESC_PRIV_TYPE, space);
    +  TrafDesc * first_grantee_desc = NULL;
    +  TrafDesc * prev_grantee_desc = NULL;
    +
    +  // generate a TrafPrivGranteeDesc for each grantee and
    +  // attach to the privileges descriptor (priv_desc)
    +  for (int i = 0; i < privGrantees->size(); i++)
    +    {
    +      PrivMgrDesc granteeDesc = (*privGrantees)[i];
    --- End diff --
    
    Using a reference would be more efficient.  Will test it out.


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