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 #644: Trafodion 1788
Date Tue, 09 Aug 2016 16:33:50 GMT
Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/644#discussion_r74094624
  
    --- 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 --
    
    You are correct, will remove the original steps.


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