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 #644: Trafodion 1788
Date Mon, 08 Aug 2016 21:22:43 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/644#discussion_r73957574
  
    --- Diff: core/sql/sqlcomp/PrivMgrPrivileges.cpp ---
    @@ -4208,43 +4514,59 @@ void PrivMgrPrivileges::summarizeColPrivs(
         // get COLUMN_PRIVILEGES rows where the grantee for the column has received 
         // privileges -  the row list is in memory so this does not require I/O
         std::vector<PrivMgrMDRow *> rowList;
    -    getColRowsForGranteeOrdinal(objReference.objectOwner,
    +    getColRowsForGranteeOrdinal(granteeID,
                                     colRef->columnOrdinal,
    +                                columnRowList_,
                                     roleIDs,
                                     rowList);
         
         // go through the rowList to summarize the original and current privileges
         // We do a union operation to capture privileges from all grantors
         ColumnReference *summarized = new ColumnReference; 
         summarized->columnOrdinal = colRef->columnOrdinal;
    -    for (int32_t i = 0; i < rowList.size();++i)
    -    {
    -      ColumnPrivsMDRow &row = static_cast<ColumnPrivsMDRow &> (*rowList[i]);
    -      PrivMgrCoreDesc originalPrivs(row.privsBitmap_, row.grantableBitmap_);
     
    -      ColumnReference ref;
    -      ref.columnOrdinal = row.columnOrdinal_;
    -      ref.originalPrivs = originalPrivs;
    -      ref.updatedPrivs = originalPrivs;
    -      
    -      // Update if privileges have been changed by request
    -      for (size_t j = 0; j < listOfAffectedObjects.size(); j++)
    +    if (rowList.size() > 0)
    +    {
    +      for (int32_t j = 0; j < rowList.size();++j)
           {
    -        ObjectUsage *currentObj = listOfAffectedObjects[j];
    -        if (currentObj->objectUID == row.objectUID_ &&
    -            grantorID_ == row.grantorID_ &&
    -            objReference.objectOwner == row.granteeID_ )
    +        ColumnPrivsMDRow &row = static_cast<ColumnPrivsMDRow &> (*rowList[j]);
    +        PrivMgrCoreDesc originalPrivs(row.privsBitmap_, row.grantableBitmap_);
    +        PrivMgrCoreDesc original = originalPrivs;
    --- End diff --
    
    I take it "original" is a copy of "originalPrivs"? Not sure why we make this copy? (originalPrivs
doesn't seem to be used again other than to make another copy into "updated")


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