[TRAFODION-3166] enhance 8427 error detail when thrown by sequence operator #1665
Conversation
Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2870/ |
Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/2870/ |
core/sql/executor/ExSequence.cpp
Outdated
@@ -1487,7 +1487,35 @@ void ExSequenceTcb::updateDiagsArea( ExeErrorCode rc_) | |||
} | |||
if (!da->contains((Lng32) -rc_)) | |||
{ | |||
*da << DgSqlCode(-rc_); | |||
char msg[512]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if you can encapsulate these changes in cluster_->flush(). The caller doesn't need to know about the internals of cluster_
New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2873/ |
Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/2873/ |
New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2901/ |
Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/2901/ |
+1, but it would be good to take care of the minor comments. |
New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2910/ |
core/sql/executor/ExSequence.cpp
Outdated
// if no errors this code path is not visited | ||
if ( rc_ ) | ||
if (myDiags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good to not to treat pointers as boolean variable
core/sql/executor/cluster.cpp
Outdated
scratchSysErrorDetail, | ||
errorMsg); | ||
|
||
str_sprintf(msg, "Scratch IO Error occurred. Scratch Error: %d, System Error: %d, System Error Detail: %d, Details: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing with snprintf.
core/sql/executor/cluster.cpp
Outdated
//if rc != EXE_OK then it is error. | ||
if(!flush(&rc)) { | ||
if(rc != EXE_OK) { | ||
da = ComDiagsArea::allocate(heap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible that caller might pass-in a diags Area with warnings
core/sql/executor/cluster.cpp
Outdated
scratchSysErrorDetail, | ||
errorMsg); | ||
|
||
str_sprintf(msg, "Cluster::read Scratch IO Error occurred. Scratch Error: %d, System Error: %d, System Error Detail: %d, Details: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above
Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/2910/ |
ERROR[8427] [2018-07-23 15:52:16]
will now be more descriptive
*** ERROR[8427] Sequence Scratch IO Error occurred. Scratch Error: -10005, System Error: 13, System Error Detail: 0, Details: SQScratchFile::SQScratchFile 3
--- 0 row(s) selected.