Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/729#discussion_r80933596
  
    --- Diff: core/sql/sqlcomp/PrivMgrDesc.cpp ---
    @@ -550,14 +554,28 @@ void PrivMgrCoreDesc::interpretChanges( const bool 
before,       // in
     // 
----------------------------------------------------------------------------
     bool PrivMgrDesc::limitToGrantable( const PrivMgrDesc& other )
     {
    -
       bool result = false;
    -  PrivMgrCoreDesc logicalTablePrivs(other.tableLevel_);
    -  // TDB - include column level privileges
    -
    - if ( tableLevel_.limitToGrantable(logicalTablePrivs) )
    -    result = TRUE;
    +  if ( tableLevel_.limitToGrantable(other.tableLevel_) )
    +    result = true;
     
    -   return result;
    +  // Consider table level privileges when checking column privs
    +  PrivMgrCoreDesc temp = other.tableLevel_;
    +  for (int i = 0; i < columnLevel_.entries(); i++)
    +  {
    +    // Find associated column in other Desc list
    +    int index = other.getColumnPriv(columnLevel_[i].getColumnOrdinal());
    +    if (index >= 0)
    +    {
    +      temp.unionOfPrivs(other.columnLevel_[index]);
    +      if (columnLevel_[i].limitToGrantable(temp))
    +        result = true;
    +    }
    +    else
    +    {
    +      if (columnLevel_[i].limitToGrantable(temp))
    --- End diff --
    
    You are correct, the else is not needed, will fix it in the next checkin.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to