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

    https://github.com/apache/trafodion/pull/1665#discussion_r206623834
  
    --- Diff: core/sql/executor/cluster.cpp ---
    @@ -2325,6 +2368,50 @@ NABoolean Cluster::read(ExeErrorCode * rc) {
       } // WHILE ( TRUE )    
     };
     
    +//Wrapper function on read() to populate diags area.
    +//Returns: FALSE - either error, or need to call again
    +//       TRUE -- flush is done
    +NABoolean Cluster::read(ComDiagsArea *&da, CollHeap *heap) {
    +  ExeErrorCode rc = EXE_OK;
    +
    +  //read returning FALSE means either Error or IO_NOT_COMPLETE.
    +  //if rc != EXE_OK then it is error. 
    +  if(!read(&rc)) {
    +    if(rc != EXE_OK) {
    +       da = ComDiagsArea::allocate(heap);
    +       *da << DgSqlCode(-rc);
    +      
    +      char msg[512];
    +      if(rc == EXE_SORT_ERROR) {
    +        char errorMsg[100];
    +        Lng32 scratchError = 0;
    +        Lng32 scratchSysError = 0;
    +        Lng32 scratchSysErrorDetail = 0;
    +  
    +        if(clusterDb_) {
    +          clusterDb_->getScratchErrorDetail(scratchError,
    +                                 scratchSysError,
    +                                 scratchSysErrorDetail,
    +                                 errorMsg);
    +  
    +          str_sprintf(msg, "Cluster::read Scratch IO Error occurred. 
Scratch Error: %d, System Error: %d, System Error Detail: %d, Details: %s",
    --- End diff --
    
    Same comment as above


---

Reply via email to