Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1470#discussion_r174285545
--- Diff: core/sql/executor/ex_root.cpp ---
@@ -2659,33 +2663,21 @@ void ex_root_tcb::registerCB(ComDiagsArea
*&diagsArea)
return;
}
}
- NABoolean diagsAreaAllocated = FALSE;
-
- if (diagsArea == NULL)
- {
- diagsAreaAllocated = TRUE;
- diagsArea = ComDiagsArea::allocate(getHeap());
- }
+ Lng32 fromCond = 0;
+ if (diagsArea != NULL)
+ fromCond = diagsArea->mark();
ExSsmpManager *ssmpManager = context->getSsmpManager();
- cbServer_ = ssmpManager->getSsmpServer(
+ cbServer_ = ssmpManager->getSsmpServer((NAHeap *)getHeap(),
cliGlobals->myNodeName(),
cliGlobals->myCpu(), diagsArea);
if (cbServer_ == NULL || cbServer_->getControlConnection() == NULL)
{
// We could not get a phandle for the cancel broker. However,
// let the query run (on the assumption that it will not need to
// be canceled) and convert any error conditions to warnings.
-
- // tbd - figure a way retry registration later, as the query
progresses.
- if (diagsArea != NULL)
- NegateAllErrors(diagsArea);
+ diagsArea->negateErrors(fromCond);
--- End diff --
Yes. The caller is responsible to deallocate it
---