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

    https://github.com/apache/trafodion/pull/1723#discussion_r225658074
  
    --- Diff: core/sql/cli/Context.cpp ---
    @@ -4199,19 +4219,35 @@ RETCODE ContextCli::setDatabaseUserByName(const 
char *userName)
     // *
     // * Function: ContextCli::getRoleList
     // *
    -// * Return the role IDs granted to the current user 
    +// * Return the role IDs and their grantees for the current user.  
     // *   If the list of roles is already stored, just return this list.
     // *   If the list of roles does not exist extract the roles granted to the
     // *     current user from the Metadata and store in roleIDs_.
     // *
     // 
****************************************************************************
     RETCODE ContextCli::getRoleList(
    -  Int32 &numRoles,
    -  Int32 *&roleIDs)
    +  Int32 &numEntries,
    +  Int32 *& roleIDs,
    +  Int32 *& granteeIDs)
     {
       // If role list has not been created, go read metadata
       if (roleIDs_ == NULL)
       {
    +    // If authorization is not enabled, just setup the PUBLIC role
    +    CmpContext *cmpCntxt = CmpCommon::context();
    +    ex_assert(cmpCntxt, "No compiler context exists");
    --- End diff --
    
    The assert is fine, but unnecessary since we'd just core anyway on the very 
next statement when we dereference a null pointer.


---

Reply via email to