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

    https://github.com/apache/trafodion/pull/1504#discussion_r178947965
  
    --- Diff: core/sql/exp/ExpError.cpp ---
    @@ -135,6 +135,20 @@ ComDiagsArea *ExRaiseSqlError(CollHeap* heap, 
ComDiagsArea** diagsArea,
                        intParam1, intParam2, intParam3, 
                        stringParam1, stringParam2, stringParam3);
     }
    + 
    +ComDiagsArea *ExRaiseSqlError(CollHeap* heap, ComDiagsArea** diagsArea,
    --- End diff --
    
    This function is modeled after other ExRaiseSqlError functions already in 
this file.  I wasn't sure how ComDiagsArea would be passed to the callers of 
ExRaiseSqlError, meaning if it would exist or not.  If the ComDiagsArea is 
passed to the caller as a parameter to itself and then it would be become 
recursive change to ensure that all the function in the chain passes reference 
pointers.
    
     The existing ExRaiseSqlError excepts the enum ExeErrorCode needs to be 
updated to raise sql error correctly.  However, with the embedded arkcmp 
concepts, even the non-executor error codes needs to be passed to this 
function.  Casting to enum ExeErrorCode when the code doesn't exist in it 
causes unexpected value. Hence this new function was introduced to raise sql 
error. Earlier, the code assumed that diagsArea is always allocated and 
populated it.


---

Reply via email to